mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
WIP
This commit is contained in:
parent
d10a45e62d
commit
722b6f22ef
2 changed files with 23 additions and 11 deletions
17
cyclone.scm
17
cyclone.scm
|
@ -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
|
||||
|
|
17
trans.scm
17
trans.scm
|
@ -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)))
|
||||
|
|
Loading…
Add table
Reference in a new issue