-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
71 lines (50 loc) · 1.66 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Easily adaptable makefile for Advanced Programming
# Note: remove comments (#) to activate some features
#
# author Vitor Carreira
# date 2010-09-26
# Libraries to include (if any)
LIBS=-pthread
# Compiler flags
CFLAGS=-Wall -W -Wmissing-prototypes -Wno-unused-but-set-variable -lm
# Indentation flags
IFLAGS=-br -brs -npsl -ce -cli4
# Name of the executable
PROGRAM=palz
# Prefix for the gengetopt file (if gengetopt is used)
PROGRAM_OPT=cmdline
# Object files required to build the executable
PROGRAM_OBJS=main.o debug.o memory.o cmdline.o decompress.o compress.o common.o listas.o hashtables.o # ${PROGRAM_OPT}.o
# Clean and all are not files
.PHONY: clean all docs indent debugon
all: ${PROGRAM}
# compilar com depuracao
debugon: CFLAGS += -D SHOW_DEBUG -g
debugon: ${PROGRAM}
${PROGRAM}: ${PROGRAM_OBJS}
${CC} -o $@ ${PROGRAM_OBJS} ${LIBS}
# Dependencies
main.o: main.c decompress.h debug.h memory.h cmdline.h #${PROGRAM_OPT}.h
decompress.o: decompress.c decompress.h
common.o: common.c common.h
compress.o: compress.c compress.h
${PROGRAM_OPT}.o: ${PROGRAM_OPT}.c ${PROGRAM_OPT}.h
cmdline.o: cmdline.c cmdline.h
debug.o: debug.c debug.h
memory.o: memory.c memory.h
listas.o: listas.c listas.h
hashtables.o: hashtables.c hashtables.h listas.h
#how to create an object file (.o) from C file (.c)
.c.o:
${CC} ${CFLAGS} -c $<
# Generates command line arguments code from gengetopt configuration file
${PROGRAM_OPT}.h: ${PROGRAM_OPT}.ggo
gengetopt < ${PROGRAM_OPT}.ggo --file-name=${PROGRAM_OPT}
clean:
rm -f *.o core.* *~ ${PROGRAM} *.bak ${PROGRAM_OPT}.h ${PROGRAM_OPT}.c
docs: Doxyfile
doxygen Doxyfile
Doxyfile:
doxygen -g Doxyfile
indent:
indent ${IFLAGS} *.c *.h