This commit is contained in:
Justin Ethier 2015-05-12 23:00:59 -04:00
parent d10a45e62d
commit 722b6f22ef
2 changed files with 23 additions and 11 deletions

View file

@ -228,13 +228,16 @@
;; Compile the generated C file
(if cc?
(if program?
(system
;; -I is a hack, real answer is to use 'make install' to place .h file
;TODO: need to link to object files from lib:import->obj-file
(string-append "gcc " src-file " -L. -lcyclone -lm -I. -g -o " exec-file))
(system
(string-append "gcc " src-file " -I. -g -c -o " exec-file ".o"))))))
(cond
(program?
; TODO: (write `(DEBUG ,(lib:imports->objs (cdar input-program) ".")))
(system
;; -I is a hack, real answer is to use 'make install' to place .h file
;TODO: n eed to link to object files from lib:import->obj-file
(string-append "gcc " src-file " -L. -lcyclone -lm -I. -g -o " exec-file)))
(else
(system
(string-append "gcc " src-file " -I. -g -c -o " exec-file ".o")))))))
;; Handle command line arguments

View file

@ -1812,11 +1812,20 @@
;; libs requires. will probably need to prune duplicates from completed list.
;; longer-term, do we want to look at file timestamps to see if files need to
;; be recompiled?
(define (lib:imports->objs imports)
(for-each
(define (lib:imports->objs imports basedir)
(map
(lambda (i)
TODO)
imports)
(append (lib:imports->objs (lib:read-imports i basedir))
(lib:import->obj-file i)))
imports))
(define (lib:read-imports import basedir)
(let* ((dir (string-append basedir (lib:import->filename import)))
(fp (open-input-file dir))
(lib (read-all fp))
(imports (lib:imports (car lib))))
(close-input-port fp)
imports))
;; Read export list for a given import
(define (lib:import->export-list import basedir)
(let* ((dir (string-append basedir (lib:import->filename import)))