| 77a37381 |
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 |
| c475935f |
10 | BASE=d:\\msvc-arm\\bin |
| 77a37381 |
11 | |
| 12 | #=========================================================== Compilers ======# |
| 13 | # Set some env vars for msvc to use |
| 14 | WINEPATH=$(BASE)\\ |
| c475935f |
15 | WINE=wine |
| 16 | export WINEDEBUG=-all |
| 77a37381 |
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 | |
| c475935f |
38 | CXX=$(WINE) $(BASE)\\clarm.exe -c |
| 77a37381 |
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 | |
| c475935f |
47 | CXXFLAGS=-nologo -W3 $(CXXFLAGS.DEF) $(CXXFLAGS.INC) |
| 77a37381 |
48 | |
| 49 | |
| c475935f |
50 | ASM=$(WINE) $(BASE)\\armasm.exe |
| 77a37381 |
51 | #ASMFLAGS=-arch 4 -cpu StrongARM1 -32 |
| 52 | |
| 53 | |
| c475935f |
54 | RC=$(WINE) $(BASE)\\rc.exe |
| 77a37381 |
55 | #RCFLAGS=-r -l 0x409 $(CXXFLAGS.DEF) $(CXXFLAGS.INC) |
| 56 | RCFLAGS=$(CXXFLAGS.DEF) $(CXXFLAGS.INC) |
| 57 | |
| 58 | |
| c475935f |
59 | CVTRES=$(WINE) $(BASE)\\cvtres.exe |
| 77a37381 |
60 | CVTRESFLAGS=-machine:arm -windowsce |
| 61 | |
| 62 | |
| c475935f |
63 | LD=$(WINE) $(BASE)\\link.exe |
| 77a37381 |
64 | |
| 65 | |
| 66 | |
| 67 | # From EVC project settings |
| 68 | LDFLAGS= \ |
| 69 | -nologo \ |
| 77a37381 |
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 | |
| 6e6b658b |
99 | $(OUT)%.obj: asm/%.asm |
| 77a37381 |
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 | |