source: trunk/Samples/Makefile @ 90

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

gmpl

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 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 += ${OsiLibName}
34LibName += ${ClpLibName}
35LibName += ${CoinLibName}
36LibName += ${zlibLibName}
37LibName += ${bzlibLibName}
38LibName += $(GlpkLibName)
39
40Define :=
41Define += ${ClpDefine}
42Define += ${CoinDefine}
43Define += ${zlibDefine}
44Define += ${bzlibDefine}
45#lapack
46IncDir +=  $(lapackIncDir)
47LibDir +=  $(lapackLibDir)
48LibName += $(lapackLibName)
49Define +=  $(lapackDefine)
50
51CXXFLAGS += $(OPTFLAG)
52CXXFLAGS += -DCOIN_USE_CLP
53###############################################################################
54
55space:= $(empty) $(empty)
56OptVersion := $(subst $(space),_,$(OptLevel))
57
58TARGETDIR := $(UNAME)$(OptVersion)
59DEPDIR := dep
60
61VPATH := . : include : Junk : ${TARGETDIR} : ${DEPDIR}
62
63#########################################################################
64
65CXXFLAGS += $(addprefix -I,${IncDir})
66CXXFLAGS += $(addprefix -D,${Define})
67
68LIBDIRS := ${LibDir}
69LIBS    := ${LibName}
70
71LDFLAGS := $(addprefix -L,$(LIBDIRS))
72LDFLAGS += $(call ifprefix,$(SHLINKPREFIX),$(LIBDIRS))
73LDFLAGS += $(patsubst lib%,-l%,$(basename $(LIBS)))
74
75ifeq ($(findstring Linux,${UNAME}),Linux)
76        CXXFLAGS +=     -DREADLINE
77#       LDFLAGS += -lhistory -lreadline -ltermcap
78endif
79CXXFLAGS  += -I.
80#CXXFLAGS += -DCHECK_CUT_COUNTS
81#LDFLAGS += -lefence
82###############################################################################
83
84TESTSRC := $(DRIVER).cpp
85TESTSRC += CbcCompareUser.cpp
86TESTSRC += CbcSolver2.cpp
87TESTSRC += CbcBranchUser.cpp
88TESTSRC += CbcHeuristicUser.cpp
89TESTSRC += CbcHeuristicGreedy.cpp
90TESTOBJ := $(addprefix $(TARGETDIR)/, $(TESTSRC:.cpp=.o))
91TESTDEP := $(addprefix $(DEPDIR)/, $(TESTSRC:.cpp=.d))
92
93###############################################################################
94# This one must be right before the rules
95
96include ${MakefileDir}/Makefile.rules
97
98###############################################################################
99
100.DELETE_ON_ERROR:
101
102.PHONY: default clean doc unitTest libdepend
103
104default: testit
105
106###############################################################################
107
108
109testit : libdepend $(TESTOBJ)
110        @rm -rf Junk
111        @echo ""
112        @echo Creating testit
113        @rm -f $@
114        $(CXX) $(CXXFLAGS) -o $@ $(TESTOBJ) $(LDFLAGS) $(SYSLD) -lm
115#       ${CP} $@ ..
116
117###############################################################################
118
119-include $(TESTDEP)
Note: See TracBrowser for help on using the repository browser.