]> git.zerfleddert.de Git - linexec-j720/blame_incremental - Makefile
Initial import of xdadeveloper linexec sources
[linexec-j720] / Makefile
... / ...
CommitLineData
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
10BASE=c:\\evc
11
12#=========================================================== Compilers ======#
13# Set some env vars for msvc to use
14WINEPATH=$(BASE)\\
15WINE=wine --debugmsg fixme-console
16
17# Output directory
18OUT=out/
19
20
21# Makefile.project contains sources, target name, and libs
22include Makefile.project
23
24SUB1 = $(SRCS:.cpp=.obj)
25SUB2 = $(SUB1:.asm=.obj)
26SUB3 = $(SUB2:.rc=.res)
27SUB4 = $(SUB3:%.obj=$(OUT)%.obj)
28OBJS = $(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
37CXX=$(WINE) -- $(BASE)\\clarm.exe -c
38
39CXXFLAGS.DEF=-DARM -D_ARM_ -DUNICODE -D_UNICODE -DUNDER_CE=300 -D_WIN32_WCE=300
40CXXFLAGS.INC=-Iinclude -I$(INCLUDE) $(CFLAGS)
41
42#-Oxs
43# Uncomment this for Dell Axim
44#CXXFLAGS.DEF+=-DAXIM
45
46CXXFLAGS=-nologo -W3 -Zi -Od $(CXXFLAGS.DEF) $(CXXFLAGS.INC)
47
48
49ASM=$(WINE) -- $(BASE)\\armasm.exe
50#ASMFLAGS=-arch 4 -cpu StrongARM1 -32
51
52
53RC=$(WINE) -- $(BASE)\\rc.exe
54#RCFLAGS=-r -l 0x409 $(CXXFLAGS.DEF) $(CXXFLAGS.INC)
55RCFLAGS=$(CXXFLAGS.DEF) $(CXXFLAGS.INC)
56
57
58CVTRES=$(WINE) -- $(BASE)\\cvtres.exe
59CVTRESFLAGS=-machine:arm -windowsce
60
61
62LD=$(WINE) -- $(BASE)\\link.exe
63
64
65
66# From EVC project settings
67LDFLAGS= \
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 ======#
83all: $(OUT) $(OUT)$(TARGETBIN)
84
85
86clean:
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
Impressum, Datenschutz