1 # build.mk - Makefile to build libgpg-error using Visual-C
2 # Copyright 2010 g10 Code GmbH
4 # This file is free software; as a special exception the author gives
5 # unlimited permission to copy and/or distribute it, with or without
6 # modifications, as long as this notice is preserved.
8 # This file is distributed in the hope that it will be useful, but
9 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
10 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 # This is a helper make script to build libgpg-error for WindowsCE
13 # using the Microsoft Visual C compiler.
15 targetdir = /home/smb/xppro-gnu/src/gpgme/src
16 # The target build directory where we run the Visual C compiler/ This
17 # needs to be an absolute directory name. Further we expect this
18 # structure of the tree:
20 # TARGET/src - Source directories: One directory for each project
21 # /bin - Installed DLLs
22 # /lib - Installed import libs.
23 # /include - Instaled header files.
25 targetdir = /home/smb/xppro-gnu
26 targetsrc = $(targetdir)/src
28 # Install directories (relative)
31 incdir = ../../../include
36 @echo " make -f ../contrib/conf-w32ce-msc/build.mk copy-source"
37 @echo "on the POSIX system and then"
38 @echo " nmake -f build.mk all"
39 @echo " nmake -f build.mk install"
40 @echo "on the Windows system"
42 ce_defines = -DWINCE -D_WIN32_WCE=0x502 -DUNDER_CE \
43 -DWIN32_PLATFORM_PSPC -D_UNICODE -DUNICODE \
44 -D_CONSOLE -DARM -D_ARM_
47 CFLAGS = -nologo -W3 -fp:fast -Os $(ce_defines) \
48 -DHAVE_CONFIG_H -DDLL_EXPORT -D_CRT_SECURE_NO_WARNINGS \
49 -I. -I$(incdir) -I$(incdir)/gpg-extra
53 # Standard source files
139 # The object files we need to create from sources.
202 # Sources files in this directory inclduing this Makefile
208 # Source files built by running the standard build system.
214 @if [ ! -f ./gpgme.c ]; then \
215 echo "Please cd to the src/ directory first"; \
218 cp -t $(targetsrc)/gpgme/src $(sources);
219 cd ../contrib/conf-w32ce-msc ; \
220 cp -t $(targetsrc)/gpgme/src $(conf_sources)
223 @if [ ! -f ./gpgme.h ]; then \
224 echo "Please build using ./autogen.sh --build-w32ce first"; \
227 cp -t $(targetsrc)/gpgme/src $(built_sources)
229 copy-source: copy-static-source copy-built-source
233 $(CC) $(CFLAGS) -c $<
235 all: $(sources) $(conf_sources) $(built_sources) $(objs)
236 link /DLL /IMPLIB:libgpgme-11-msc.lib \
237 /OUT:libgpgme-11-msc.dll \
238 /DEF:gpgme.def /NOLOGO /MANIFEST:NO \
239 /NODEFAULTLIB:"oldnames.lib" /DYNAMICBASE:NO \
241 $(libdir)/libgpg-error-0-msc.lib \
242 $(libdir)/libassuan-0-msc.lib \
243 coredll.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib \
244 commctrl.lib ws2.lib /subsystem:windowsce,5.02
246 # Note that we don't need to create the install directories because
247 # libgpg-error must have been build and installed prior to this
250 copy /y gpgme.h $(incdir:/=\)
251 copy /y libgpgme-11-msc.dll $(bindir:/=\)
252 copy /y libgpgme-11-msc.lib $(libdir:/=\)
256 del *.obj libgpgme-11-msc.lib libgpgme-11-msc.dll libgpgme-11-msc.exp