Revision 1111 trunk/src/GNUmakefile

GNUmakefile (revision 1111)
14 14
ifeq ($(TERMINAL),dos)
15 15
  DISK=..\build\dist
16 16
  LIBPATH=..\build\objects\dist
17
  CXXFLAGS_INCLUDES:=-I..\${DISK}\include
18 17
  PWD=$(shell cd)
19 18
  PATH:=$(PATH);..\utilities\mingw\bin;..\utilities
20 19
else
21 20
  DISK=../build/dist
22 21
  LIBPATH=../build/objects/dist
23
  CXXFLAGS_INCLUDES:=-I../${DISK}/include
24 22
  PWD=$(shell pwd)
25 23
endif
26 24

  
27
CXXFLAGS:=$(CXXFLAGS) -D__GNUDOS__ -Dlinux -D__SPDLL__ -DUSE_LAPLACE
25
ifdef DEBUG
26
CXXFLAGS_PRE:=-g
27
else
28
CXXFLAGS_PRE:=-O3
29
endif
28 30

  
29 31
ifdef BUILD_SHARED_LIBRARY
30
CXXFLAGS:=-fPIC $(CXXFLAGS)
32
CXXFLAGS_PRE:=$(CXXFLAGS_PRE) -fPIC
31 33
endif
32 34

  
33 35
ifneq ($(CXX),CC)
34
CXXFLAGS:=-Wall $(CXXFLAGS)
36
CXXFLAGS_PRE:=$(CXXFLAGS_PRE) -Wall
35 37
endif
36 38

  
37
ifdef DEBUG
38
CXXFLAGS:=-g $(CXXFLAGS)
39
CXXFLAGS_DEFINES:=-D__GNUDOS__ -Dlinux -D__SPDLL__ -DUSE_LAPLACE
40

  
41
ifeq ($(TERMINAL),dos)
42
CXXFLAGS_INCLUDES:=-I..\build\dist\include
43
CXXFLAGS_INCLUDES_CONTRIB:=-I..\..\build\dist\include
39 44
else
40
CXXFLAGS:=-O3 $(CXXFLAGS)
45
CXXFLAGS_INCLUDES:=-I../build/dist/include
46
CXXFLAGS_INCLUDES_CONTRIB:=-I../../build/dist/include
41 47
endif
42 48

  
43
CXXFLAGS_CONTRIB:=$(CXXFLAGS)
44

  
45
ifeq ($(TERMINAL),dos)
46
CXXFLAGS:=$(CXXFLAGS) -I..\build\dist\include
49
ifdef CXXFLAGS
50
CXXFLAGS_OPT:=$(CXXFLAGS_PRE) $(CXXFLAGS) -DOPT_LIB $(CXXFLAGS_DEFINES) $(CXXFLAGS_INCLUDES)
51
CXXFLAGS_SAFE:=$(CXXFLAGS_PRE) $(CXXFLAGS) -DSAFE_ALL $(CXXFLAGS_DEFINES) $(CXXFLAGS_INCLUDES)
52
CXXFLAGS_OPT_CONTRIB:=$(CXXFLAGS_PRE) $(CXXFLAGS) -DOPT_LIB $(CXXFLAGS_DEFINES) $(CXXFLAGS_INCLUDES_CONTRIB)
53
CXXFLAGS_SAFE_CONTRIB:=$(CXXFLAGS_PRE) $(CXXFLAGS) -DSAFE_ALL $(CXXFLAGS_DEFINES) $(CXXFLAGS_INCLUDES_CONTRIB)
47 54
else
48
CXXFLAGS:=$(CXXFLAGS) -I../build/dist/include
55
CXXFLAGS_OPT:=$(CXXFLAGS_PRE) -DOPT_LIB $(CXXFLAGS_DEFINES) $(CXXFLAGS_INCLUDES)
56
CXXFLAGS_SAFE:=$(CXXFLAGS_PRE) -DSAFE_ALL $(CXXFLAGS_DEFINES) $(CXXFLAGS_INCLUDES)
57
CXXFLAGS_OPT_CONTRIB:=$(CXXFLAGS_PRE) -DOPT_LIB $(CXXFLAGS_DEFINES) $(CXXFLAGS_INCLUDES_CONTRIB)
58
CXXFLAGS_SAFE_CONTRIB:=$(CXXFLAGS_PRE) -DSAFE_ALL $(CXXFLAGS_DEFINES) $(CXXFLAGS_INCLUDES_CONTRIB)
49 59
endif
50 60

  
51 61
include df1b2-separable/objects.lst
......
149 159
	if not exist ${DISK}\contrib\lib md ${DISK}\contrib\lib
150 160
	if not exist ${DISK}\contrib\bin md ${DISK}\contrib\bin
151 161
	if not exist ${DISK}\contrib\include md ${DISK}\contrib\include
152
	$(MAKE) CXXFLAGS="$(CXXFLAGS_CONTRIB)" ADMB_HOME="$(PWD)\${DISK}" --directory=..\contrib
162
	$(MAKE) CXXFLAGS_OPT_CONTRIB="$(CXXFLAGS_OPT_CONTRIB)" CXXFLAGS_SAFE_CONTRIB="$(CXXFLAGS_SAFE_CONTRIB)" ADMB_HOME="$(PWD)\${DISK}" --directory=..\contrib
153 163
else
154 164
	mkdir -p ${DISK}/contrib/lib
155 165
	mkdir -p ${DISK}/contrib/bin
156 166
	mkdir -p ${DISK}/contrib/include
157
	$(MAKE) CXXFLAGS="$(CXXFLAGS_CONTRIB)" ADMB_HOME="${PWD}/${DISK}" --directory=../contrib
167
	$(MAKE) CXXFLAGS_OPT_CONTRIB="$(CXXFLAGS_OPT_CONTRIB)" CXXFLAGS_SAFE_CONTRIB="$(CXXFLAGS_SAFE_CONTRIB)" ADMB_HOME="$(PWD)/${DISK}" --directory=../contrib
158 168
endif
159 169

  
160
libs: $(OPTLP_DF1B2_SEPARABLE_OBJS) $(SAFLP_DF1B2_SEPARABLE_OBJS) $(OPTLP_LINAD99_OBJS) $(SAFLP_LINAD99_OBJS) $(OPTLP_NH99_OBJS) $(SAFLP_NH99_OBJS) $(OPTLP_TOOLS99_OBJS) $(SAFLP_TOOLS99_OBJS)
170
libs: objects
161 171
ifeq ($(TERMINAL),dos)
162 172
	if not exist ${DISK}\lib md ${DISK}\lib
163 173
	if exist ${DISK}\lib\libadmb.a del ${DISK}\lib\libadmb.a
......
188 198
	$(AR) -rs ${DISK}/lib/libadmbo.a ../build/objects/dist/optlp-sparse-*.obj
189 199
endif
190 200

  
201
objects: $(OPTLP_DF1B2_SEPARABLE_OBJS) $(SAFLP_DF1B2_SEPARABLE_OBJS) $(OPTLP_LINAD99_OBJS) $(SAFLP_LINAD99_OBJS) $(OPTLP_NH99_OBJS) $(SAFLP_NH99_OBJS) $(OPTLP_TOOLS99_OBJS) $(SAFLP_TOOLS99_OBJS)
202

  
191 203
ifeq ($(TERMINAL),dos)
192 204
..\build\objects\dist\optlp-nh99-banner.obj: nh99\banner.cpp
193
	$(CXX) -c -DOPT_LIB $(CXXFLAGS) -DADMB_VERSION=$(shell cat ../../VERSION) -DADMB_REVISION=$(shell test -e ../../REVISION && cat ../../REVISION) -o$@ $<
205
	$(CXX) -c $(CXXFLAGS_OPT) -DADMB_VERSION=$(shell cat ../../VERSION) -DADMB_REVISION=$(shell test -e ../../REVISION && cat ../../REVISION) -o$@ $<
194 206

  
195 207
..\build\objects\dist\saflp-nh99-banner.obj: nh99\banner.cpp
196
	$(CXX) -c -DSAFE_ALL $(CXXFLAGS) -DADMB_VERSION=$(shell cat ../../VERSION) -DADMB_REVISION=$(shell test -e ../../REVISION && cat ../../REVISION) -o$@ $<
208
	$(CXX) -c $(CXXFLAGS_SAFE) -DADMB_VERSION=$(shell cat ../../VERSION) -DADMB_REVISION=$(shell test -e ../../REVISION && cat ../../REVISION) -o$@ $<
197 209

  
198 210
..\build\objects\dist\optlp-sparse-hs_sparse.obj: sparse\hs_sparse.cpp
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff