Revision 1438 trunk/contrib/ecolib/GNUmakefile

GNUmakefile (revision 1438)
1
.ONESHELL:
2
ifeq (sh.exe,$(findstring sh.exe,$(SHELL)))
3
SHELL = cmd
4
endif
1 5
ifeq ($(OS),Windows_NT)
2 6
EXT=.sh
3 7
endif
......
3 7

  
4 8
include objects.lst
9
HEADERS=ecolib.h
5 10

  
6
all: $(addprefix $(PREFIX), $(OBJECTS))
11
ifeq ($(SHELL),cmd)
12
all: $(addprefix $(CONTRIB_OBJS_DIR)\saflp-contrib-, $(OBJECTS)) $(addprefix $(CONTRIB_OBJS_DIR)\optlp-contrib-, $(OBJECTS))
7 13

  
8
$(PREFIX)%.obj: %.cpp
9
ifeq ($(SHELL),sh.exe)
14
$(CONTRIB_OBJS_DIR)\saflp-contrib-%.obj: %.cpp
10 15
	..\..\admb -c $(OPTION) $<
11 16
	copy $(basename $<).obj $@
12
	copy ecolib.h $(CONTRIB_DIR)\include
17

  
18
$(CONTRIB_OBJS_DIR)\optlp-contrib-%.obj: %.cpp
19
	..\..\admb -c -f $(OPTION) $<
20
	copy $(basename $<).obj $@
13 21
else
22
all: $(addprefix $(CONTRIB_OBJS_DIR)/saflp-contrib-, $(OBJECTS)) $(addprefix $(CONTRIB_OBJS_DIR)/optlp-contrib-, $(OBJECTS))
23

  
24
$(CONTRIB_OBJS_DIR)/saflp-contrib-%.obj: %.cpp
14 25
	../../admb$(EXT) -c $(OPTION) $<
15 26
	cp $(basename $<).obj $@
16
	cp ecolib.h $(CONTRIB_DIR)/include
27

  
28
$(CONTRIB_OBJS_DIR)/optlp-contrib-%.obj: %.cpp
29
	../../admb$(EXT) -c -f $(OPTION) $<
30
	cp $(basename $<).obj $@
17 31
endif
18 32

  
33
includes:
34
ifeq ($(SHELL),cmd)
35
	copy $(HEADERS) $(CONTRIB_INCLUDE)
36
else
37
	cp $(HEADERS) $(CONTRIB_INCLUDE)
38
endif
39

  
19 40
test:
20
ifneq ($(SHELL),sh.exe)
41
ifneq ($(SHELL),cmd)
21 42
	$(MAKE) --directory=tests
22 43
endif
23 44

  
24 45
clean:
25
ifneq ($(SHELL),sh.exe)
26
	@rm -vf *.obj
27
	@rm -vf *.o
28
	@rm -vf tests/tests.log
29
	@rm -vf tests/tests.cpp
30
	@rm -vf tests/admodel.hes
31
	@rm -vf tests/tests.par
32
	@rm -vf tests/tests.cor
33
	@rm -vf tests/tests.pin
34
	@rm -vf tests/variance
35
	@rm -vf tests/admodel.cov
36
	@rm -vf tests/tests.std
37
	@rm -vf tests/tests.htp
38
	@rm -vf tests/eigv.rpt
39
	@rm -vf tests/tests
40
	@rm -vf tests/tests.bar
41
	@rm -vf tests/tests.dat
42
	@rm -vf tests/fmin.log
43
	@rm -vf tests/tests.eva
44
	@rm -vf tests/admodel.dep
46
ifeq ($(SHELL),cmd)
47
	del /Q $(OBJECTS)
48
else
49
	@rm -vf $(OBJECTS)
45 50
endif

Also available in: Unified diff