]>
Commit | Line | Data |
---|---|---|
1 | # Makefile for building PocketPC ARM binary from Linux using wine and EVC | |
2 | # By pigeon | |
3 | # Inspired by HRET written by anpaza | |
4 | # Requires GNU Make, wine, and stuff from EVC, read ReadMe.wine | |
5 | ||
6 | #============================================== User-defined variables ======# | |
7 | # The directory where your MSVC for StrongARM and the SDK is installed. | |
8 | # You should set up WINE (see /etc/wine.reg) so that it "sees" this drive | |
9 | #BASE=d:\\msvc-arm | |
10 | BASE=c:\\evc | |
11 | ||
12 | #=========================================================== Compilers ======# | |
13 | # Set some env vars for msvc to use | |
14 | WINEPATH=$(BASE)\\ | |
15 | WINE=wine --debugmsg fixme-console | |
16 | ||
17 | # Output directory | |
18 | OUT=out/ | |
19 | ||
20 | ||
21 | # Makefile.project contains sources, target name, and libs | |
22 | include Makefile.project | |
23 | ||
24 | SUB1 = $(SRCS:.cpp=.obj) | |
25 | SUB2 = $(SUB1:.asm=.obj) | |
26 | SUB3 = $(SUB2:.rc=.res) | |
27 | SUB4 = $(SUB3:%.obj=$(OUT)%.obj) | |
28 | OBJS = $(SUB4:%.res=$(OUT)%-res.obj) | |
29 | ||
30 | ||
31 | .SUFFIXES: | |
32 | .SUFFIXES: .exe .obj .res .asm -res.obj | |
33 | ||
34 | ||
35 | # You shouldn't need to change anything below. | |
36 | ||
37 | CXX=$(WINE) -- $(BASE)\\clarm.exe -c | |
38 | ||
39 | CXXFLAGS.DEF=-DARM -D_ARM_ -DUNICODE -D_UNICODE -DUNDER_CE=300 -D_WIN32_WCE=300 | |
40 | CXXFLAGS.INC=-Iinclude -I$(INCLUDE) $(CFLAGS) | |
41 | ||
42 | #-Oxs | |
43 | # Uncomment this for Dell Axim | |
44 | #CXXFLAGS.DEF+=-DAXIM | |
45 | ||
46 | CXXFLAGS=-nologo -W3 -Zi -Od $(CXXFLAGS.DEF) $(CXXFLAGS.INC) | |
47 | ||
48 | ||
49 | ASM=$(WINE) -- $(BASE)\\armasm.exe | |
50 | #ASMFLAGS=-arch 4 -cpu StrongARM1 -32 | |
51 | ||
52 | ||
53 | RC=$(WINE) -- $(BASE)\\rc.exe | |
54 | #RCFLAGS=-r -l 0x409 $(CXXFLAGS.DEF) $(CXXFLAGS.INC) | |
55 | RCFLAGS=$(CXXFLAGS.DEF) $(CXXFLAGS.INC) | |
56 | ||
57 | ||
58 | CVTRES=$(WINE) -- $(BASE)\\cvtres.exe | |
59 | CVTRESFLAGS=-machine:arm -windowsce | |
60 | ||
61 | ||
62 | LD=$(WINE) -- $(BASE)\\link.exe | |
63 | ||
64 | ||
65 | ||
66 | # From EVC project settings | |
67 | LDFLAGS= \ | |
68 | -nologo \ | |
69 | -base:"0x00010000" \ | |
70 | -stack:0x10000,0x1000 \ | |
71 | -entry:"WinMainCRTStartup" \ | |
72 | -align:"4096" \ | |
73 | -machine:ARM \ | |
74 | -subsystem:windowsce,3.0 \ | |
75 | -incremental:yes \ | |
76 | -libpath:$(LIB) | |
77 | ||
78 | ||
79 | #export MSC_CMD_FLAGS=/c | |
80 | ||
81 | ||
82 | #============================================================= Targets ======# | |
83 | all: $(OUT) $(OUT)$(TARGETBIN) | |
84 | ||
85 | ||
86 | clean: | |
87 | rm -rf $(OUT) | |
88 | ||
89 | #dep: | |
90 | # makedep -r $(CXXFLAGS.DEF) $(CXXFLAGS.INC) -p'$$(OUT)' -o.obj src/*.cpp | |
91 | ||
92 | ||
93 | $(OUT)$(TARGETBIN): $(OBJS) | |
94 | ||
95 | ||
96 | #=============================================================== Rules ======# | |
97 | $(OUT)%.obj: %.cpp | |
98 | $(CXX) $(CXXFLAGS) -Fo$@ $< | |
99 | ||
100 | $(OUT)%.obj: %.asm | |
101 | $(ASM) $(ASMFLAGS) -o $@ $< | |
102 | ||
103 | $(OUT)%.res: %.rc | |
104 | $(RC) $(RCFLAGS) -fo $@ $< | |
105 | ||
106 | $(OUT)%-res.obj: $(OUT)%.res | |
107 | $(CVTRES) $(CVTRESFLAGS) -out:$@ $< | |
108 | ||
109 | $(OUT)%.exe: | |
110 | $(LD) $(LDFLAGS) -out:$@ $(^) $(LIBS) | |
111 | ||
112 | $(OUT): | |
113 | mkdir $@ | |
114 |