-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
40 lines (31 loc) · 746 Bytes
/
makefile
File metadata and controls
40 lines (31 loc) · 746 Bytes
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
38
39
40
DOC_DIR=doc
RELEASE=release
INC=inc
LIB_NAME=libfifo.a
ifndef debug
debug:=
endif
FLAGS = -std=gnu99 -Wall -Wextra -Wconversion -Wshadow -Wundef -fno-common -Wno-unused-parameter -Wno-type-limits -fpic
CC = cc $(if $(debug),-DDEBUG -g)
LD = cc
DEPS=tb_fifo.c tb_fifo.h tb_all.h tb_list.h tb_types.h tb_util.h
test : test.o tb_fifo.o
$(LD) -o test -g $^
test.o : test.c
$(CC) -c test.c $(FLAGS)
tb_fifo.o: $(DEPS)
$(CC) -c tb_fifo.c $(FLAGS)
lib: tb_fifo.o
ar rcs $(LIB_NAME) $^
valgrind: test
valgrind --leak-check=full --track-origins=yes ./test
release: lib
mkdir -p $(RELEASE)/$(INC)
cp $(LIB_NAME) $(RELEASE)/.
cp *.h $(RELEASE)/$(INC)
clean:
-rm -f *.o
-rm -f *.a
-rm -f vgcore.*
-rm -f test
-rm -fr $(RELEASE)