Revision 1503 trunk/contrib/GNUmakefile

GNUmakefile (revision 1503)
16 16
  endif
17 17
endif
18 18
ifeq ($(SHELL),cmd)
19
  CONTRIB_OBJS_DIR=..\..\build\objects\contrib
19
  CONTRIB_OBJS_DIR=..\..\build\objects\contrib$(SHARED)
20 20
  CONTRIB_DIR=..\..\build\dist\contrib
21 21
  CONTRIB_BIN=$(addsuffix \bin,$(CONTRIB_DIR))
22 22
  CONTRIB_INCLUDE=$(addsuffix \include,$(CONTRIB_DIR))
23 23
  CONTRIB_LIB=$(addsuffix \lib,$(CONTRIB_DIR))
24 24
else
25
  CONTRIB_OBJS_DIR=../../build/objects/contrib
25
  CONTRIB_OBJS_DIR=../../build/objects/contrib$(SHARED)
26 26
  CONTRIB_DIR=../../build/dist/contrib
27 27
  CONTRIB_BIN=$(addsuffix /bin,$(CONTRIB_DIR))
28 28
  CONTRIB_INCLUDE=$(addsuffix /include,$(CONTRIB_DIR))
29 29
  CONTRIB_LIB=$(addsuffix /lib,$(CONTRIB_DIR))
30 30
endif
31 31
ifdef DEBUG
32
OPTION=-g
32
  OPTION=-g
33 33
endif
34
ifdef SHARED
35
  OPTION:=-d $(OPTION)
36
endif
34 37

  
35 38
all: 
36 39
	$(MAKE) contrib-includes
......
38 41
	$(MAKE) contrib-ad2csv
39 42
	@echo ADMB contrib build completed.
40 43

  
41
shared: all
44
shared:
42 45
ifeq ($(SHELL),cmd)
43
	$(CXX) -static -shared $(LDFLAGS) -o ..\build\dist\contrib\lib\contrib.dll -Wl,--whole-archive ..\build\dist\contrib\lib\libcontrib.a -Wl,--no-whole-archive -Wl,-Bdynamic ..\build\dist\lib\admb.dll
44
	$(CXX) -static -shared $(LDFLAGS) -o ..\build\dist\contrib\lib\contribo.dll -Wl,--whole-archive ..\build\dist\contrib\lib\libcontribo.a -Wl,--no-whole-archive -Wl,-Bdynamic ..\build\dist\lib\admbo.dll
46
	$(CXX) -static -shared $(LDFLAGS) -o ..\build\dist\contrib\lib\admb-contrib.dll -Wl,--whole-archive ..\build\dist\contrib\lib\libcontrib-shared.a ../build/dist/lib/libadmb-shared.a -Wl,--no-whole-archive
47
	$(CXX) -static -shared $(LDFLAGS) -o ..\build\dist\contrib\lib\admb-contribo.dll -Wl,--whole-archive ..\build\dist\contrib\lib\libcontribo-shared.a ../build/dist/lib/libadmbo-shared.a -Wl,--no-whole-archive
45 48
else
46 49
  ifeq (LLVM,$(findstring LLVM,$(shell $(CXX) --version)))
47
	$(CXX) -shared $(LDFLAGS) -o../build/dist/contrib/lib/libcontrib.so -Wl,-force_load ../build/dist/contrib/lib/libcontrib.a ../build/dist/lib/libadmb.so
48
	$(CXX) -shared $(LDFLAGS) -o../build/dist/contrib/lib/libcontribo.so -Wl,-force_load ../build/dist/contrib/lib/libcontribo.a ../build/dist/lib/libadmbo.so
50
	$(CXX) -shared $(LDFLAGS) -o../build/dist/contrib/lib/libadmb-contrib.so -Wl,-force_load ../build/dist/contrib/lib/libcontrib-shared.a ../build/dist/lib/libadmb-shared.a
51
	$(CXX) -shared $(LDFLAGS) -o../build/dist/contrib/lib/libadmb-contribo.so -Wl,-force_load ../build/dist/contrib/lib/libcontribo-shared.a ../build/dist/lib/libadmbo-shared.a
49 52
  else
50
	$(CXX) -shared $(LDFLAGS) -o../build/dist/contrib/lib/libcontrib.so -Wl,--whole-archive ../build/dist/contrib/lib/libcontrib.a -Wl,--no-whole-archive ../build/dist/lib/libadmb.so
51
	$(CXX) -shared $(LDFLAGS) -o../build/dist/contrib/lib/libcontribo.so -Wl,--whole-archive ../build/dist/contrib/lib/libcontribo.a -Wl,--no-whole-archive ../build/dist/lib/libadmbo.so
53
	$(CXX) -shared $(LDFLAGS) -o../build/dist/contrib/lib/libadmb-contrib.so -Wl,--whole-archive ../build/dist/contrib/lib/libcontrib-shared.a ../build/dist/lib/libadmb-shared.a -Wl,--no-whole-archive
54
	$(CXX) -shared $(LDFLAGS) -o../build/dist/contrib/lib/libadmb-contribo.so -Wl,--whole-archive ../build/dist/contrib/lib/libcontribo-shared.a ../build/dist/lib/libadmbo-shared.a -Wl,--no-whole-archive
52 55
  endif
53 56
endif
54 57
	@echo ADMB contrib shared build completed.
......
60 63
	@$(MAKE) --directory=statslib CONTRIB_INCLUDE=$(CONTRIB_INCLUDE) includes
61 64
	@$(MAKE) --directory=src CONTRIB_INCLUDE=$(CONTRIB_INCLUDE) includes
62 65

  
66
libs: 
67
	$(MAKE) contrib-dirs
68
	$(MAKE) contrib-libs
69

  
63 70
contrib-libs: contrib-ecolib contrib-gdbprintlib contrib-qfclib contrib-statslib contrib-src
64 71
ifeq ($(SHELL),cmd)
65
	if exist  src\$(CONTRIB_LIB)\libcontrib.a del src\$(CONTRIB_LIB)\libcontrib.a
66
	$(AR) -rs src\$(CONTRIB_LIB)\libcontrib.a src\$(CONTRIB_OBJS_DIR)\saflp-contrib-*.obj
67
	if exist  src\$(CONTRIB_LIB)\libcontribo.a del src\$(CONTRIB_LIB)\libcontribo.a
68
	$(AR) -rs src\$(CONTRIB_LIB)\libcontribo.a src\$(CONTRIB_OBJS_DIR)\optlp-contrib-*.obj
72
	if exist  src\$(CONTRIB_LIB)\libcontrib$(SHARED).a del src\$(CONTRIB_LIB)\libcontrib.a
73
	$(AR) -rs src\$(CONTRIB_LIB)\libcontrib$(SHARED).a src\$(CONTRIB_OBJS_DIR)\saflp-contrib-*.obj
74
	if exist  src\$(CONTRIB_LIB)\libcontribo$(SHARED).a del src\$(CONTRIB_LIB)\libcontribo.a
75
	$(AR) -rs src\$(CONTRIB_LIB)\libcontribo$(SHARED).a src\$(CONTRIB_OBJS_DIR)\optlp-contrib-*.obj
69 76
else
70
	rm -vf src/$(CONTRIB_LIB)/libcontrib.a
71
	$(AR) -rs src/$(CONTRIB_LIB)/libcontrib.a src/$(CONTRIB_OBJS_DIR)/saflp-contrib-*.obj
72
	rm -vf src/$(CONTRIB_LIB)/libcontribo.a
73
	$(AR) -rs src/$(CONTRIB_LIB)/libcontribo.a src/$(CONTRIB_OBJS_DIR)/optlp-contrib-*.obj
77
	rm -vf src/$(CONTRIB_LIB)/libcontrib$(SHARED).a
78
	$(AR) -rs src/$(CONTRIB_LIB)/libcontrib$(SHARED).a src/$(CONTRIB_OBJS_DIR)/saflp-contrib-*.obj
79
	rm -vf src/$(CONTRIB_LIB)/libcontribo$(SHARED).a
80
	$(AR) -rs src/$(CONTRIB_LIB)/libcontribo$(SHARED).a src/$(CONTRIB_OBJS_DIR)/optlp-contrib-*.obj
74 81
endif
75 82

  
76 83
contrib-ad2csv: contrib-dirs

Also available in: Unified diff