source: trunk/testapp/common.mak@ 21449

Last change on this file since 21449 was 21449, checked in by dmik, 15 years ago

testapp: Added test case for for try/finally/leave.

File size: 1.3 KB
Line 
1ifndef ODIN
2$(error ODIN variable must be set)
3else
4ifeq ($(shell ls $(ODIN)/include/odin.h),)
5$(error $(ODIN) does not contain include/odin.h)
6endif
7endif
8
9.PHONY: default
10
11default: all
12
13ODIN_DOS = $(subst /,\,$(ODIN))
14
15CFLAGS += -D__WIN32OS2__ -D__i386__ -DSTRICT -D_POSIX_SOURCE \
16 -D_POSIX_C_SOURCE=200112 -D_EMX_SOURCE -D_XOPEN_SOURCE=600 \
17 -D_SVID_SOURCE
18CFLAGS += -I$(ODIN)/include -I$(ODIN)/include/win
19
20CFLAGS += -g -DDEBUG -L$(ODIN)/lib/Debug -lkernel32.lib
21
22DEBUGGER = ipmd
23
24run-%: %
25 @echo [Running $<$(if $($<_ARGS), $($<_ARGS))]
26 @echo.
27 @cmd /c "set BEGINLIBPATH=$(ODIN_DOS)/bin/Debug;$(ODIN_DOS)/bin;%BEGINLIBPATH% && $< $($<_ARGS)"
28 @echo.
29
30debug-%: %
31 @echo [Running $<$(if $($<_ARGS), $($<_ARGS))]
32 @echo.
33 @cmd /c "set BEGINLIBPATH=$(ODIN_DOS)/bin/Debug;$(ODIN_DOS)/bin;%BEGINLIBPATH% && $(DEBUGGER) $< $($<_ARGS)"
34 @echo.
35
36%.exe: %.c
37 gcc $< -Zomf -Zmap -Zlinker /PM:VIO -o $@ $(CFLAGS)
38
39%.s: %.c
40 gcc $< -S -Zomf -o $@ $(CFLAGS)
41
42CLEAN = *.exe *.map *.log
43
44clean::
45 -rm $(CLEAN)
46
47define run-with-args-gen
48.PHONY: run-$(1)-$(2) run-$(1)-$(3)
49run-$(1)-$(2): $(1)
50 @make -s run-$(1) $(1)_ARGS=$($(1)_ARGS.$(2))
51run-$(1)-$(3):: run-$(1)-$(2)
52endef
53
54run-with-args = $(foreach i, $(2), $(eval $(call run-with-args-gen,$(1),$(i),$(3))))run-$(1)-$(3)
Note: See TracBrowser for help on using the repository browser.