Allow printing of actual gcc messages

This commit is contained in:
Justin Ethier 2015-06-23 21:45:43 -04:00
parent 5f3b082e27
commit 606c0f4d45

View file

@ -253,26 +253,36 @@
;; Compile the generated C file ;; Compile the generated C file
;; TODO: -I is a hack, real answer is to use 'make install' to place .h file ;; TODO: -I is a hack, real answer is to use 'make install' to place .h file
(if cc?
(cond (cond
(program? (program?
(let ((objs-str (letrec ((objs-str
(apply (apply
string-append string-append
(map (map
(lambda (i) (lambda (i)
(string-append " " (lib:import->filename i ".o") " ")) (string-append " " (lib:import->filename i ".o") " "))
lib-deps)))) lib-deps)))
(comp-prog-cmd
(string-append "gcc " src-file " -I" (cyc:get-include-dir) " -g -c -o " exec-file ".o"))
(comp-objs-cmd
(string-append "gcc " exec-file ".o " objs-str " -L" (cyc:get-clib-dir) " -lcyclone -lm -I" (cyc:get-include-dir) " -g -o " exec-file)))
;(write `(DEBUG all imports ,lib-deps objs ,objs-str)) ;(write `(DEBUG all imports ,lib-deps objs ,objs-str))
;(write `(DEBUG ,(lib:get-all-import-deps (cdar in-prog)))) ;(write `(DEBUG ,(lib:get-all-import-deps (cdar in-prog))))
(if (equal? 0 (cond
(system (cc?
(string-append "gcc " src-file " -I" (cyc:get-include-dir) " -g -c -o " exec-file ".o"))) (if (equal? 0 (system comp-prog-cmd))
(system (system comp-objs-cmd)))
(string-append "gcc " exec-file ".o " objs-str " -L" (cyc:get-clib-dir) " -lcyclone -lm -I" (cyc:get-include-dir) " -g -o " exec-file)))))
(else (else
(system (write comp-prog-cmd)
(string-append "gcc " src-file " -I" (cyc:get-include-dir) " -g -c -o " exec-file ".o"))))))) (write comp-objs-cmd)))))
(else
(let ((comp-lib-cmd
(string-append "gcc " src-file " -I" (cyc:get-include-dir) " -g -c -o " exec-file ".o")))
(cond
(cc?
(system comp-lib-cmd))
(else
(write comp-lib-cmd))))))))
;; Handle command line arguments ;; Handle command line arguments