Revision 1378 trunk/src/GNUmakefile

GNUmakefile (revision 1378)
31 31
  OBJSDIR=../build/objects/dist/
32 32
endif
33 33

  
34
ifdef CXX
35
  USER_CXX:= $(CXX)
36
endif
34 37
ifdef CXXFLAGS
38
  USER_CXXFLAGS:= $(CXXFLAGS)
35 39
  CXXFLAGS:= $(CXXFLAGS)
36 40
endif
41
ifdef LDFLAGS
42
  USER_LDFLAGS:= $(LDFLAGS)
43
endif
37 44

  
38 45
ifdef DEBUG
39 46
  CXXFLAGS:= -g$(CXXFLAGS)
40 47
else
41 48
  ifeq ($(CXX),openCC)
42
    CXXFLAGS_PRE:= -O2$(CXXFLAGS)
49
    CXXFLAGS:= -O2$(CXXFLAGS)
43 50
  else
44
    CXXFLAGS_PRE:= -O3$(CXXFLAGS)
51
    CXXFLAGS:= -O3$(CXXFLAGS)
45 52
  endif
46 53
endif
47 54

  
......
53 60
CXXFLAGS:= -Wall $(CXXFLAGS)
54 61
endif
55 62

  
56
CXXFLAGS_DEFINES:=-D__GNUDOS__ -Dlinux -D__SPDLL__ -DUSE_LAPLACE
63
CXXFLAGS:= $(CXXFLAGS) -DSAFE_ALL -D__GNUDOS__ -Dlinux -D__SPDLL__ -DUSE_LAPLACE
57 64

  
58 65
ifeq ($(SHELL),sh.exe)
59
CXXFLAGS_INCLUDES:=-I..\build\dist\include
66
CXXFLAGS:= $(CXXFLAGS) -I..\build\dist\include
60 67
else
61
CXXFLAGS_INCLUDES:=-I../build/dist/include
68
CXXFLAGS:= $(CXXFLAGS) -I../build/dist/include
62 69
endif
63 70

  
64
CXXFLAGS_OPT:=$(CXXFLAGS) -DOPT_LIB $(CXXFLAGS_DEFINES) $(CXXFLAGS_INCLUDES)
65
CXXFLAGS_SAFE:=$(CXXFLAGS) -DSAFE_ALL $(CXXFLAGS_DEFINES) $(CXXFLAGS_INCLUDES)
71
CXXFLAGS_OPT_LIB:=$(subst -DSAFE_ALL,-DOPT_LIB,$(CXXFLAGS))
66 72

  
67 73
include df1b2-separable/objects.lst
68 74
OBJECTS=$(addprefix optlp-df1b2-separable-,$(OBJ0)) $(addprefix saflp-df1b2-separable-,$(OBJ0))
......
111 117
	if not exist ${DIST}\contrib\lib md ${DIST}\contrib\lib
112 118
	if not exist ${DIST}\contrib\bin md ${DIST}\contrib\bin
113 119
	if not exist ${DIST}\contrib\include md ${DIST}\contrib\include
114
	$(MAKE) CXXFLAGS_OPT_CONTRIB="$(subst -I,-I..\,$(CXXFLAGS_OPT))" CXXFLAGS_SAFE_CONTRIB="$(subst -I,-I..\,$(CXXFLAGS_SAFE))" ADMB_HOME="$(PWD)\${DIST}" --directory=..\contrib
120
	$(MAKE) CXXFLAGS_OPT_CONTRIB="$(subst -I,-I..\,$(CXXFLAGS_OPT_LIB))" CXXFLAGS_SAFE_CONTRIB="$(subst -I,-I..\,$(CXXFLAGS))" ADMB_HOME="$(PWD)\${DIST}" --directory=..\contrib
115 121
else
116 122
	mkdir -p ${DIST}/contrib/lib
117 123
	mkdir -p ${DIST}/contrib/bin
118 124
	mkdir -p ${DIST}/contrib/include
119
	$(MAKE) CXXFLAGS_OPT_CONTRIB="$(subst -I,-I../,$(CXXFLAGS_OPT))" CXXFLAGS_SAFE_CONTRIB="$(subst -I,-I../,$(CXXFLAGS_SAFE))" ADMB_HOME="$(PWD)/${DIST}" --directory=../contrib
125
	$(MAKE) CXXFLAGS_OPT_CONTRIB="$(subst -I,-I../,$(CXXFLAGS_OPT_LIB))" CXXFLAGS_SAFE_CONTRIB="$(subst -I,-I../,$(CXXFLAGS))" ADMB_HOME="$(PWD)/${DIST}" --directory=../contrib
120 126
endif
121 127

  
122 128
dist: libs bins docs
......
147 153
	if not exist ${DIST}\bin md ${DIST}\bin
148 154
	copy df1b2-separable\seddf1b* ${DIST}\bin
149 155
	copy df1b2-separable\sedf1b2* ${DIST}\bin
150
	echo set ADMB_CFG_CXX=$(CXX)>${DIST}\bin\admb-cfg.bat
151
	echo set ADMB_CFG_CXXFLAGS=$(CXXFLAGS)>>${DIST}\bin\admb-cfg.bat
152
	echo set ADMB_CFG_LDFLAGS=$(LDFLAGS)>>${DIST}\bin\admb-cfg.bat
156
	echo set ADMB_CFG_CXX=$(USER_CXX)>${DIST}\bin\admb-cfg.bat
157
	echo set ADMB_CFG_CXXFLAGS=$(USER_CXXFLAGS)>>${DIST}\bin\admb-cfg.bat
158
	echo set ADMB_CFG_LDFLAGS=$(USER_LDFLAGS)>>${DIST}\bin\admb-cfg.bat
153 159
	echo set MINGW_HOME=$(MINGW_HOME)>>${DIST}\bin\admb-cfg.bat
154 160
	$(MAKE) --directory=df1b2-separable CC=$(CC) DISKDIR=..\${DIST} bins
155 161
	$(MAKE) --directory=nh99 CC=$(CC) DISKDIR=..\${DIST} bins
......
173 179
  else
174 180
	cp ../scripts/admb/adlink ${DIST}/bin
175 181
  endif
176
	echo "ADMB_CFG_CXX=\"$(CXX)\"">${DIST}/bin/admb-cfg.sh
177
	echo "ADMB_CFG_CXXFLAGS=\"$(CXXFLAGS)\"">>${DIST}/bin/admb-cfg.sh
182
	echo "ADMB_CFG_CXX=\"$(USER_CXX)\"">${DIST}/bin/admb-cfg.sh
183
	echo "ADMB_CFG_CXXFLAGS=\"$(USER_CXXFLAGS)\"">>${DIST}/bin/admb-cfg.sh
178 184
  ifeq ($(OS),Windows_NT)
179
	echo "ADMB_CFG_LDFLAGS=\"-static $(LDFLAGS)\"">>${DIST}/bin/admb-cfg.sh
185
	echo "ADMB_CFG_LDFLAGS=\"-static $(USER_LDFLAGS)\"">>${DIST}/bin/admb-cfg.sh
180 186
  else
181
	echo "ADMB_CFG_LDFLAGS=\"$(LDFLAGS)\"">>${DIST}/bin/admb-cfg.sh
187
	echo "ADMB_CFG_LDFLAGS=\"$(USER_LDFLAGS)\"">>${DIST}/bin/admb-cfg.sh
182 188
  endif
183 189
	$(MAKE) --directory=df1b2-separable CC=$(CC) DISKDIR=../${DIST} bins
184 190
	$(MAKE) --directory=nh99 CC=$(CC) DISKDIR=../${DIST} bins
......
299 305

  
300 306
ifeq ($(SHELL),sh.exe)
301 307
$(OBJSDIR)optlp-nh99-banner.obj: nh99\banner.cpp
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff