Revision 1438 trunk/contrib/gdbprintlib/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
......
2 6

  
3
OBJECTS=$(addprefix $(PREFIX), gdbprintlib.obj)
7
OBJECTS=gdbprintlib.obj
8
HEADERS=gdbprintlib.h
4 9

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

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

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

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

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

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

  
18 39
test:
19 40

  
20 41
clean:
21
ifeq ($(SHELL),sh.exe)
22
	del gdbprintlib.obj
23
	del gdbprintlib.o
42
ifeq ($(SHELL),cmd)
43
	del /Q $(OBJECTS)
24 44
else
25
	@rm -vf gdbprintlib.obj
26
	@rm -vf gdbprintlib.o
45
	@rm -vf $(OBJECTS)
27 46
endif

Also available in: Unified diff