w32: Remove cruft in w32-io from WindowsME times.
[gpgme.git] / contrib / conf-w32ce-msc / build.mk
1 # build.mk - Makefile to build libgpg-error using Visual-C
2 # Copyright 2010 g10 Code GmbH
3 #
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.
7 #
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.
11
12 # This is a helper make script to build libgpg-error for WindowsCE
13 # using the Microsoft Visual C compiler.  
14
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:
19
20 #   TARGET/src - Source directories:  One directory for each project
21 #         /bin - Installed DLLs
22 #         /lib - Installed import libs.
23 #         /include - Instaled header files.
24
25 targetdir = /home/smb/xppro-gnu
26 targetsrc = $(targetdir)/src
27
28 # Install directories (relative)
29 bindir = ../../../bin
30 libdir = ../../../lib
31 incdir = ../../../include
32
33
34 help:
35         @echo "Run "
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"
41
42 ce_defines = -DWINCE -D_WIN32_WCE=0x502 -DUNDER_CE \
43              -DWIN32_PLATFORM_PSPC -D_UNICODE -DUNICODE \
44              -D_CONSOLE -DARM -D_ARM_
45 #-D_DEBUG -DDEBUG 
46
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
50
51 LDFLAGS =
52
53 # Standard source files
54 sources = \
55         assuan-support.c    \
56         ath-pth.c           \
57         ath-pthread.c       \
58         ath.c               \
59         ath.h               \
60         context.h           \
61         conversion.c        \
62         data-compat.c       \
63         data-fd.c           \
64         data-mem.c          \
65         data-stream.c       \
66         data-user.c         \
67         data.c              \
68         data.h              \
69         debug.c             \
70         debug.h             \
71         decrypt-verify.c    \
72         decrypt.c           \
73         delete.c            \
74         dirinfo.c           \
75         edit.c              \
76         encrypt-sign.c      \
77         encrypt.c           \
78         engine-assuan.c     \
79         engine-backend.h    \
80         engine-g13.c        \
81         engine-gpg.c        \
82         engine-gpgconf.c    \
83         engine-gpgsm.c      \
84         engine-uiserver.c   \
85         engine.c            \
86         engine.h            \
87         error.c             \
88         export.c            \
89         funopen.c           \
90         genkey.c            \
91         get-env.c           \
92         getauditlog.c       \
93         gpgconf.c           \
94         gpgme-tool.c        \
95         gpgme-w32spawn.c    \
96         gpgme.c             \
97         import.c            \
98         isascii.c           \
99         kdpipeiodevice.h    \
100         key.c               \
101         keylist.c           \
102         op-support.c        \
103         opassuan.c          \
104         ops.h               \
105         passphrase.c        \
106         passwd.c            \
107         priv-io.h           \
108         progress.c          \
109         putc_unlocked.c     \
110         sema.h              \
111         setenv.c            \
112         sig-notation.c      \
113         sign.c              \
114         signers.c           \
115         stpcpy.c            \
116         trust-item.c        \
117         trustlist.c         \
118         ttyname_r.c         \
119         util.h              \
120         vasprintf.c         \
121         verify.c            \
122         version.c           \
123         vfs-create.c        \
124         vfs-mount.c         \
125         w32-ce.c            \
126         w32-ce.h            \
127         w32-glib-io.c       \
128         w32-io.c            \
129         w32-sema.c          \
130         w32-util.c          \
131         wait-global.c       \
132         wait-private.c      \
133         wait-user.c         \
134         wait.c              \
135         wait.h              \
136         gpgme.def
137
138 # The object files we need to create from sources.
139 objs = \
140         conversion.obj     \
141         get-env.obj        \
142         data.obj           \
143         data-fd.obj        \
144         data-stream.obj    \
145         data-mem.obj       \
146         data-user.obj      \
147         data-compat.obj    \
148         signers.obj        \
149         sig-notation.obj   \
150         wait.obj           \
151         wait-global.obj    \
152         wait-private.obj   \
153         wait-user.obj      \
154         op-support.obj     \
155         encrypt.obj        \
156         encrypt-sign.obj   \
157         decrypt.obj        \
158         decrypt-verify.obj \
159         verify.obj         \
160         sign.obj           \
161         passphrase.obj     \
162         progress.obj       \
163         key.obj            \
164         keylist.obj        \
165         trust-item.obj     \
166         trustlist.obj      \
167         import.obj         \
168         export.obj         \
169         genkey.obj         \
170         delete.obj         \
171         edit.obj           \
172         getauditlog.obj    \
173         opassuan.obj       \
174         passwd.obj         \
175         engine.obj         \
176         engine-gpg.obj     \
177         engine-gpgsm.obj     \
178         assuan-support.obj   \
179         engine-assuan.obj    \
180         engine-gpgconf.obj   \
181         engine-g13.obj     \
182         vfs-mount.obj      \
183         vfs-create.obj     \
184         gpgconf.obj        \
185         w32-ce.obj         \
186         w32-util.obj       \
187         w32-sema.obj       \
188         w32-io.obj         \
189         dirinfo.obj        \
190         debug.obj          \
191         gpgme.obj          \
192         version.obj        \
193         error.obj          \
194         ath.obj            \
195         vasprintf.obj      \
196         ttyname_r.obj      \
197         stpcpy.obj         \
198         setenv.obj
199
200
201 # Sources files in this directory inclduing this Makefile
202 conf_sources = \
203         build.mk \
204         config.h \
205         stdint.h io.h fcntl.h
206
207 # Source files built by running the standard build system.
208 built_sources = \
209         gpgme.h         \
210         status-table.h
211
212 copy-static-source:
213         @if [ ! -f ./gpgme.c ]; then \
214            echo "Please cd to the src/ directory first"; \
215            exit 1; \
216         fi
217         cp -t $(targetsrc)/gpgme/src $(sources);
218         cd ../contrib/conf-w32ce-msc ; \
219             cp -t $(targetsrc)/gpgme/src $(conf_sources)
220
221 copy-built-source:
222         @if [ ! -f ./gpgme.h ]; then \
223            echo "Please build using ./autogen.sh --build-w32ce first"; \
224            exit 1; \
225         fi
226         cp -t $(targetsrc)/gpgme/src $(built_sources)
227
228 copy-source: copy-static-source copy-built-source 
229
230
231 .c.obj:
232         $(CC) $(CFLAGS) -c $<
233
234 all:  $(sources) $(conf_sources) $(built_sources) $(objs)
235         link    /DLL /IMPLIB:libgpgme-11-msc.lib \
236                 /OUT:libgpgme-11-msc.dll \
237                 /DEF:gpgme.def /NOLOGO /MANIFEST:NO \
238                 /NODEFAULTLIB:"oldnames.lib" /DYNAMICBASE:NO \
239                 $(objs) \
240                 $(libdir)/libgpg-error-0-msc.lib \
241                 $(libdir)/libassuan-0-msc.lib \
242                 coredll.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib \
243                 commctrl.lib ws2.lib /subsystem:windowsce,5.02
244
245 # Note that we don't need to create the install directories because
246 # libgpg-error must have been build and installed prior to this
247 # package.
248 install: all
249         copy /y gpgme.h $(incdir:/=\)
250         copy /y libgpgme-11-msc.dll $(bindir:/=\)
251         copy /y libgpgme-11-msc.lib $(libdir:/=\)
252
253
254 clean:
255         del *.obj libgpgme-11-msc.lib libgpgme-11-msc.dll libgpgme-11-msc.exp
256