source: trunk/Samples/Makefile @ 123

Last change on this file since 123 was 123, checked in by forrest, 16 years ago

more samples

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