1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- # 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 " '(copy (ps-vector vector-unfold1))"; \
- echo " '(copy (ps-vector vector-unfold2))"; \
- echo " '(copy (ps-vector vector-unfold3))"; \
- echo " '(copy (ps-vector vector-fold1))"; \
- echo " '(copy (ps-vector vector-fold2))"; \
- echo " '(copy (ps-vector vector-fold3))"; \
- echo " '(copy (ps-vector vector-map1!))"; \
- echo " '(copy (ps-vector vector-map2!))"; \
- echo " '(copy (ps-vector vector-map3!))"; \
- echo " '(copy (ps-vector vector-map1))"; \
- echo " '(copy (ps-vector vector-map2))"; \
- echo " '(copy (ps-vector vector-map3))"; \
- echo " '(copy (ps-vector vector-for-each1))"; \
- echo " '(copy (ps-vector vector-for-each2))"; \
- echo " '(copy (ps-vector vector-for-each3))"; \
- echo ")"; \
- echo ",exit" ) \
- | $(PRESCHEME)
- $(FORMAT) $@
- clean:
- rm -f $(TARGETS)
- rm -f $(TARGETS:=.o)
- rm -f $(TARGETS:=.c)
- .PRECIOUS: $(TARGETS:=.c)
- .PHONY: all clean
|