This commit is contained in:
Justin Ethier 2015-05-12 22:12:06 -04:00
parent c9af448be2
commit d10a45e62d
2 changed files with 15 additions and 2 deletions

View file

@ -231,7 +231,7 @@
(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
;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"))))))

View file

@ -1802,8 +1802,21 @@
import))
".sld"))
;; Resolve, EG: (libs lib2) ==> lib2.o
;; Thing is though, what if a library includes another library? now the
;; program needs to link to both .o files
(define (lib:import->obj-file import)
'TODO)
(string-append (symbol->string (car (reverse import))) ".o"))
;; TODO: for a program import set, resolve each to their .o files, then
;; process each import recursively to get the .o files that each one of those
;; 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
(lambda (i)
TODO)
imports)
;; Read export list for a given import
(define (lib:import->export-list import basedir)
(let* ((dir (string-append basedir (lib:import->filename import)))