]> git.zerfleddert.de Git - linexec-j720/blob - Makefile
add built-binary to cvs, as toolchain needs wine and closed-source
[linexec-j720] / Makefile
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=d:\\msvc-arm\\bin
11
12 #=========================================================== Compilers ======#
13 # Set some env vars for msvc to use
14 WINEPATH=$(BASE)\\
15 WINE=wine
16 export WINEDEBUG=-all
17
18 # Output directory
19 OUT=out/
20
21
22 # Makefile.project contains sources, target name, and libs
23 include Makefile.project
24
25 SUB1 = $(SRCS:.cpp=.obj)
26 SUB2 = $(SUB1:.asm=.obj)
27 SUB3 = $(SUB2:.rc=.res)
28 SUB4 = $(SUB3:%.obj=$(OUT)%.obj)
29 OBJS = $(SUB4:%.res=$(OUT)%-res.obj)
30
31
32 .SUFFIXES:
33 .SUFFIXES: .exe .obj .res .asm -res.obj
34
35
36 # You shouldn't need to change anything below.
37
38 CXX=$(WINE) $(BASE)\\clarm.exe -c
39
40 CXXFLAGS.DEF=-DARM -D_ARM_ -DUNICODE -D_UNICODE -DUNDER_CE=300 -D_WIN32_WCE=300
41 CXXFLAGS.INC=-Iinclude -I$(INCLUDE) $(CFLAGS)
42
43 #-Oxs
44 # Uncomment this for Dell Axim
45 #CXXFLAGS.DEF+=-DAXIM
46
47 CXXFLAGS=-nologo -W3 $(CXXFLAGS.DEF) $(CXXFLAGS.INC)
48
49
50 ASM=$(WINE) $(BASE)\\armasm.exe
51 #ASMFLAGS=-arch 4 -cpu StrongARM1 -32
52
53
54 RC=$(WINE) $(BASE)\\rc.exe
55 #RCFLAGS=-r -l 0x409 $(CXXFLAGS.DEF) $(CXXFLAGS.INC)
56 RCFLAGS=$(CXXFLAGS.DEF) $(CXXFLAGS.INC)
57
58
59 CVTRES=$(WINE) $(BASE)\\cvtres.exe
60 CVTRESFLAGS=-machine:arm -windowsce
61
62
63 LD=$(WINE) $(BASE)\\link.exe
64
65
66
67 # From EVC project settings
68 LDFLAGS= \
69 -nologo \
70 -entry:"WinMainCRTStartup" \
71 -align:"4096" \
72 -machine:ARM \
73 -subsystem:windowsce,3.0 \
74 -incremental:yes \
75 -libpath:$(LIB)
76
77
78 #export MSC_CMD_FLAGS=/c
79
80
81 #============================================================= Targets ======#
82 all: $(OUT) $(OUT)$(TARGETBIN)
83
84
85 clean:
86 rm -rf $(OUT)
87
88 #dep:
89 # makedep -r $(CXXFLAGS.DEF) $(CXXFLAGS.INC) -p'$$(OUT)' -o.obj src/*.cpp
90
91
92 $(OUT)$(TARGETBIN): $(OBJS)
93
94
95 #=============================================================== Rules ======#
96 $(OUT)%.obj: %.cpp
97 $(CXX) $(CXXFLAGS) -Fo$@ $<
98
99 $(OUT)%.obj: asm/%.asm
100 $(ASM) $(ASMFLAGS) -o $@ $<
101
102 $(OUT)%.res: %.rc
103 $(RC) $(RCFLAGS) -fo $@ $<
104
105 $(OUT)%-res.obj: $(OUT)%.res
106 $(CVTRES) $(CVTRESFLAGS) -out:$@ $<
107
108 $(OUT)%.exe:
109 $(LD) $(LDFLAGS) -out:$@ $(^) $(LIBS)
110
111 $(OUT):
112 mkdir $@
113
Impressum, Datenschutz