source: trunk/testapp/common.mak@ 21433

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

testapp/common.mak: Added debug-<something> target that starts <somethin> under $(DEBUGGER) (ipmd by default).

File size: 972 bytes
RevLine 
[21430]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
[21433]22DEBUGGER = ipmd
23
[21430]24run-%: %
25 @echo [Running $<]
26 @echo.
27 @cmd /c "set BEGINLIBPATH=$(ODIN_DOS)/bin/Debug;$(ODIN_DOS)/bin;%BEGINLIBPATH% && $<"
28
[21433]29debug-%: %
30 @echo [Debugging $<]
31 @echo.
32 @cmd /c "set BEGINLIBPATH=$(ODIN_DOS)/bin/Debug;$(ODIN_DOS)/bin;%BEGINLIBPATH% && $(DEBUGGER) $<"
33
[21430]34%.exe: %.c
35 gcc $< -Zomf -Zmap -Zlinker /PM:VIO -o $@ $(CFLAGS)
36
37%.s: %.c
38 gcc $< -S -Zomf -o $@ $(CFLAGS)
39
40CLEAN = *.exe *.map *.log
41
42clean::
43 -rm $(CLEAN)
Note: See TracBrowser for help on using the repository browser.