12345678910111213141516171819202122232425262728293031323334353637383940 |
- # Pre-Scheme Makefile
- CC=gcc
- FORMAT=clang-format -i
- PRESCHEME=prescheme
- CFLAGS=-g -Wall
- CFLAGS+=$(shell pkg-config --cflags prescheme)
- LDLIBS+=$(shell pkg-config --libs prescheme)
- SOURCES= packages.scm \
- lib/ps-string.scm \
- lib/ps-vector.scm
- TARGETS= hello \
- append \
- vecfun \
- recfun \
- btree
- all: $(TARGETS)
- %.c: %.scm $(SOURCES)
- rm -f $@
- ( echo ",batch"; \
- echo "(prescheme-compiler '$* '(\"packages.scm\") 'ps-init \"$@\""; \
- echo " '(header \"#include \\\"ps-init.h\\\"\"))"; \
- echo ",exit" ) \
- | $(PRESCHEME)
- $(FORMAT) $@
- clean:
- rm -f $(TARGETS)
- rm -f $(TARGETS:=.o)
- rm -f $(TARGETS:=.c)
- .PRECIOUS: $(TARGETS:=.c)
- .PHONY: all clean
|