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 | |
---|
1 | ifndef ODIN
|
---|
2 | $(error ODIN variable must be set)
|
---|
3 | else
|
---|
4 | ifeq ($(shell ls $(ODIN)/include/odin.h),)
|
---|
5 | $(error $(ODIN) does not contain include/odin.h)
|
---|
6 | endif
|
---|
7 | endif
|
---|
8 |
|
---|
9 | .PHONY: default
|
---|
10 |
|
---|
11 | default: all
|
---|
12 |
|
---|
13 | ODIN_DOS = $(subst /,\,$(ODIN))
|
---|
14 |
|
---|
15 | CFLAGS += -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
|
---|
18 | CFLAGS += -I$(ODIN)/include -I$(ODIN)/include/win
|
---|
19 |
|
---|
20 | CFLAGS += -g -DDEBUG -L$(ODIN)/lib/Debug -lkernel32.lib
|
---|
21 |
|
---|
22 | DEBUGGER = ipmd
|
---|
23 |
|
---|
24 | run-%: %
|
---|
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 |
|
---|
30 | debug-%: %
|
---|
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 |
|
---|
42 | CLEAN = *.exe *.map *.log
|
---|
43 |
|
---|
44 | clean::
|
---|
45 | -rm $(CLEAN)
|
---|
46 |
|
---|
47 | define run-with-args-gen
|
---|
48 | .PHONY: run-$(1)-$(2) run-$(1)-$(3)
|
---|
49 | run-$(1)-$(2): $(1)
|
---|
50 | @make -s run-$(1) $(1)_ARGS=$($(1)_ARGS.$(2))
|
---|
51 | run-$(1)-$(3):: run-$(1)-$(2)
|
---|
52 | endef
|
---|
53 |
|
---|
54 | run-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.