source: trunk/Samples/Makefile @ 2

Last change on this file since 2 was 2, checked in by ladanyi, 16 years ago

Import of Coin Branch-and-Cut (formerly known as Sbb)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 KB
Line 
1OptLevel := -g
2
3DRIVER ?= driver
4
5# Possible choices for driver:
6#   sample3
7#   sample4
8
9# The location of the customized Makefiles
10CoinDir := ../../
11export MakefileDir := $(CoinDir)/Makefiles
12include ${MakefileDir}/Makefile.coin
13include ${MakefileDir}/Makefile.location
14
15IncDir :=
16IncDir += ${CoinIncDir}
17IncDir += ${ClpIncDir}
18IncDir += ${zlibIncDir}
19IncDir += ${bzlibIncDir}
20
21LibDir :=
22LibDir += ${CoinLibDir}
23LibDir += ${ClpLibDir}
24LibDir += ${zlibLibDir}
25LibDir += ${bzlibLibDir}
26
27LibName :=
28LibName += ${CbcLibName}
29LibName += ${CglLibName}
30LibName += ${OsiClpLibName}
31LibName += ${OsiLibName}
32LibName += ${ClpLibName}
33LibName += ${CoinLibName}
34LibName += ${zlibLibName}
35LibName += ${bzlibLibName}
36
37Define :=
38Define += ${ClpDefine}
39Define += ${CoinDefine}
40Define += ${zlibDefine}
41Define += ${bzlibDefine}
42#lapack
43IncDir +=  $(lapackIncDir)
44LibDir +=  $(lapackLibDir)
45LibName += $(lapackLibName)
46Define +=  $(lapackDefine)
47
48CXXFLAGS += $(OPTFLAG)
49CXXFLAGS += -DCOIN_USE_CLP
50###############################################################################
51
52space:= $(empty) $(empty)
53OptVersion := $(subst $(space),_,$(OptLevel))
54
55TARGETDIR := $(UNAME)$(OptVersion)
56DEPDIR := dep
57
58VPATH := . : include : Junk : ${TARGETDIR} : ${DEPDIR}
59
60#########################################################################
61
62CXXFLAGS += $(addprefix -I,${IncDir})
63CXXFLAGS += $(addprefix -D,${Define})
64
65LIBDIRS := ${LibDir}
66LIBS    := ${LibName}
67
68LDFLAGS := $(addprefix -L,$(LIBDIRS))
69LDFLAGS += $(call ifprefix,$(SHLINKPREFIX),$(LIBDIRS))
70LDFLAGS += $(patsubst lib%,-l%,$(basename $(LIBS)))
71
72ifeq ($(findstring Linux,${UNAME}),Linux)
73        CXXFLAGS +=     -DREADLINE
74        LDFLAGS += -lhistory -lreadline -ltermcap
75endif
76CXXFLAGS  += -I.
77#CXXFLAGS += -DCHECK_CUT_COUNTS
78#LDFLAGS += -lefence
79###############################################################################
80
81TESTSRC := $(DRIVER).cpp
82TESTSRC += CbcCompareUser.cpp
83TESTSRC += CbcBranchUser.cpp
84TESTSRC += CbcHeuristicUser.cpp
85TESTSRC += CbcTreeLocal.cpp
86TESTOBJ := $(addprefix $(TARGETDIR)/, $(TESTSRC:.cpp=.o))
87TESTDEP := $(addprefix $(DEPDIR)/, $(TESTSRC:.cpp=.d))
88
89###############################################################################
90# This one must be right before the rules
91
92include ${MakefileDir}/Makefile.rules
93
94###############################################################################
95
96.DELETE_ON_ERROR:
97
98.PHONY: default clean doc unitTest libdepend
99
100default: testit
101
102###############################################################################
103
104
105testit : libdepend $(TESTOBJ)
106        @rm -rf Junk
107        @echo ""
108        @echo Creating testit
109        @rm -f $@
110        $(CXX) $(CXXFLAGS) -o $@ $(TESTOBJ) $(LDFLAGS) $(SYSLD) -lm
111#       ${CP} $@ ..
112
113###############################################################################
114
115-include $(TESTDEP)
Note: See TracBrowser for help on using the repository browser.