Makefile 645 B

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