summaryrefslogtreecommitdiff
path: root/Makefile
blob: d29cdc69cd43e94071ce6c18f16dae2ca40330f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# lift life
# http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/makefile.4
CC=/usr/local/Cellar/gcc/9.1.0/bin/gcc-9
CFLAGS=-I. -I./segfault-suite -pthread -Wall
DEPS=segfault-suite/test-lib.h core.h database.h database.test.h
OBJ=segfault-suite/test-lib.o core.o database.o database.test.o
MAIN_OBJ=gitrolex.o
TEST_OBJ=core.test.o

%.o: %.c $(DEPS)
	$(CC) -c -o $@ $< $(CFLAGS)

gitrolex: $(OBJ) $(MAIN_OBJ)
	$(CC) -o $@ $^ $(CFLAGS)

test-bin: $(OBJ) $(TEST_OBJ)
	$(CC) -o $@ $^ $(CFLAGS)

.PHONY: test
test:
	make test-bin && ./test-bin

.PHONY: clean
clean:
	rm -rf *.o