source: trunk/Samples/Makefile.ekk @ 624

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

To show use of export

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