Revision 1438 trunk/contrib/statslib/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=statsLib.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 statsLib.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 statsLib.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
clean:
20
ifeq ($(SHELL),sh.exe)
21
	-del *.obj
22
	-del *.o
41
ifeq ($(SHELL),cmd)
42
	@del /Q $(OBJECTS) 
23 43
else
24
	@rm -vf *.obj
25
	@rm -vf *.o
44
	@rm -vf $(OBJECTS)
26 45
endif

Also available in: Unified diff