Commit be97847d627e55d82b58f4b1145b2ac8ea68eeaa
1 parent
3b51e912
Amélioration Makefile
Showing
1 changed file
with
45 additions
and
2 deletions
Show diff stats
Makefile
1 | +BIN = bin | ||
2 | +OBJ = obj | ||
3 | +SRC = src | ||
4 | +INCLUDE = include | ||
5 | +CFLAGS = | ||
6 | +CLIBS = -lusb-1.0 | ||
7 | +GNUMAKEFLAGS = --no-print-directory | ||
1 | 8 | ||
2 | 9 | ||
3 | 10 | ||
11 | +VERBOSE_THRESHOLD?=3 | ||
4 | 12 | ||
5 | -all : src/GetUsbInfos.c | ||
6 | - gcc -Wall src/GetUsbInfos.c -lusb-1.0 | 13 | +RELEASE?=0 |
14 | +ifeq ($(RELEASE), 1) | ||
15 | + CFLAGS = -W -Wall | ||
16 | + VERBOSE_THRESHOLD = 0 | ||
17 | +else | ||
18 | + CFLAGS = -W -Wall -g -O0 | ||
19 | +endif | ||
7 | 20 | ||
8 | 21 | ||
9 | 22 | ||
23 | +all : main demostep | ||
24 | + | ||
25 | + | ||
26 | + | ||
27 | +main : | ||
28 | + echo "Here compile the main program" | ||
29 | + | ||
30 | +demostep : STEP4.1 | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | +STEP4.1 : ${SRC}/GetUsbInfos.c bin | ||
35 | + gcc -o ${BIN}/STEP4.1.out ${SRC}/GetUsbInfos.c ${CLIBS} ${CFLAGS} | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | +obj : | ||
41 | + @-mkdir ${OBJ} | ||
42 | + | ||
43 | +bin : | ||
44 | + @-mkdir ${BIN} | ||
45 | + | ||
46 | +clean : | ||
47 | + rm -rf obj/*.o | ||
48 | + | ||
49 | +mrproper: clean | ||
50 | + rm -rf bin | ||
51 | + rm -rf obj | ||
52 | + |