minor improvements to modular compilation

- rename main.scm to repo2html.scm to match binary
- remove unused imports from utils.scm
This commit is contained in:
pho4cexa 2023-02-04 22:44:52 -08:00
parent 936a37bc76
commit c943210189
5 changed files with 8 additions and 27 deletions

2
.gitattributes vendored
View File

@ -1 +1 @@
main.scm ident
repo2html.scm ident

View File

@ -7,15 +7,12 @@ BIN = repo2html
default: compile
foo: foo.scm utils.import.scm utils.o
csc -O5 -I . -static -uses utils $< -o $@
%: %.scm
csc -O5 -static $<
# Note: things break if you use -O5 here.
%.import.scm: %.scm
csc -O4 -static -c -unit $* -j $* $<
$(DIR_BUILD)/$(BIN): $(SRC) $(DIR_BUILD) $(addsuffix .import.scm,$(LOCAL_MODULES))
csc -I . -static -uses utils $< -o $@ -strip
csc -O4 -static -c -unit $* -emit-import-library $* $<
$(DIR_BUILD):
mkdir -p $@/
@ -25,6 +22,9 @@ compile: $(DIR_BUILD)/$(BIN)
@ls -sh $(DIR_BUILD)/$(BIN)
@echo "Finished compiling a static binary in $(DIR_BUILD)/$(BIN)!"
foo: utils.import.scm utils.o
repo2html: utils.import.scm utils.o
dependencies:
chicken-install $(DEPS)

View File

@ -1,5 +0,0 @@
#!/usr/bin/csi -s
(import (utils))
(print (substring* "foo" 1 2))

View File

@ -5,24 +5,10 @@
(import
scheme
(chicken base)
(chicken file)
(chicken format)
(chicken io)
(chicken pathname)
(chicken port)
(chicken process)
(chicken process-context)
(chicken string)
(clojurian syntax)
ersatz
lowdown
scss
srfi-1 ;; list utils
srfi-13 ;; string utils
srfi-14 ;; charsets
sxml-transforms
symbol-utils ;; (unspecified-value)
utf8)
)
;; (bail [message [exit-status]])
;; end the program immediately.
;; if a message is provided, print it to the screen.