# (C) 2003 XDA Developers itsme@xs4all.nl # # $Header$ # out=../build obj=../build/w32 include ../local.mak ccdefs=/D WIN32 /D NDEBUG /D _CONSOLE ccdefs+=/D _CRT_SECURE_NO_WARNINGS /D _SECURE_SCL=0 /D _HAS_ITERATOR_DEBUGGING=0 ccdefs+=-wo4365 ccincs=/I "$(mssdk)\include" /I "$(vc7)/include" /I "$(ActiveSyncSupport)/inc" /I "../dll" /I "../include" /I "../common" /I "$(boost)" # - add '/Zi' when debugging is needed # vc8: /analyze cflags=/nologo /Wall /wd4710 /wd4217 /wd4668 /wd4820 /wd4619 /EHsc /wd4127 /wd4061 /wd4711 /wd4555 /wd4702 /wd4917 /wd4548 /wd4826 # 4127 : conditional expression is constant # 4061 : enumerate .. in switch not explicitly handled # 4711 : function selected for automatic inline expansion # 4826 : Conversion from '*' to '* __ptr64' is sign-extended. This may cause unexpected runtime behavior. # 4548 : expression before comma has no effect; expected expression with side-effect # - add '/debug' when debugging is needed ldflags=/nologo /incremental:no ifdef DEBUG ccdefs+=/D _DEBUG ldflags+=/debug /map cflags+=/Zi /MTd obj=../build/w32dbg else cflags+=/O2 /MT endif ifdef UNICODE ccdefs+=/D _UNICODE /D UNICODE obj=../build/w32uni endif libpaths= /libpath:"$(mssdk)/lib" /libpath:"$(vc7)/lib" /libpath:"$(ActiveSyncSupport)/lib" /libpath:"$(boost)/lib-x86" extralibs=rapi.lib user32.lib advapi32.lib crypt32.lib .SUFFIXES: .SUFFIXES: .cpp .obj .exe define compile @"$(w32cc)" $(cflags) $(cflags_$(basename $(notdir $1))) /c $(ccdefs) $(ccincs) $2 /Fo"$1" endef $(obj)/%.obj: %.cpp $(call compile,$@,$<) $(obj)/%.obj: ../common/%.cpp $(call compile,$@,$<) $(out)/%.exe: $(obj)/%.obj @"$(w32ld)" $(ldflags) $(ldflags_$(basename $(notdir $@))) $(libpaths) $(extralibs) $^ /out:$@ all: $(obj) all2 debug: make DEBUG=1 $(obj): mkdir -p $(obj) define compilerule $(obj)/$1: $2 $$(call compile,$$@,$$<) endef # special rules ################################# define buildtarget APPLIST+=$1 CLEANLIST+=$(out)/$1 CLEANLIST+=$(basename $(out)/$1).pdb CLEANLIST+=$(basename $(out)/$1).map CLEANLIST+=$(addprefix $(obj)/,$2) $(out)/$1: $(addprefix $(obj)/,$2) endef define copyfile APPLIST+=$1 CLEANLIST+=$(out)/$1 $(out)/$1: $(out)/$2 cp $$^ $$@ endef #$(call buildtarget,tstaudio.exe, tstaudio.obj debug.obj stringutils.obj winmm.lib) define buildrules $(call compilerule,debugnorapi.obj,../common/debug.cpp) cflags_debugnorapi=/D_NO_RAPI $(call compilerule,ustringutils.obj,../common/stringutils.cpp) cflags_ustringutils=/D_UNICODE /DUNICODE $(call compilerule,ucsidlpaths.obj,csidlpaths.cpp) cflags_ucsidlpaths=/D_UNICODE /DUNICODE $(call compilerule,ucheckdll.obj,checkdll.cpp) cflags_ucheckdll=/D_UNICODE /DUNICODE $(call compilerule,udebug.obj,../common/debug.cpp) cflags_udebug=/D_UNICODE /DUNICODE $(call compilerule,ppostmsg.obj,ppostmsg.cpp) cflags_ppostmsg=/DWINCEPOSTMSG $(call compilerule,postmsg.obj,ppostmsg.cpp) cflags_postmsg=/DWIN32POSTMSG $(call compilerule,pmemdump.obj,pmemdump.cpp) cflags_pmemdump=/DWINCEMEMDMP $(call compilerule,memdump.obj,pmemdump.cpp) cflags_memdump=/DWIN32MEMDMP $(call compilerule,pregutl.obj,pregutl.cpp) cflags_pregutl=/DWINCEREGUTL $(call compilerule,regutl.obj,pregutl.cpp) cflags_regutl=/D_UNICODE /DUNICODE /DWIN32REGUTL $(call compilerule,sdread.obj,psdread.cpp) cflags_sdread=/D_NO_RAPI $(call compilerule,psetmem.obj,psetmem.cpp) cflags_psetmem=/DWINCESETMEM $(call compilerule,setmem.obj,psetmem.cpp) cflags_setmem=/DWIN32SETMEM $(call copyfile,pget.exe,pput.exe) $(call copyfile,pdocwrite.exe,pdocread.exe) $(call copyfile,psdwrite.exe,psdread.exe) $(call copyfile,sdwrite.exe,sdread.exe) $(call copyfile,pflashrom.exe,pnewbootloader.exe) $(call buildtarget,dump.exe, dump.obj debug.obj stringutils.obj) cflags_dump=/I C:/local/winOpenSSL/include -D_USE_OPENSSL ldflags_dump=/libpath:c:/local/winOpenSSL/lib/VC libeay32MTd.lib ssleay32MTd.lib $(call buildtarget,pps.exe, pps.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,pkill.exe, pkill.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,psynctime.exe, psynctime.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,preboot.exe, preboot.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,pcoldboot.exe, pcoldboot.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,ppostmsg.exe, ppostmsg.obj checkdll.obj debug.obj stringutils.obj vectorutils.obj) $(call buildtarget,postmsg.exe, postmsg.obj debug.obj stringutils.obj vectorutils.obj) $(call buildtarget,pdel.exe, pdel.obj csidlpaths.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,pmemdump.exe, pmemdump.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,memdump.exe, memdump.obj checkdll.obj debug.obj stringutils.obj sysint-physmem.obj) $(call buildtarget,pcalladdr.exe, pcalladdr.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,pgsmbuf.exe, pgsmbuf.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,pgsmdump.exe, pgsmdump.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,pdblist.exe, pdblist.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,pcontacts.exe, pcontacts.obj checkdll.obj debug.obj stringutils.obj vectorutils.obj) $(call buildtarget,pdir.exe, pdir.obj ucsidlpaths.obj ucheckdll.obj udebug.obj ustringutils.obj) cflags_pdir=/D_UNICODE /DUNICODE $(call buildtarget,psendsms.exe, psendsms.obj stringutils.obj) $(call buildtarget,pdial.exe, pdial.obj stringutils.obj) $(call buildtarget,pmkdir.exe, pmkdir.obj csidlpaths.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,pput.exe, pput.obj ucsidlpaths.obj ucheckdll.obj udebug.obj ustringutils.obj) cflags_pput=/D_UNICODE /DUNICODE $(call buildtarget,pregdmp.exe, pregdmp.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,pregutl.exe, pregutl.obj checkdll.obj debug.obj stringutils.obj vectorutils.obj FileFunctions.obj) $(call buildtarget,regutl.exe, regutl.obj checkdll.obj debug.obj stringutils.obj vectorutils.obj FileFunctions.obj) $(call buildtarget,prun.exe, prun.obj csidlpaths.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,prapi.exe, prapi.obj checkdll.obj debug.obj stringutils.obj FileFunctions.obj) $(call buildtarget,pmemmap.exe, pmemmap.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,phandle.exe, phandle.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,pdebug.exe, pdebug.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,pdocread.exe, pdocread.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,psdread.exe, psdread.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,sdread.exe, sdread.obj debugnorapi.obj stringutils.obj) $(call buildtarget,psetmem.exe, psetmem.obj checkdll.obj debug.obj stringutils.obj vectorutils.obj FileFunctions.obj) $(call buildtarget,setmem.exe, setmem.obj checkdll.obj debug.obj stringutils.obj vectorutils.obj sysint-physmem.obj FileFunctions.obj) $(call buildtarget,pcmon.exe, pcmon.obj debug.obj stringutils.obj) $(call buildtarget,pnewbmp.exe, pnewbmp.obj checkdll.obj debug.obj stringutils.obj) $(call buildtarget,xda2dmp.exe, xda2dmp.obj debug.obj stringutils.obj crc32.obj) $(call buildtarget,pnewbootloader.exe, pnewbootloader.obj checkdll.obj debug.obj stringutils.obj) endef $(eval $(buildrules)) all2: $(addprefix $(out)/,$(APPLIST)) clean: rm -f $(CLEANLIST) ifndef DEBUG make clean DEBUG=1 endif dump.obj: dump.cpp dump_crc32.h dump_hash.h