summaryrefslogtreecommitdiff
path: root/Makefile
blob: 97623ba2d7708dd092804f767ec3401942aab0df (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
CC     = gcc
LFLAGS =
FLAGS  = -ansi -Wall -Wextra -pedantic
OUT    = btree-test
SRC   :=$(wildcard src/*.c)
OBJ   :=$(addprefix obj/,$(notdir $(SRC:.c=.o)))

.PHONY: clean

test: debug
	./$(OUT)

gdb: debug src/btree.h
	gdb -q -ex r $(OUT)

debug: DEFS += -g3 -DDEBUG
debug: obj build

build: $(OUT)

$(OUT): $(OBJ)
	$(CC) $(DEFS) $(FLAGS) $(LFLAGS) -o $(OUT) $(OBJ)

obj/%.o: src/%.c src/btree.h
	$(CC) $(DEFS) $(FLAGS) -c -o $@ $<

obj:
	mkdir -p $@

clean:
	rm -rf $(OUT) obj