Revision 1443 trunk/contrib/src/GNUmakefile

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

  
9 1
OBJECTS=contrib.obj
10 2
HEADERS=contrib.h
11 3

  
12
ifeq ($(SHELL),cmd)
13
all: $(addprefix $(CONTRIB_OBJS_DIR)\saflp-contrib-, $(OBJECTS)) $(addprefix $(CONTRIB_OBJS_DIR)\optlp-contrib-, $(OBJECTS))
14

  
15
$(CONTRIB_OBJS_DIR)\saflp-contrib-%.obj: %.cpp
16
	..\..\admb -c $(OPTION) $<
17
	copy $(basename $<).obj $@
18

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

  
25
$(CONTRIB_OBJS_DIR)/saflp-contrib-%.obj: %.cpp
26
	../../admb$(EXT) -c $(OPTION) $<
27
	cp $(basename $<).obj $@
28

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

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

  
41
test:
42
ifeq ($(SHELL),cmd)
43
	..\..\admb $(OPTION) simple.tpl
44
	simple
45
else
46
	../../admb$(EXT) $(OPTION) simple.tpl
47
	./simple
48
endif
49

  
50
clean:
51
ifeq ($(SHELL),cmd)
52
	@del /Q $(OBJECTS)
53
else
54
	@rm -vf $(OBJECTS)
55
endif
4
include ../admb-rules.mak

Also available in: Unified diff