source: trunk/Samples/Makefile @ 86

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

inline with doc

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