Revision 1503 trunk/src/GNUmakefile

GNUmakefile (revision 1503)
20 20
  DIST=..\build\dist
21 21
  LIBSDIR=$(DIST)\lib
22 22
  LIBSDIR:=$(addsuffix \,$(LIBSDIR))
23
  OBJSDIR=..\build\objects\dist
23
  OBJSDIR=..\build\objects\dist$(SHARED)
24 24
  OBJSDIR:=$(addsuffix \,$(OBJSDIR))
25 25
else
26 26
  INSTALL_DIR=/usr/local/
27 27
  DIST=../build/dist
28 28
  LIBSDIR=$(DIST)/lib/
29
  OBJSDIR=../build/objects/dist/
29
  OBJSDIR=../build/objects/dist$(SHARED)/
30 30
endif
31 31

  
32 32
ifdef CXX
......
41 41
  USER_LDFLAGS:= $(LDFLAGS)
42 42
endif
43 43

  
44
ifdef SHARED
45
  ADCXXFLAGS:= -fPIC $(ADCXXFLAGS)
46
endif
47

  
44 48
ifdef DEBUG
45 49
  ADCXXFLAGS:= -g $(ADCXXFLAGS)
46 50
else
......
99 103
	@echo ADMB build completed.
100 104
	@echo Check README.txt for usage and installation information.
101 105

  
102
shared: all
106
shared: $(OBJECTS)
103 107
ifeq ($(SHELL),cmd)
108
	$(CXX) -static -shared $(LDFLAGS) -o..\build\dist\lib\admb.dll -Wl,--whole-archive ..\build\dist\lib\libadmb-shared.a -Wl,--no-whole-archive
109
	$(CXX) -static -shared $(LDFLAGS) -o..\build\dist\lib\admbo.dll -Wl,--whole-archive ..\build\dist\lib\libadmbo-shared.a -Wl,--no-whole-archive
110
else
111
  ifeq (LLVM,$(findstring LLVM,$(shell $(CXX) --version)))
112
	$(CXX) -shared -o../build/dist/lib/libadmb.so -Wl,-all_load ../build/dist/lib/libadmb-shared.a
113
	$(CXX) -shared -o../build/dist/lib/libadmbo.so -Wl,-all_load ../build/dist/lib/libadmbo-shared.a
114
  else
115
	$(CXX) -shared -o../build/dist/lib/libadmb.so -Wl,--whole-archive ../build/dist/lib/libadmb-shared.a -Wl,--no-whole-archive
116
	$(CXX) -shared -o../build/dist/lib/libadmbo.so -Wl,--whole-archive ../build/dist/lib/libadmbo-shared.a -Wl,--no-whole-archive
117
  endif
118
endif
119
	@echo ADMB shared build completed.
120
	@echo Check README.txt for usage and installation information.
121

  
122
shared: | dirs
123

  
124
shared2:
125
ifeq ($(SHELL),cmd)
104 126
	$(CXX) -static -shared $(LDFLAGS) -o..\build\dist\lib\admb.dll -Wl,--whole-archive ..\build\dist\lib\libadmb.a -Wl,--no-whole-archive
105 127
	$(CXX) -static -shared $(LDFLAGS) -o..\build\dist\lib\admbo.dll -Wl,--whole-archive ..\build\dist\lib\libadmbo.a -Wl,--no-whole-archive
106 128
else
......
112 134
	$(CXX) -shared -o../build/dist/lib/libadmbo.so -Wl,--whole-archive ../build/dist/lib/libadmbo.a -Wl,--no-whole-archive
113 135
  endif
114 136
endif
115
	@echo ADMB shared build completed.
116
	@echo Check README.txt for usage and installation information.
117 137

  
138

  
118 139
dist: bins
119 140
ifeq ($(SHELL),cmd)
120 141
	copy /Y ..\LICENSE.txt ${DIST}
......
188 209
libs: objects
189 210
ifeq ($(SHELL),cmd)
190 211
	if not exist ${DIST}\lib md ${DIST}\lib
191
	if exist ${DIST}\lib\libadmb.a del ${DIST}\lib\libadmb.a
192
	if exist ${DIST}\lib\libadmbo.a del ${DIST}\lib\libadmbo.a
212
	if exist ${DIST}\lib\libadmb$(SHARED).a del ${DIST}\lib\libadmb$(SHARED).a
213
	if exist ${DIST}\lib\libadmbo$(SHARED).a del ${DIST}\lib\libadmbo$(SHARED).a
193 214
else
194 215
	mkdir -p ${DIST}/lib
195
	rm -vf ${DIST}/lib/libadmb.a
196
	rm -vf ${DIST}/lib/libadmbo.a
216
	rm -vf ${DIST}/lib/libadmb$(SHARED).a
217
	rm -vf ${DIST}/lib/libadmbo$(SHARED).a
197 218
endif
198
	$(AR) -rs $(LIBSDIR)libadmb.a $(OBJSDIR)saflp-linad99-*.obj
199
	$(AR) -rs $(LIBSDIR)libadmb.a $(OBJSDIR)saflp-df1b2-separable-*.obj
200
	$(AR) -rs $(LIBSDIR)libadmb.a $(OBJSDIR)saflp-nh99-*.obj
201
	$(AR) -rs $(LIBSDIR)libadmb.a $(OBJSDIR)saflp-tools99-*.obj
202
	$(AR) -rs $(LIBSDIR)libadmb.a $(OBJSDIR)saflp-sparse-*.obj
203
	$(AR) -rs $(LIBSDIR)libadmbo.a $(OBJSDIR)optlp-linad99-*.obj
204
	$(AR) -rs $(LIBSDIR)libadmbo.a $(OBJSDIR)optlp-df1b2-separable-*.obj
205
	$(AR) -rs $(LIBSDIR)libadmbo.a $(OBJSDIR)optlp-nh99-*.obj
206
	$(AR) -rs $(LIBSDIR)libadmbo.a $(OBJSDIR)optlp-tools99-*.obj
207
	$(AR) -rs $(LIBSDIR)libadmbo.a $(OBJSDIR)optlp-sparse-*.obj
219
	$(AR) -rs $(LIBSDIR)libadmb$(SHARED).a $(OBJSDIR)saflp-linad99-*.obj
220
	$(AR) -rs $(LIBSDIR)libadmb$(SHARED).a $(OBJSDIR)saflp-df1b2-separable-*.obj
221
	$(AR) -rs $(LIBSDIR)libadmb$(SHARED).a $(OBJSDIR)saflp-nh99-*.obj
222
	$(AR) -rs $(LIBSDIR)libadmb$(SHARED).a $(OBJSDIR)saflp-tools99-*.obj
223
	$(AR) -rs $(LIBSDIR)libadmb$(SHARED).a $(OBJSDIR)saflp-sparse-*.obj
224
	$(AR) -rs $(LIBSDIR)libadmbo$(SHARED).a $(OBJSDIR)optlp-linad99-*.obj
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff