-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
50 lines (39 loc) · 1.16 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
# ---------------------------------------------------------------------------
# Makefile
#
# SYNOPSIS:
#
# make [all] - makes everything
# make clean - removes all files generated by make
#
# Author: Florian Adamsky <[email protected]>
# ---------------------------------------------------------------------------
# Programms
RM = /bin/rm
CP = /bin/cp
STRIP = /usr/bin/strip
# Flags passed to the preprocessor
CXXFLAGS = -g -Wall -Wextra -Winit-self -ansi -pedantic -std=c++98
# Additional flags for debugging
DEBUG_FLAGS = -pg
# Additional libs
LIBS = -lpcap
# Path to the source and object files
MODULES := Flow Ip Measurement .
SRC_DIR := $(addprefix src/,$(MODULES))
SRC := $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.cpp))
OBJ := $(patsubst src/%.cpp,src/%.o,$(SRC))
## Name of the programm
NAME = spid
# Where to find user code.
USER_DIR = src
all: $(NAME)
$(NAME): $(OBJ)
$(CXX) $(CXXFLAGES) $(LIBS) -o $(NAME) $(OBJ)
$(STRIP) $(NAME)
debug : $(OBJ)
$(CXX) $(CXXFLAGES) $(DEBUG_FLAGS) $(LIBS) -o $(NAME) $(OBJ)
check-syntax:
$(CXX) $(CXXFLAGS) -fsyntax-only -o nul -S ${CHK_SOURCES}
clean:
$(RM) -rf $(NAME) $(OBJ) *.o *.a