Subversion Repositories Tesi_Voip

Rev

Rev 7 | Rev 10 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7 monica 1
#
2
# Author: M. Curti
3
#
4
# Makefile
5
 
6
 
7
#************************************************
8
#*   PARAMETRI	                                *
9
#************************************************
10
 
11
# versione debug: yes/no 
8 monica 12
DEBUG_VERSION = yes
7 monica 13
 
14
 
15
#************************************************
16
#*   DIRECTORY/FILE                             *
17
#************************************************
18
 
19
WORK_DIR      = .
20
PROJECT_DIR   = ../$(WORK_DIR)
21
INC           = $(PROJECT_DIR)/INC
22
SRC           = $(PROJECT_DIR)/SRC
23
DEST_DIR      = $(PROJECT_DIR)/bin
24
ifeq ($(DEBUG_VERSION),yes)
25
OUT_FILE      = exe_d.bin
26
else
27
OUT_FILE      = exe.bin
28
endif
29
 
30
 
31
#************************************************
32
#*   COMANDI                                    *
33
#************************************************
34
 
35
#compilatore
36
CC	= gcc
37
#linker: inutile, uso gcc anche x linkare
38
LD	= ld
39
#copia
40
CP	= cp
41
#rimozione
42
RM  	= rm -f
43
 
44
 
45
#************************************************
46
#*   PATH DI RICERCA PER INCLUDE FILES          *
47
#************************************************
48
 
49
INCLUDES = -I$(INC) \
50
 
51
 
52
#************************************************
53
#*   OPZIONI COMPILATORE E LINKER               *
54
#************************************************
55
 
56
#### opzioni di compilazione per versione release (impianto):
57
#-c Compile or assemble the source files, but do not link. The linking stage simply is not done. 
58
#   The ultimate output is in the form of an object file for each source file.
59
#-Wall generate warnings for everything0
60
#-DLINUX so Linux
61
# -m32/m64 indica per qual architettura compilare (32 o 64 bit per sizeof int)
62
 
63
CFLAGS = -c $(INCLUDES) -DLINUX -Wall 
64
 
65
#### opzioni di compilazione aggiuntive per versione debug o simulato:
66
#-g Produce debugging information
67
#-ggdb Produce debugging information for use by GDB
68
#-DDEBUG trace info di debug
69
 
70
#per debug:
71
ifeq ($(DEBUG_VERSION),yes)
72
CFLAGS += -g -ggdb -DDEBUG
73
endif
74
 
75
#### opzioni generali di linker:
76
# -lpcap link alla libreria pcap
77
 
78
LDFLAGS = -lpcap
79
 
80
#************************************************
81
#*   ENTRY POINT DEL MAKEFILE                   *
82
#************************************************
83
 
84
all: exe
85
 
86
#************************************************
87
#*   TARGET DEL MAKEFILE                        *
88
#************************************************
89
 
90
clean:
91
	$(RM) $(DEST_DIR)/$(OUT_FILE)
92
 
93
obj:
94
	 @echo +----------------------------------------------------------------------------------------------------------------------+
95
	 @echo +----------------------------------------------------------------------------------------------------------------------+
96
	$(CC) $(CFLAGS) $(SRC)/*.c
97
	 @echo +---------------------+
98
	 @echo +  All obj created
99
	 @echo +---------------------+
100
 
101
exe: obj
102
	 $(CC) *.o $(LDFLAGS) -o $(OUT_FILE)
103
	 @echo +---------------------+
104
	 @echo +  Link OK, exe OK
105
	 @echo +---------------------+
106
#	 $(CP) $(OUT_FILE) $(DEST_DIR)
107
	 $(RM) *.o
108
#	 $(RM) $(OUT_FILE)
109