分类: LINUX
2010-07-02 11:44:19
CeGCC Install from source:
Heavily influenced by the CeGCC's build tool chain documentaiton.
This guide is to get the unacquainted to get the sources to CeGCC, build and configure to generate ARM compatible Windows CE executables.
1. Get the sources: (Subversion client must be installed):
svn co cegcc
sudo ./build-cegcc.sh
export PATH=$PATH:/opt/cegcc/bin
#include
int WinMain()
{
printf("Testing\n");
}
Compile line:
arm-wince-cegcc-gcc -o maintest.exe test.c
The only warning that should appear is:
Info: resolving _CRT_MT by linking to __imp__CRT_MT (auto-import)
NOTE: The cegcc carries the same syntax as gcc. For example -I for include directories -l for libraries to include.
5. Notes about CeGCC and SyncE: The CeGCC tool set was made to be used with the SynCE toolset. pcp to copy files to the connected PocketPC, and prun to remotely run an executable on the connected PocketPC device.
6. Sample make file (taken from the example make file provided from the sources (doc/examples/Makefile)
ARCH= arm-wince-pe
CC= ${ARCH}-gcc ${CFLAGS}
WINDRES= ${ARCH}-windres
CFLAGS= -D_WIN32_IE=0x0400 ${VERBOSE} ${INCLUDE}
LDFLAGS= -Wl,--major-subsystem-version,4,--minor-subsystem-version,20
PDADIR= ":/storage card/devel"
menu-resource.exe: menu-resource.o menu-resource.rsc
${CC} -o $@ menu-resource.o menu-resource.rsc -lcommctrl ${LDFLAGS}
menu-resource.o: menu-resource.c
${CC} -c $?
menu-resource.rsc: menu-resource.rc menu-resource.h
${WINDRES} menu-resource.rc menu-resource.rsc
clean:
-rm -f *.o *.exe *.rsc
dist:
for i in *.exe ; do \
pcp $$i ${PDADIR}/$$i ; \
done