-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
91 lines (72 loc) · 3.3 KB
/
Copy pathmakefile
File metadata and controls
91 lines (72 loc) · 3.3 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
##############################################################################
################################ makefile ####################################
##############################################################################
# #
# makefile of test (for LagrangianDualSolver_Box) #
# #
# Antonio Frangioni #
# Dipartimento di Informatica #
# Universita' di Pisa #
# #
##############################################################################
# module name
NAME = LDS_Box_test
# basic directory
DIR = .
# common stuff
include ../makefile_common
# 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 >
# define input macros for SMS++ complete makefile, then include it
SMS++SDR = ../../SMS++
include $(SMS++SDR)/lib/makefile-c
# BundleSolver
BNDSLVSDR = ../../BundleSolver
include $(BNDSLVSDR)/makefile-s
# not necessary, BundleSolver does that already
# MILPSolver
#MILPSSDR = ../../MILPSolver
#include $(MILPSSDR)/makefile-c
# LagrangianDualSolver
LgDSLVSDR = ../../LagrangianDualSolver
include $(LgDSLVSDR)/makefile
# main module (linking phase) - - - - - - - - - - - - - - - - - - - - - - - -
# object files
MOBJ = $(BNDSLVOBJ) $(LgDSLVOBJ) $(SMS++OBJ) $(CMMNUOBJ)
# libraries
# note the --force_link, that is used to ensure that BoxSolver (which is
# never explicitly mentioned in test.cpp if SMSpp_ensure_load() is not
# called) is properly linked with the final executable and therefore
# appears in the Solver factory. The ugly C++ mangled name may not be
# portable: if this does not work on your system run
#
# nm libSMS++.a -j | grep BoxSolver
#
# in wherever folder libSMS++.a lives (typically SMS++/lib in the root
# umbrella folder) and use one of the many names that will come out of
# it. Be aware, though, that not all names may work and you may get a
#
# what(): BoxSolver not present in Solver factory
#
# error, so a bit of experiment may be required. If this is too complicated
# or does not work, uncomment SMSpp_ensure_load() and be sure that
# BoxSolver.h is #include-d in test.cpp
MLIB = $(BNDSLVLIB) $(LgDSLVLIB) $(SMS++LIB) \
--force-link=__ZTVN17SMSpp_di_unipi_it9BoxSolverE
$(DIR)/$(NAME): $(MOBJ) $(DIR)/test.o
$(CC) -o $(DIR)/$(NAME) $^ $(MLIB) $(SW)
# dependencies: every .o from its .cpp + every recursively included .h- - - -
# include directives
MINC = $(SMS++INC) $(BNDSLVINC) $(LgDSLVINC) $(CMMNUINC)
# includes
MH = $(SMS++H) $(BNDSLVH) $(LgDSLVH) $(CMMNUH)
# compile command
$(DIR)/test.o: $(DIR)/test.cpp $(MH)
$(CC) -c $(DIR)/test.cpp -o $@ $(MINC) $(SW)
############################ End of makefile #################################