mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
WIP
This commit is contained in:
parent
f5d0ff3717
commit
2497fa0554
2 changed files with 20 additions and 0 deletions
|
@ -216,6 +216,14 @@
|
|||
(let* ((in-file (car args))
|
||||
(in-prog (read-file in-file))
|
||||
(program? (not (library? (car in-prog))))
|
||||
; TODO: trying to get this here, then can pass it to
|
||||
; compiler code (for entry points) and below for
|
||||
; gcc calls (need to wrap in .o string for that though)
|
||||
;(lib-deps
|
||||
; (if (and program?
|
||||
; (tagged-list? 'import (car in-prog)))
|
||||
; (lib:get-all-import-deps (cadr in-prog))
|
||||
; '()))
|
||||
(exec-file (basename in-file))
|
||||
(src-file (string-append exec-file ".c"))
|
||||
(create-c-file
|
||||
|
@ -257,6 +265,7 @@
|
|||
(string-append " " str " "))
|
||||
(lib:imports->objs (cdar in-prog)))))
|
||||
"")))
|
||||
;(write `(DEBUG all imports ,lib-deps objs ,objs-str))
|
||||
(if (equal? 0
|
||||
(system
|
||||
(string-append "gcc " src-file " -I" (cyc:get-include-dir) " -g -c -o " exec-file ".o")))
|
||||
|
|
11
trans.scm
11
trans.scm
|
@ -1639,6 +1639,17 @@
|
|||
))
|
||||
imports)))
|
||||
|
||||
;; Given import names, get all dependant import names that are required
|
||||
(define (lib:get-all-import-deps imports)
|
||||
(delete-duplicates
|
||||
(apply
|
||||
append
|
||||
(map
|
||||
(lambda (i)
|
||||
(write `(DEBUG i ,i))
|
||||
(cons i (lib:get-all-import-deps (lib:read-imports i))))
|
||||
imports))))
|
||||
|
||||
;; Given a single import from an import-set, open the corresponding
|
||||
;; library file and retrieve the library's import-set.
|
||||
(define (lib:read-imports import)
|
||||
|
|
Loading…
Add table
Reference in a new issue