source: trunk/Samples/Makefile.driver @ 91

Last change on this file since 91 was 91, checked in by forrest, 17 years ago

reasonable standard driver for clp

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
Line 
1OptLevel := -g
2
3# The location of the customized Makefiles
4CoinDir := ../../
5export MakefileDir := $(CoinDir)/Makefiles
6include ${MakefileDir}/Makefile.coin
7include ${MakefileDir}/Makefile.location
8
9IncDir :=
10IncDir += ${CoinIncDir}
11IncDir += ${ClpIncDir}
12IncDir += ${zlibIncDir}
13IncDir += ${bzlibIncDir}
14
15LibDir :=
16LibDir += ${CoinLibDir}
17LibDir += ${ClpLibDir}
18LibDir += ${zlibLibDir}
19LibDir += ${bzlibLibDir}
20
21LibName :=
22LibName += ${CoinLibName}
23LibName += ${ClpLibName}
24LibName += ${zlibLibName}
25LibName += ${bzlibLibName}
26
27Define :=
28Define += ${ClpDefine}
29Define += ${CoinDefine}
30Define += ${zlibDefine}
31Define += ${bzlibDefine}
32
33CXXFLAGS += $(OPTFLAG)
34
35###############################################################################
36
37space:= $(empty) $(empty)
38OptVersion := $(subst $(space),_,$(OptLevel))
39
40TARGETDIR := $(UNAME)$(OptVersion)
41DEPDIR := dep
42
43VPATH := . : include : Junk : ${TARGETDIR} : ${DEPDIR}
44
45#########################################################################
46
47CXXFLAGS += $(addprefix -I,${IncDir})
48CXXFLAGS += $(addprefix -D,${Define})
49
50LIBDIRS := ${LibDir}
51LIBS    := ${LibName}
52
53LDFLAGS := $(addprefix -L,$(LIBDIRS))
54LDFLAGS += $(call ifprefix,$(SHLINKPREFIX),$(LIBDIRS))
55LDFLAGS += $(patsubst lib%,-l%,$(basename $(LIBS)))
56
57ifeq ($(findstring Linux,${UNAME}),Linux)
58        CXXFLAGS +=     -DREADLINE
59        LDFLAGS += -lhistory -lreadline -ltermcap
60endif
61
62###############################################################################
63
64TESTSRC := driver.cpp
65TESTOBJ := $(addprefix $(TARGETDIR)/, $(TESTSRC:.cpp=.o))
66TESTDEP := $(addprefix $(DEPDIR)/, $(TESTSRC:.cpp=.d))
67
68###############################################################################
69# This one must be right before the rules
70
71include ${MakefileDir}/Makefile.rules
72
73###############################################################################
74
75.DELETE_ON_ERROR:
76
77.PHONY: default clean doc unitTest libdepend
78
79default: testit
80
81###############################################################################
82
83
84testit : libdepend $(TESTOBJ)
85        @rm -rf Junk
86        @echo ""
87        @echo Creating testit
88        @rm -f $@
89        $(CXX) $(CXXFLAGS) -o $@ $(TESTOBJ) $(LDFLAGS) $(SYSLD) -lm
90#       ${CP} $@ ..
91
92###############################################################################
93
94-include $(TESTDEP)
Note: See TracBrowser for help on using the repository browser.