maybe let's not have the complexity of a DIR_BUILD

This commit is contained in:
pho4cexa 2023-02-23 23:37:07 -08:00
parent f68eaea795
commit f05e393aa3

View file

@ -2,25 +2,24 @@ DEPS = utf8 lowdown sxml-transforms clojurian symbol-utils scss srfi-1 srfi-13 s
SRC = main.scm SRC = main.scm
LOCAL_MODULES = utils utils-git LOCAL_MODULES = utils utils-git
DIR_INSTALL ?= /usr/local/bin DIR_INSTALL ?= /usr/local/bin
DIR_BUILD = .
BIN = repo2html BIN = repo2html
default: compile default: compile
%: %.scm %: %.scm
csc -O5 -static $< csc -O3 -static -strip $<
# Note: things break if you use -O5 here. # Note: things break if you use -O5 here.
%.import.scm: %.scm %.import.scm: %.scm
csc -O4 -static -c -unit $* -emit-import-library $* $< csc -O3 -static -c -unit $* -emit-import-library $* $<
$(DIR_BUILD): $(DIR_INSTALL)/%: %
mkdir -p $@/ install -Dm755 $< -D $@
compile: $(DIR_BUILD)/$(BIN) compile: $(BIN)
rm -f ./$(DIR_BUILD)/$(BIN).link rm -f $<.link
@ls -sh $(DIR_BUILD)/$(BIN) @ls -sh $<
@echo "Finished compiling a static binary in $(DIR_BUILD)/$(BIN)!" @echo "Finished compiling static binary $<!"
foo: utils.import.scm utils.o foo: utils.import.scm utils.o
repo2html: utils.import.scm utils.o utils-git.import.scm utils-git.o repo2html: utils.import.scm utils.o utils-git.import.scm utils-git.o
@ -28,14 +27,13 @@ repo2html: utils.import.scm utils.o utils-git.import.scm utils-git.o
dependencies: dependencies:
chicken-install $(DEPS) chicken-install $(DEPS)
install: install: $(DIR_INSTALL)/$(BIN)
install -Dm755 $(DIR_BUILD)/$(BIN) -D $(DIR_INSTALL)/$(PROG)
uninstall: uninstall:
rm $(DIR_INSTALL)/$(PROG) rm -f $(DIR_INSTALL)/$(BIN)
clean: clean:
rm -f $(DIR_BUILD)/$(BIN) foo repo2html *.link *.o *.import.scm rm -f $(BIN) foo repo2html *.link *.o *.import.scm
compile-on-debian-11: compile-on-debian-11:
# builds repo2html compatible with systems running glibc-2.31 and higher. # builds repo2html compatible with systems running glibc-2.31 and higher.