Rev 59 | Blame | Compare with Previous | Last modification | View Log | RSS feed
#
# Author: M. Curti
#
# Makefile
#************************************************
#* PARAMETRI *
#************************************************
# versione debug: yes/no
DEBUG_VERSION = no
#************************************************
#* DIRECTORY/FILE *
#************************************************
WORK_DIR = .
PROJECT_DIR = ../$(WORK_DIR)
INC = $(PROJECT_DIR)/INC
SRC = $(PROJECT_DIR)/SRC
DEST_DIR = $(PROJECT_DIR)/bin
# se e' previsto il debug verrĂ creato il file nomefile_d.bin:
ifeq ($(DEBUG_VERSION),yes)
OUT_IDENTIFY_FILE = identify_d.bin
OUT_MASKING_FILE = masking_d.bin
else
OUT_IDENTIFY_FILE = identify.bin
OUT_MASKING_FILE = masking.bin
endif
#************************************************
#* COMANDI *
#************************************************
#compilatore
CC = gcc
#linker: inutile, uso gcc anche x linkare
LD = ld
#copia
CP = cp
#rimozione
RM = rm -f
#************************************************
#* PATH DI RICERCA PER INCLUDE FILES *
#************************************************
INCLUDES = -I$(INC) \
#************************************************
#* OPZIONI COMPILATORE E LINKER *
#************************************************
#### opzioni di compilazione per versione release (impianto):
#-c Compile or assemble the source files, but do not link. The linking stage simply is not done.
# The ultimate output is in the form of an object file for each source file.
#-Wall generate warnings for everything0
#-DLINUX so Linux
# -m32/m64 indica per qual architettura compilare (32 o 64 bit per sizeof int)
CFLAGS = -c $(INCLUDES) -DLINUX -Wall
#### opzioni di compilazione aggiuntive per versione debug o simulato:
#-g Produce debugging information
#-ggdb Produce debugging information for use by GDB
#-DDEBUG trace info di debug
#per debug:
ifeq ($(DEBUG_VERSION),yes)
CFLAGS += -g -ggdb -DDEBUG
endif
#### opzioni generali di linker:
# -lpcap link alla libreria pcap
LDFLAGS = -lpcap -lm
#************************************************
#* ENTRY POINT DEL MAKEFILE *
#************************************************
all: exe
#************************************************
#* TARGET DEL MAKEFILE *
#************************************************
clean:
$(RM) *.o
$(RM) $(DEST_DIR)/$(OUT_MASKING_FILE)
$(RM) $(DEST_DIR)/$(OUT_IDENTIFY_FILE)
masking:
@echo +---------------------+
@echo +---------------------+
$(CC) -DMASKING $(CFLAGS) $(SRC)/*.c
@echo +---------------------+
@echo + All obj created
@echo +---------------------+
$(CC) *.o $(LDFLAGS) -o $(OUT_MASKING_FILE)
@echo +---------------------+
@echo + $(OUT_MASKING_FILE) created
@echo +---------------------+
identify:
@echo +---------------------+
@echo +---------------------+
$(CC) -DIDENTIFY $(CFLAGS) $(SRC)/*.c
@echo +---------------------+
@echo + All obj created
@echo +---------------------+
$(CC) *.o $(LDFLAGS) -o $(OUT_IDENTIFY_FILE)
@echo +---------------------+
@echo + $(OUT_IDENTIFY_FILE) created
@echo +---------------------+
exe: masking identify
@echo +---------------------+
@echo + All files created
@echo +---------------------+