source: branches/devel-1/Samples/Makefile.defaults @ 10

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

Slightly better example

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