summaryrefslogtreecommitdiff
path: root/Makefile
blob: 17f2cfd52723da0a4c1848b702bf803405c4295d (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
#!/usr/bin/make -f
SHELL=/bin/sh

CC=gcc
LIBS = -lcgreen

BUILDDIR := build
OBJS := $(addprefix $(BUILDDIR)/,priority_queue_test.o stack_test.o min_stack_test.o swap_singly_linked_list_test.o swap_doubly_linked_list_test.o main.o)

#doc : doc/
#doxygen Doxyfile

$(BUILDDIR)/%.o : src/01/%.c
	$(COMPILE.c) $(OUTPUT_OPTION) $<

test : all
	cgreen-runner -c $(BUILDDIR)/main

ci : all
	cgreen-runner -c --xml=$(BUILDDIR)/ $(BUILDDIR)/main

.PHONY: all
all: $(OBJS) $(BUILDDIR)/html
	$(CC) $(OBJS) $(LIBS) -o $(BUILDDIR)/main

$(OBJS): | $(BUILDDIR)

$(BUILDDIR):
	mkdir $(BUILDDIR)

$(BUILDDIR)/html :
	doxygen Doxyfile

.PHONY: clean
clean:
	rm -fr build