# Makefile for building PocketPC ARM binary from Linux using wine and EVC # By pigeon # Inspired by HRET written by anpaza # Requires GNU Make, wine, and stuff from EVC, read ReadMe.wine #============================================== User-defined variables ======# # 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 #BASE=d:\\msvc-arm BASE=d:\\msvc-arm\\bin #=========================================================== Compilers ======# # Set some env vars for msvc to use WINEPATH=$(BASE)\\ WINE=wine export WINEDEBUG=-all # Output directory OUT=out/ # Makefile.project contains sources, target name, and libs include Makefile.project SUB1 = $(SRCS:.cpp=.obj) SUB2 = $(SUB1:.asm=.obj) SUB3 = $(SUB2:.rc=.res) SUB4 = $(SUB3:%.obj=$(OUT)%.obj) OBJS = $(SUB4:%.res=$(OUT)%-res.obj) .SUFFIXES: .SUFFIXES: .exe .obj .res .asm -res.obj # You shouldn't need to change anything below. CXX=$(WINE) $(BASE)\\clarm.exe -c CXXFLAGS.DEF=-DARM -D_ARM_ -DUNICODE -D_UNICODE -DUNDER_CE=300 -D_WIN32_WCE=300 CXXFLAGS.INC=-Iinclude -I$(INCLUDE) $(CFLAGS) #-Oxs # Uncomment this for Dell Axim #CXXFLAGS.DEF+=-DAXIM CXXFLAGS=-nologo -W3 $(CXXFLAGS.DEF) $(CXXFLAGS.INC) ASM=$(WINE) $(BASE)\\armasm.exe #ASMFLAGS=-arch 4 -cpu StrongARM1 -32 RC=$(WINE) $(BASE)\\rc.exe #RCFLAGS=-r -l 0x409 $(CXXFLAGS.DEF) $(CXXFLAGS.INC) RCFLAGS=$(CXXFLAGS.DEF) $(CXXFLAGS.INC) CVTRES=$(WINE) $(BASE)\\cvtres.exe CVTRESFLAGS=-machine:arm -windowsce LD=$(WINE) $(BASE)\\link.exe # From EVC project settings LDFLAGS= \ -nologo \ -entry:"WinMainCRTStartup" \ -align:"4096" \ -machine:ARM \ -subsystem:windowsce,3.0 \ -incremental:yes \ -libpath:$(LIB) #export MSC_CMD_FLAGS=/c #============================================================= Targets ======# all: $(OUT) $(OUT)$(TARGETBIN) clean: rm -rf $(OUT) #dep: # makedep -r $(CXXFLAGS.DEF) $(CXXFLAGS.INC) -p'$$(OUT)' -o.obj src/*.cpp $(OUT)$(TARGETBIN): $(OBJS) #=============================================================== Rules ======# $(OUT)%.obj: %.cpp $(CXX) $(CXXFLAGS) -Fo$@ $< $(OUT)%.obj: %.asm $(ASM) $(ASMFLAGS) -o $@ $< $(OUT)%.res: %.rc $(RC) $(RCFLAGS) -fo $@ $< $(OUT)%-res.obj: $(OUT)%.res $(CVTRES) $(CVTRESFLAGS) -out:$@ $< $(OUT)%.exe: $(LD) $(LDFLAGS) -out:$@ $(^) $(LIBS) $(OUT): mkdir $@