-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
102 lines (76 loc) · 2.72 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
#-----------------------------------------------------------------------------
# paths
#-----------------------------------------------------------------------------
SCIPDIR = scipoptsuite-4.0.0/scip-4.0.0
#-----------------------------------------------------------------------------
# include default project Makefile from SCIP
#-----------------------------------------------------------------------------
include $(SCIPDIR)/make/make.project
#-----------------------------------------------------------------------------
# Main Program
#-----------------------------------------------------------------------------
MAINNAME = fopra
MAINOBJ = main.o \
connectivity_cons.o \
pricer.o \
image.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))
LDFLAGS += -lpng -lgmp -lvl `pkg-config --libs opencv`
#-----------------------------------------------------------------------------
# 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) -I$(SCIPDIR) lint/main-gcc.lnt +os\(lint.out\) -u -zero \
$(FLAGS) -UNDEBUG -UWITH_READLINE -UROUNDING_FE -D_BSD_SOURCE $$i; \
done'
.PHONY: scip
scip:
@$(MAKE) -C $(SCIPDIR) libs $^
$(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)
.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) $(LINKCXXSCIPALL) $(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)$@
.PHONY: doc
doc:
cd doc; doxygen
#---- EOF --------------------------------------------------------------------