-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
101 lines (70 loc) · 3.21 KB
/
Copy pathmakefile
File metadata and controls
101 lines (70 loc) · 3.21 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
##############################################################################
################################ makefile ####################################
##############################################################################
# #
# makefile of test (for MCFClassSolver) #
# #
# Antonio Frangioni #
# Dipartimento di Informatica #
# Universita' di Pisa #
# #
##############################################################################
# module name
NAME = MCFClassSolver_test
# basic directory
DIR = .
# common flags
COMMON_SW = -std=c++17 -ferror-limit=1
# debug switches
SW_DEBUG = -g -glldb -fno-inline $(COMMON_SW)
# debug switches with address sanitizer and extra pedantic warning
SW_DEBUG_ASAN = -g3 -glldb -fno-inline $(COMMON_SW) -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer -Wpedantic -Wextra -Wno-unused-parameter
# production switches
SW_RELEASE = -O3 $(COMMON_SW) -DNDEBUG -DCLANG_1200_0_32_27_PATCH
# compiler
CC = clang++
# default target- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
default: release
# debug target- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
debug: SW = $(SW_DEBUG)
debug: $(DIR)/$(NAME)
# debug_asan target - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
debug_asan: SW = $(SW_DEBUG_ASAN)
debug_asan: $(DIR)/$(NAME)
# release target- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
release: SW = $(SW_RELEASE)
release: $(DIR)/$(NAME)
# clean target- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
clean::
rm -f $(DIR)/*.o $(DIR)/*~ $(DIR)/$(NAME)
# define & include the necessary modules- - - - - - - - - - - - - - - - - - -
# if a module is not used in the current configuration, just comment out the
# corresponding include line
# each module outputs some macros to be used here:
# *OBJ is the final object(s) / library
# *LIB is the external libraries + -L< libdirs >
# *H is the list of all include files
# *INC is the -I< include directories >
# MCFClassSolver
MCFCSSDR = ..
include $(MCFCSSDR)/makefile-c
# main module (linking phase) - - - - - - - - - - - - - - - - - - - - - - - -
# object files
MOBJ = $(MCFCSOBJ)
# libraries
MLIB = $(MCFCSLIB)
$(DIR)/$(NAME): $(MOBJ) $(DIR)/test.o
$(CC) -o $(DIR)/$(NAME) $(DIR)/test.o $(MOBJ) $(MLIB) $(SW)
# dependencies: every .o from its .cpp + every recursively included .h- - - -
# include directives
MINC = $(MCFCSINC)
# includes
MH = $(MCFCSH)
# compile command
$(DIR)/test.o: $(DIR)/test.cpp $(MH)
$(CC) -c $*.cpp -o $@ $(MINC) $(SW)
# distclean target- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
distclean: clean
# phony targets - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
.PHONY: debug debug_asan release clean distclean
############################ End of makefile #################################