forked from haret/haret
-
Notifications
You must be signed in to change notification settings - Fork 2
/
wince.smak
59 lines (44 loc) · 1.91 KB
/
wince.smak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Submakefile for building for WindowsCE
O = .obj
E = .exe
.SUFFIXES: $E $O .res
vpath %.asm src src/$(TARGET)
vpath %.rc src/$(TARGET)
# The directory where your MSVC for StrongARM and the SDK is installed.
# You should set up WINE (see /etc/wine.reg) so that it "sees" this drive
# Overwrite this in config.smak
DIR.MSVC.COMMON = C:/Program Files/Microsoft eMbedded C++ 4.0/Common/EVC/
DIR.MSVC.ARM ?= C:/Program Files/Microsoft eMbedded C++ 4.0/EVC/wce420
DIR.ARMV4.INCLUDE = C:/Program Files/Windows CE Tools/wce400/STANDARDSDK/Include/Armv4
DIR.ARMV4.LIB = C:/Windows CE Tools/wce300/Pocket PC 2002/lib/arm
# Set some env vars for msvc to use
export WINEPATH = $(DIR.MSVC.ARM)\\bin
export INCLUDE = $(DIR.ARMV4.INCLUDE)
export LIB = $(DIR.MSVC.ARM)\\lib
#WINE = wine --
WINE =
CXX = $(WINE) "$(DIR.MSVC.ARM)\\bin\\clarm.exe" -c
CXXFLAGS.DEF = -DARM -DUNICODE -DUNDER_CE=0x0300 -D_WIN32_WCE=0x0300 -DNDEBUG
CXXFLAGS.INC = -Iinclude
# Do not enable optimization! msvc generates invalid code with -Oxs !!!
CXXFLAGS = -nologo -W3 $(CXXFLAGS.DEF) $(CXXFLAGS.INC)
ASM = $(WINE) "$(DIR.MSVC.ARM)\\bin\\armasm.exe"
ASMFLAGS = -arch 4 -cpu StrongARM1 -32
RC = $(WINE) "$(DIR.MSVC.COMMON)\\bin\\rc.exe"
RCFLAGS = -r -l 0x409 $(CXXFLAGS.DEF) $(CXXFLAGS.INC)
CVTRES = $(WINE) "$(DIR.MSVC.ARM)\\bin\\cvtres.exe"
CVTRESFLAGS = -machine:arm -windowsce
LD = $(WINE) "$(DIR.MSVC.ARM)\\bin\\link.exe"
LDFLAGS = -nologo -base:0x10000 -stack:0x10000,0x1000 -entry:WinMainCRTStartup \
-align:4096 -machine:ARM -subsystem:WindowsCE,3 -libpath:"$(DIR.ARMV4.LIB)"
LIBS = aygshell.lib winsock.lib toolhelp.lib gx.lib
LINK = $(LD) $(LDFLAGS) -out:$@ $^ $(LIBS)
#================================================================= Rules ======#
$(OUT)%.obj: %.cpp
$(CXX) $(CXXFLAGS) -Fo$@ $<
$(OUT)%.obj: %.asm
$(ASM) $(ASMFLAGS) -o $@ $<
$(OUT)%.res: src/wince/%.rc
$(RC) $(RCFLAGS) -fo $@ $<
$(OUT)%-res.obj: $(OUT)%.res
$(CVTRES) $(CVTRESFLAGS) -out:$@ $<