repo2html/Makefile

46 lines
1.3 KiB
Makefile

DEPS = utf8 lowdown sxml-transforms clojurian symbol-utils scss srfi-1 srfi-13 srfi-14 ersatz
SRC = main.scm
LOCAL_MODULES = utils
DIR_INSTALL ?= /usr/local/bin
DIR_BUILD = .
BIN = repo2html
default: compile
foo: foo.scm utils.import.scm utils.o
csc -O5 -I . -static -uses utils $< -o $@
# 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
$(DIR_BUILD):
mkdir -p $@/
compile: $(DIR_BUILD)/$(BIN)
rm ./$(DIR_BUILD)/$(BIN).link
@ls -sh $(DIR_BUILD)/$(BIN)
@echo "Finished compiling a static binary in $(DIR_BUILD)/$(BIN)!"
dependencies:
chicken-install $(DEPS)
install:
install -Dm755 $(DIR_BUILD)/$(BIN) -D $(DIR_INSTALL)/$(PROG)
uninstall:
rm $(DIR_INSTALL)/$(PROG)
clean:
rm -f $(DIR_BUILD)/$(BIN) foo repo2html *.link *.o *.import.scm
compile-on-debian-11:
# builds repo2html compatible with systems running glibc-2.31 and higher.
docker build docker
# the docker image "repo2htmlbuilder:latest" now exists on your system.
# this will make the next time you run this command go faster.
# to delete it and reclaim the space run "docker image rm repo2htmlbuilder:latest"
docker run -v $(shell pwd):/tmp/x -w /tmp/x --rm repo2htmlbuilder make compile