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? (letrec ((objs-str
(let ((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)))
;(write `(DEBUG all imports ,lib-deps objs ,objs-str)) (comp-prog-cmd
;(write `(DEBUG ,(lib:get-all-import-deps (cdar in-prog)))) (string-append "gcc " src-file " -I" (cyc:get-include-dir) " -g -c -o " exec-file ".o"))
(if (equal? 0 (comp-objs-cmd
(system (string-append "gcc " exec-file ".o " objs-str " -L" (cyc:get-clib-dir) " -lcyclone -lm -I" (cyc:get-include-dir) " -g -o " exec-file)))
(string-append "gcc " src-file " -I" (cyc:get-include-dir) " -g -c -o " exec-file ".o"))) ;(write `(DEBUG all imports ,lib-deps objs ,objs-str))
(system ;(write `(DEBUG ,(lib:get-all-import-deps (cdar in-prog))))
(string-append "gcc " exec-file ".o " objs-str " -L" (cyc:get-clib-dir) " -lcyclone -lm -I" (cyc:get-include-dir) " -g -o " exec-file))))) (cond
(else (cc?
(system (if (equal? 0 (system comp-prog-cmd))
(string-append "gcc " src-file " -I" (cyc:get-include-dir) " -g -c -o " exec-file ".o"))))))) (system comp-objs-cmd)))
(else
(write comp-prog-cmd)
(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