mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-25 13:05:05 +02:00
WIP
This commit is contained in:
parent
d10a45e62d
commit
722b6f22ef
2 changed files with 23 additions and 11 deletions
|
@ -228,13 +228,16 @@
|
||||||
|
|
||||||
;; Compile the generated C file
|
;; Compile the generated C file
|
||||||
(if cc?
|
(if cc?
|
||||||
(if program?
|
(cond
|
||||||
|
(program?
|
||||||
|
; TODO: (write `(DEBUG ,(lib:imports->objs (cdar input-program) ".")))
|
||||||
(system
|
(system
|
||||||
;; -I is a hack, real answer is to use 'make install' to place .h file
|
;; -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
|
;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))
|
(string-append "gcc " src-file " -L. -lcyclone -lm -I. -g -o " exec-file)))
|
||||||
|
(else
|
||||||
(system
|
(system
|
||||||
(string-append "gcc " src-file " -I. -g -c -o " exec-file ".o"))))))
|
(string-append "gcc " src-file " -I. -g -c -o " exec-file ".o")))))))
|
||||||
|
|
||||||
|
|
||||||
;; Handle command line arguments
|
;; 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.
|
;; 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
|
;; longer-term, do we want to look at file timestamps to see if files need to
|
||||||
;; be recompiled?
|
;; be recompiled?
|
||||||
(define (lib:imports->objs imports)
|
(define (lib:imports->objs imports basedir)
|
||||||
(for-each
|
(map
|
||||||
(lambda (i)
|
(lambda (i)
|
||||||
TODO)
|
(append (lib:imports->objs (lib:read-imports i basedir))
|
||||||
imports)
|
(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
|
;; Read export list for a given import
|
||||||
(define (lib:import->export-list import basedir)
|
(define (lib:import->export-list import basedir)
|
||||||
(let* ((dir (string-append basedir (lib:import->filename import)))
|
(let* ((dir (string-append basedir (lib:import->filename import)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue