Debian Codegraph @

Makefile

raw ◀ ▶
Source reconstructed at patch state 1 of 3 — not the installed (fully patched) source.
3 Debian patches touch this file
1 UNAME := $(shell uname)
2
3 ################ Modify these variables ################
4
5 ifeq ($(UNAME), Darwin)
6 # Mac OS X Defaults, assuming Readme instructions.
7
8 GMPINCLUDEDIR = /usr/local/include
9 BOOSTINCLUDEDIR = /usr/local/include/boost
10 LIBDIR = /usr/local/lib
11
12 else
13 # If you're using Linux or Windows or a nonstandard OS X setup, modify
14 # these variables to point to the appropriate places.
15
16 BASEDIR := $(HOME)
17
18 # directory containing the header files 'gmp.h' and 'gmpxx.h'
19 GMPINCLUDEDIR = $(BASEDIR)/include
20
21 # directory containing boost header files, e.g. 'bind.hpp', etc.
22 BOOSTINCLUDEDIR = $(BASEDIR)/include/boost
23
24 # directory containing library files, e.g.
25 # libboost_filesystem.a,
26 # libboost_filesystem.so,
27 # libboost_filesystem.so.1.54.0
28 # as well as analogous files for 'boost_system',
29 # 'boost_serialization', 'boost_timer', 'boost_program_options',
30 # 'gmp', and 'gmpxx',
31 LIBDIR = $(BASEDIR)/lib
32
33 endif
34
35 ################ End of modifications ################
36
37 SOURCES = $(wildcard src/*.cpp) $(wildcard src/mpack/*.cpp)
38 HEADERS = $(wildcard src/*.h) $(wildcard src/mpack/*.h)
39 OBJECTS = $(patsubst src/%.cpp,obj/%.o,$(SOURCES))
40 RESULT = sdpb
41
42 ifeq ($(SHARED_TINYXML2), 1)
43 LIBS = -ltinyxml2
44 CFLAGS += -D___SHARED_TINYXML2___
45 else
46 SOURCES += $(wildcard src/tinyxml2/*.cpp)
47 HEADERS += $(wildcard src/tinyxml2/*.h)
48 endif
49
50 ifdef INTEL
51
52 CC = icpc
53 CFLAGS += -g -O2 -ipo -xhost -Wall -ansi -std=c++0x -L${LIBDIR} -Isrc/mpack -I${GMPINCLUDEDIR} -I${BOOSTINCLUDEDIR} -openmp -D___MPACK_BUILD_WITH_GMP___
54 LIBS += -lgmpxx -lgmp -lboost_serialization -lboost_system -lboost_filesystem -lboost_timer -lboost_program_options -lboost_chrono -lrt
55
56 else
57 ifdef CLANG
58
59 CC = clang-omp
60 CFLAGS += -g -O2 -Wall -ansi -std=c++0x -L${LIBDIR} -Isrc/mpack -I${GMPINCLUDEDIR} -I${BOOSTINCLUDEDIR} -fopenmp -D___MPACK_BUILD_WITH_GMP___
61 LIBS += -liomp5 -lgmpxx -lgmp -lboost_serialization -lboost_system -lboost_filesystem -lboost_timer -lboost_program_options -lboost_chrono -lc++
62
63 else
64
65 CC = g++
66 CFLAGS += -g -O2 -Wall -ansi -std=c++0x -L${LIBDIR} -Isrc/mpack -I${GMPINCLUDEDIR} -I${BOOSTINCLUDEDIR} -fopenmp -D___MPACK_BUILD_WITH_GMP___
67 LIBS += -lgomp -lgmpxx -lgmp -lboost_serialization -lboost_system -lboost_filesystem -lboost_timer -lboost_program_options -lboost_chrono -lrt
68
69 endif
70 endif
71
72
73 .SUFFIXES: .cpp .o
74
75 $(RESULT): $(OBJECTS)
76 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
77
78 obj/%.o: src/%.cpp
79 $(CC) $(CFLAGS) -c -o $@ $<
80
81 clean:
82 rm -rf obj
83
84 obj:
85 @mkdir -p $@
86 @mkdir -p $@/mpack
87 @mkdir -p $@/tinyxml2
88
89 test:
90 ./sdpb -s test.xml --noFinalCheckpoint
91 test -f test.out
92 grep "primalObjective = 1.84026576313204924668804017173" test.out > /dev/null || \
93 (echo "Test failed: primalObjective differs from 1.84026576313204924668804017173." && exit 1)
94
95 $(OBJECTS): $(HEADERS) | obj
96
97 CFLAGS += -MMD
98 -include $(OBJECTS:.o=.d)