blob: e87119a44653d654dd71b19e88d67fb6db4415ec (
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
27
28
29
30
31
32
33
34
35
36
37
|
#!/usr/bin/make -f
SHELL=/bin/sh
CC=clang
TEST_LIBS = -lcgreen
BUILDDIR := build
OBJS := $(addprefix $(BUILDDIR)/,avl_tree.o)
TEST_OBJS := $(addprefix $(BUILDDIR)/,avl_tree_test.o)
$(BUILDDIR)/%.o : %.c
$(COMPILE.c) $(OUTPUT_OPTION) $<
.PHONY: all
all: $(OBJS) $(BUILDDIR)/main.o
$(CC) $(OBJS) $(BUILDDIR)/main.o -o $(BUILDDIR)/program
.PHONY: test
test: $(OBJS) $(TEST_OBJS)
$(CC) $(OBJS) $(TEST_OBJS) $(TEST_LIBS) -o $(BUILDDIR)/test
$(OBJS): | $(BUILDDIR)
$(TEST_OBJS): | $(BUILDDIR)
$(BUILDDIR):
mkdir $(BUILDDIR)
.PHONY: clean
clean:
rm -fr build
run : all
./build/program
run_test : test
cgreen-runner -c -v $(BUILDDIR)/test
|