Makefile 715 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Pre-Scheme Makefile
  2. CC=gcc
  3. FORMAT=clang-format -i
  4. PRESCHEME=prescheme
  5. CFLAGS=-g -Wall
  6. CFLAGS+=$(shell pkg-config --cflags prescheme)
  7. LDLIBS+=$(shell pkg-config --libs prescheme)
  8. SOURCES= packages.scm \
  9. lib/ps-string.scm \
  10. lib/ps-vector.scm
  11. TARGETS= hello \
  12. append \
  13. vecfun \
  14. recfun \
  15. btree
  16. all: $(TARGETS)
  17. %.c: %.scm $(SOURCES)
  18. rm -f $@
  19. ( echo ",batch"; \
  20. echo "(prescheme-compiler '$* '(\"packages.scm\") 'ps-init \"$@\""; \
  21. echo " '(header \"#include \\\"ps-init.h\\\"\"))"; \
  22. echo ",exit" ) \
  23. | $(PRESCHEME)
  24. $(FORMAT) $@
  25. clean:
  26. rm -f $(TARGETS)
  27. rm -f $(TARGETS:=.o)
  28. rm -f $(TARGETS:=.c)
  29. .PRECIOUS: $(TARGETS:=.c)
  30. .PHONY: all clean