-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (38 loc) · 981 Bytes
/
Makefile
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
41
42
43
44
45
46
47
48
49
50
51
52
TARGET = ezmem.h
SHELL = /bin/bash
Q := @ # Silence commands, unsilence with Q=
SRCS = \
init.h \
utils_io.h \
utils_file.h \
utils_nbr.h \
id_management.h \
create_mem_report.h \
output_data.h \
destructor.h \
constructor.h \
wrap_allo_free.h \
SRC = $(addprefix srcs/,$(SRCS))
VPATH := srcs/
all : rm header $(TARGET) footer
$(Q)printf "\e[32;1m+++ CONCAT [$(SRC)] +++\e[0m\n"
.PHONY : rm header $(TARGET) footer
.FORCE : ;
rm : .FORCE
$(Q)rm -f $(TARGET)
header :
$(Q)printf "#ifndef EZMEM\n" >> $(TARGET)
$(Q)printf " #define EZMEM\n" >> $(TARGET)
footer :
$(Q)printf "\n#endif //EZMEM\n" >> $(TARGET)
$(TARGET) :
$(Q)for file in $$(echo "$(SRC)" | xargs);\
do \
echo >> $(TARGET); \
echo //////////////////////////////////////////////////////////// $$file >> $(TARGET); \
cat $$file >> $(TARGET); \
done
test : all
gcc -g3 -Wall -Wextra -Werror not_leaking.c && ./a.out
test_lk : all
gcc -g3 -Wall -Wextra -Werror leaking.c && ./a.out