source: trunk/Samples/Makefile @ 574

Last change on this file since 574 was 574, checked in by forrest, 14 years ago

gmpl

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
1OptLevel := -g
2
3DRIVER ?= driver
4
5# Possible choices for driver:
6#   decompose
7#   defaults
8#   driver
9#   driver2
10#   dualCuts
11#   ekk
12#   ekk_interface
13#   minimum
14#   network
15#   piece
16#   sprint
17#   sprint2
18#   testBarrier
19#   testBasis
20#   useVolume
21
22
23# The location of the customized Makefiles
24CoinDir := ../../
25export MakefileDir := $(CoinDir)/Makefiles
26include ${MakefileDir}/Makefile.coin
27include ${MakefileDir}/Makefile.location
28
29IncDir :=
30IncDir += ${ClpIncDir}
31IncDir += ${CoinIncDir}
32IncDir += ${zlibIncDir}
33IncDir += ${bzlibIncDir}
34IncDir += ${readlineIncDir}
35IncDir += ${lapackIncDir}
36IncDir += ${taucsIncDir}
37
38LibDir :=
39LibDir += ${ClpLibDir}
40LibDir += ${CoinLibDir}
41LibDir += ${zlibLibDir}
42LibDir += ${bzlibLibDir}
43LibDir += ${readlineLibDir}
44LibDir += ${lapackLibDir}
45#LibDir += ${taucsLibDir}
46LibDir += $(GlpkLibDir)
47
48LibName :=
49LibName += ${ClpLibName}
50LibName += ${CoinLibName}
51LibName += ${zlibLibName}
52LibName += ${bzlibLibName}
53LibName += ${readlineLibName}
54LibName += ${lapackLibName}
55#LibName += ${taucsLibName}
56LibName += $(GlpkLibName)
57
58Define :=
59Define += ${ClpDefine}
60Define += ${CoinDefine}
61Define += ${zlibDefine}
62Define += ${bzlibDefine}
63Define += ${readlineDefine}
64Define += ${lapackDefine}
65Define += ${taucsDefine}
66
67CXXFLAGS += $(OPTFLAG)
68
69###############################################################################
70
71space:= $(empty) $(empty)
72OptVersion := $(subst $(space),_,$(OptLevel))
73
74TARGETDIR := $(UNAME)$(OptVersion)
75DEPDIR := dep
76
77VPATH := . : include : Junk : ${TARGETDIR} : ${DEPDIR}
78
79#########################################################################
80
81CXXFLAGS += $(addprefix -I,${IncDir})
82CXXFLAGS += $(addprefix -D,${Define})
83
84LIBDIRS := ${LibDir}
85LIBS    := ${LibName}
86
87LDFLAGS := $(addprefix -L,$(LIBDIRS))
88LDFLAGS += $(call ifprefix,$(SHLINKPREFIX),$(LIBDIRS))
89LDFLAGS += $(patsubst lib%,-l%,$(basename $(LIBS)))
90
91#LDFLAGS += -lefence
92#LDFLAGS += -Wl,-static
93#LDFLAGS += -lwsmpP4 -lpthread
94#OSL_LIB_DIR = /home/forrest/osl/lib
95#LDFLAGS += -L $(OSL_LIB_DIR) -Wl,-rpath,$(OSL_LIB_DIR) -losl-O-nolic-native-32
96#LDFLAGS += -pg
97###############################################################################
98
99ifeq ($(DRIVER),driverC)
100    SRCEXT := c
101else
102    SRCEXT := cpp
103endif
104
105TESTSRC := $(DRIVER).$(SRCEXT)
106TESTOBJ := $(addprefix $(TARGETDIR)/, $(TESTSRC:.$(SRCEXT)=.o))
107TESTDEP := $(addprefix $(DEPDIR)/, $(TESTSRC:.$(SRCEXT)=.d))
108
109###############################################################################
110# This one must be right before the rules
111
112include ${MakefileDir}/Makefile.rules
113
114###############################################################################
115
116.DELETE_ON_ERROR:
117
118.PHONY: default clean doc unitTest libdepend
119
120default: testit
121
122###############################################################################
123
124
125testit : libdepend $(TESTOBJ)
126        @rm -rf Junk
127        @echo ""
128        @echo Creating testit
129        @rm -f $@
130        $(CXX) $(CXXFLAGS) -o $@ $(TESTOBJ) $(LDFLAGS) $(SYSLD) -lm
131
132###############################################################################
133
134-include $(TESTDEP)
Note: See TracBrowser for help on using the repository browser.