-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
110 lines (78 loc) · 3.96 KB
/
Copy pathmakefile
File metadata and controls
110 lines (78 loc) · 3.96 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
102
103
104
105
106
107
108
109
110
##############################################################################
################################ makefile ####################################
##############################################################################
# #
# makefile of test (for ScenarioReduction features) #
# #
# Benoît Tran #
# Dipartimento di Informatica #
# Universita' di Pisa #
# #
##############################################################################
# module name - updated to match the new test
NAME = SR_test
# basic directory
DIR = .
# common flags
COMMON_SW = -std=c++20 -ferror-limit=1 -Wno-enum-compare
# debug switches
SW_DEBUG = -g3 -glldb -fno-inline $(COMMON_SW) -DCLANG_1200_0_32_27_PATCH
# 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 -Wno-enum-compare -Wno-deprecated-copy-with-user-provided-copy
# 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)/*~ $(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 >
# StochasticBlock
StcBlkSDR = ../../StochasticBlock
include $(StcBlkSDR)/makefile-c
# CapacitatedFacilityLocationBlock
# not necessary, StochasticBlock does that already
#CFLBkSDR = ../../CapacitatedFacilityLocationBlock
#include $(CFLBkSDR)/makefile-c
# MILPSolver
MILPSSDR = ../../MILPSolver
include $(MILPSSDR)/makefile-s
# main module (linking phase) - - - - - - - - - - - - - - - - - - - - - - - -
# Only include the actual object files, not the library
MOBJ = $(StcBlkOBJ) #$(CFLBkOBJ)
# libraries - includes all necessary libraries, SMS++OBJ is the library itself
MLIB = $(MILPSLIB) $(StcBlkLIB) #$(SMS++LIB) $(CFLBkLIB)
# Final compilation target - put objects first, then library
$(DIR)/$(NAME): $(DIR)/SR_test.o $(MOBJ)
$(CC) -o $(DIR)/$(NAME) $(DIR)/SR_test.o $(MOBJ) $(MLIB) $(SW)
# dependencies: every .o from its .cpp + every recursively included .h- - - -
# include directives - add MILPS_INC as an extra safety measure
MINC = $(StcBlkINC) $(MILPSINC) -I../include # $(CFLBkINC)
# includes
MH = $(StcBlkH) $(MILPSH) # $(CFLBkH)
# compile command for the SR_test.o
$(DIR)/SR_test.o: $(DIR)/test_SRsolver.cpp $(MH)
$(CC) -c $(DIR)/test_SRsolver.cpp -o $@ $(MINC) $(SW)
# distclean target- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
distclean: clean
# phony targets - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
.PHONY: debug debug_asan release clean distclean
############################ End of makefile #################################