CC ?= cc CFLAGS ?= -std=c11 -O2 -Wall -Wextra -Werror CPPFLAGS += -Isrc -DRECORDS='"$(CURDIR)/records"' TOWN = src/records.c src/fate.c src/town.c src/weather.c src/history.c src/census.c src/post.c src/greeting.c HEADERS = $(wildcard src/*.h) hello: hello.c $(TOWN) $(HEADERS) $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ hello.c $(TOWN) test: tests/test_town ./tests/test_town tests/test_town: tests/test_town.c $(TOWN) $(HEADERS) $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ tests/test_town.c $(TOWN) tools/%: tools/%.c $(TOWN) $(HEADERS) $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $< $(TOWN) # Found the town by chance, plan what the Society must do, then take the census. society: tools/society tools/census ./tools/society ./tools/census > records/census.txt census: tools/census ./tools/census > records/census.txt survey: tools/survey ./tools/survey chronicle: tools/chronicle ./tools/chronicle clean: rm -f hello tests/test_town tools/society tools/survey tools/census tools/chronicle .PHONY: test society census survey chronicle clean