this repo has no description
at trunk 32 lines 881 B view raw
1OUT = bin 2CFLAGS = -O0 -g -Wall -Wextra -pedantic -fno-strict-aliasing -std=c99 3TARGETS = mmap-demo compiling-integers compiling-immediates compiling-unary \ 4 compiling-binary compiling-reader compiling-let compiling-if \ 5 compiling-heap compiling-procedures compiling-closures compiling-elf 6BINARIES = $(addprefix $(OUT)/, $(TARGETS)) 7TESTS = $(addprefix test-, $(TARGETS)) 8 9# $@ means the name of the target that caused the rule to run 10# $^ means all of the prerequisites with spaces in between 11# $< means the name of the first prerequisite 12 13all: $(OUT) $(BINARIES) 14 15test: $(OUT) $(TESTS) 16 17$(OUT): 18 mkdir -p $@ 19 20clean: 21 rm $(OUT)/* 22 23$(OUT)/%: %.c greatest.h 24 $(CC) $(CFLAGS) $< -o $@ 25 26test-compiling-elf: $(OUT)/compiling-elf 27 ./$< ./$(OUT)/generated-elf 28 chmod +x ./$(OUT)/generated-elf 29 @./$(OUT)/generated-elf || if [ $$? -ne 120 ]; then exit 1; fi 30 31test-%: $(OUT)/% 32 ./$<