Revision 936 trunk/src/GNUmakefile

GNUmakefile (revision 936)
1 1
MAKEFLAG_J=-j 1
2
ifndef DISK
3
DISK=../build/dist
2

  
3
ifeq ($(SHELL),sh.exe)
4
  DISK=..\build\dist
5
  LIBPATH=..\build\objects\dist
6
  CXXFLAGS_INCLUDES:=-I..\${DISK}\include
7
else
8
  DISK=../build/dist
9
  LIBPATH=../build/objects/dist
10
  CXXFLAGS_INCLUDES:=-I../${DISK}/include
4 11
endif
5 12

  
6 13
ifndef INSTALL_DIR
7 14
INSTALL_DIR=/usr/local/admb
8 15
endif
9 16

  
17
ifeq ($(SHELL),sh.exe)
10 18
PWD=$(shell pwd)
11

  
12
ifndef LIBPATH
13
LIBPATH=../build/objects/dist
19
else
20
PWD=$(shell cd)
14 21
endif
15 22

  
16
CXXFLAGS_INCLUDES:=-I../${DISK}/include
23

  
17 24
ifeq ($(CXX),CC)
18 25
CXXFLAGS:=-D__GNUDOS__ -Dlinux -D__SPDLL__ -DUSE_LAPLACE $(CXXFLAGS)
19 26
else
......
27 34
endif
28 35

  
29 36
all: dist contrib
37
ifneq ($(SHELL),sh.exe)
30 38
	@printf "\nADMB build completed.\n"
31 39
	@printf "For installation, check README.txt.\n"
40
endif
32 41

  
33 42
dist:
43
ifneq ($(SHELL),sh.exe)
34 44
	rm -rf ${DISK}
35 45
	mkdir -p ${DISK}
36 46
	cp -R ../contrib ${DISK}
......
45 55
	cp -f ../VERSION ${DISK}
46 56
	cp -f ../Makefile ${DISK}
47 57
	rm -rf `find ${DISK} -type d -name .svn`
58
else
59
	if exist ${DISK} rd /S /Q ${DISK}
60
	md ${DISK}
61
	md ${DISK}\contrib
62
	xcopy ..\contrib $(DISK)\contrib /S
63
	md ${DISK}\docs
64
	xcopy ..\docs $(DISK)\docs /S
65
	md ${DISK}\examples
66
	xcopy ..\examples $(DISK)\examples /S
67
	md ${DISK}\src
68
	xcopy ..\src $(DISK)\src /S
69
	md ${DISK}\tests
70
	xcopy ..\tests $(DISK)\tests /S
71
	md ${DISK}\utilities
72
	copy /Y ..\LICENSE.txt ${DISK}
73
	copy /Y ..\README.txt ${DISK}
74
	copy /Y ..\NEWS.txt ${DISK}
75
	copy /Y ..\VERSION ${DISK}
76
	copy /Y ..\Makefile ${DISK}
77
endif
48 78

  
49 79
contrib: includes bins libs
80
ifneq ($(SHELL),sh.exe)
50 81
	mkdir -p ${DISK}/contrib/lib
51 82
	mkdir -p ${DISK}/contrib/bin
52 83
	$(MAKE) ADMB_HOME="${PWD}/${DISK}" --directory=../contrib
84
else
85
	if not exist ${DISK}\contrib md ${DISK}\contrib
86
	if not exist ${DISK}\contrib\lib md ${DISK}\contrib\lib
87
	if not exist ${DISK}\contrib\bin md ${DISK}\contrib\bin
88
	$(MAKE) ADMB_HOME="$(CURDIR)\${DISK}" --directory=..\contrib
89
endif
53 90

  
54 91
libs: admbsaf admbopt
55 92

  
56 93
admbsaf:
94
ifneq ($(SHELL),sh.exe)
57 95
	mkdir -p ${DISK}/lib
58 96
	mkdir -p ${LIBPATH}
59 97
	$(MAKE) $(MAKEFLAG_J) --directory=df1b2-separable CXX=$(CXX) CXXFLAGS="$(CXXFLAGS) -DSAFE_ALL $(CXXFLAGS_INCLUDES)" PREFIX_OBJ=../${LIBPATH}/saflp-df1b2-separable- DISKDIR=../${DISK}
......
65 103
	$(AR) -rs ${DISK}/lib/libadmb.a ../build/objects/dist/saflp-df1b2-separable-*.obj
66 104
	$(AR) -rs ${DISK}/lib/libadmb.a ../build/objects/dist/optlp-nh99-*.obj
67 105
	$(AR) -rs ${DISK}/lib/libadmb.a ../build/objects/dist/optlp-tools99-*.obj
106
else
107
	if not exist ${DISK}\lib md ${DISK}\lib
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff