Subversion Repositories Tesi_Voip

Rev

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