Makefile (466B)
1 CC = tcc 2 SRC = main.c shader.c glm.c err.c src/glad.c 3 TSRC = glm.c glm_test.c err.c 4 HDR = main.h glm.h err.h 5 OUT = main 6 7 INCS = -I./include 8 9 CFLAGS = -Wall 10 LDFLAGS = -lglfw -lGL -lX11 -lpthread -lXrandr -lXi -ldl -lm 11 12 13 all: $(SRC) $(HDR) 14 $(CC) -o $(OUT) $(CFLAGS) $(INCS) $(LDFLAGS) $(SRC) 15 16 run: all 17 ./$(OUT) 18 19 test: $(TSRC) 20 $(CC) -o test $(CFLAGS) $(INCS) $(LDFLAGS) $(TSRC) 21 ./test 22 rm -f test 23 24 clean: 25 rm -f main 26 27 gcc: 28 make "CC=gcc" 29 30 clang: 31 make "CC=clang"