-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
124 lines (99 loc) · 3.56 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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# Makefile for C++ constarined clustering code using SCIP for branch-and-price
#-----------------------------------------------------------------------------
# paths
#-----------------------------------------------------------------------------
ifdef SCIP_HOME
SCIPDIR = $(SCIP_HOME)
else
$(error Environment variable SCIP_HOME is not defined.)
endif
#-----------------------------------------------------------------------------
# include default project Makefile from SCIP
#-----------------------------------------------------------------------------
include $(SCIPDIR)/make/make.project
CXXFLAGS+= -std=c++0x -O3
DFLAGS+= -std=c++0x
#-----------------------------------------------------------------------------
# Main Program
#-----------------------------------------------------------------------------
MAINNAME = cccg
MAINOBJ = main_optclust.o \
pricer_optclust.o \
reader.o \
init.o \
subsolver.o \
SiegBnB.o \
SiegBnBCons.o \
cons_mlcl.o \
branch_ryanfoster.o
MAINSRC = $(addprefix $(SRCDIR)/,$(MAINOBJ:.o=.cpp))
MAINDEP = $(SRCDIR)/depend.cppmain.$(OPT)
MAIN = $(MAINNAME).$(BASE).$(LPS)$(EXEEXTENSION)
MAINFILE = $(BINDIR)/$(MAIN)
MAINSHORTLINK = $(BINDIR)/$(MAINNAME)
MAINOBJFILES = $(addprefix $(OBJDIR)/,$(MAINOBJ))
#-----------------------------------------------------------------------------
# Rules
#-----------------------------------------------------------------------------
ifeq ($(VERBOSE),false)
.SILENT: $(MAINFILE) $(MAINOBJFILES) $(MAINSHORTLINK)
endif
.PHONY: all
all: $(SCIPDIR) $(MAINFILE) $(MAINSHORTLINK)
.PHONY: lint
lint: $(MAINSRC)
-rm -f lint.out
$(SHELL) -ec 'for i in $^; \
do \
echo $$i; \
$(LINT) $(SCIPDIR)/lint/scip.lnt +os\(lint.out\) -u -zero \
$(FLAGS) -UNDEBUG -UWITH_READLINE -UROUNDING_FE $$i; \
done'
.PHONY: scip
scip:
@$(MAKE) -C $(SCIPDIR) libs $^
.PHONY: doc
doc:
@-(cd doc && ln -fs ../$(SCIPDIR)/doc/scip.css);
@-(cd doc && ln -fs ../$(SCIPDIR)/doc/pictures/scippy.png);
@-(cd doc && ln -fs ../$(SCIPDIR)/doc/pictures/miniscippy.png);
@-(cd doc && ln -fs ../$(SCIPDIR)/doc/scipfooter.html footer.html);
cd doc; $(DOXY) $(MAINNAME).dxy
$(MAINSHORTLINK): $(MAINFILE)
@rm -f $@
cd $(dir $@) && ln -s $(notdir $(MAINFILE)) $(notdir $@)
$(OBJDIR):
@-mkdir -p $(OBJDIR)
$(BINDIR):
@-mkdir -p $(BINDIR)
.PHONY: clean
clean: $(OBJDIR)
ifneq ($(OBJDIR),)
-rm -f $(OBJDIR)/*.o
-rmdir $(OBJDIR)
endif
-rm -f $(MAINFILE)
-rm -f $(SRCDIR)/*~
.PHONY: test
test: $(MAINFILE)
@-($(MAINFILE) -d ./examples/iris.data -n ./examples/iris.constraints -k 3);
.PHONY: depend
depend: $(SCIPDIR)
$(SHELL) -ec '$(DCXX) $(FLAGS) $(DFLAGS) $(MAINSRC) \
| sed '\''s|^\([0-9A-Za-z\_]\{1,\}\)\.o *: *$(SRCDIR)/\([0-9A-Za-z\_]*\).cpp|$$\(OBJDIR\)/\2.o: $(SRCDIR)/\2.cpp|g'\'' \
>$(MAINDEP)'
-include $(MAINDEP)
$(MAINFILE): $(BINDIR) $(OBJDIR) $(SCIPLIBFILE) $(LPILIBFILE) $(NLPILIBFILE) $(MAINOBJFILES)
@echo "-> linking $@"
$(LINKCXX) $(MAINOBJFILES) \
$(LINKCXX_L)$(SCIPDIR)/lib $(LINKCXX_l)$(SCIPLIB)$(LINKLIBSUFFIX) \
$(LINKCXX_l)$(OBJSCIPLIB)$(LINKLIBSUFFIX) $(LINKCXX_l)$(LPILIB)$(LINKLIBSUFFIX) $(LINKCXX_l)$(NLPILIB)$(LINKLIBSUFFIX) \
$(OFLAGS) $(LPSLDFLAGS) $(CSPFLAGS)\
$(LDFLAGS) $(LINKCXX_o)$@
$(OBJDIR)/%.o: $(SRCDIR)/%.c
@echo "-> compiling $@"
$(CC) $(FLAGS) $(OFLAGS) $(BINOFLAGS) $(CFLAGS) -c $< $(CC_o)$@
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
@echo "-> compiling $@"
$(CXX) $(FLAGS) $(OFLAGS) $(BINOFLAGS) $(CXXFLAGS) -c $< $(CXX_o)$@
#---- EOF --------------------------------------------------------------------