source: vendor/w32api/current/lib/Makefile.in

Last change on this file was 2720, checked in by bird, 19 years ago

w32api v3.6

File size: 6.6 KB
Line 
1#
2# Makefile.in
3#
4# This file is part of a free library for the Win32 API.
5#
6# This library is distributed in the hope that it will be useful,
7# but WITHOUT ANY WARANTY; without even the implied warranty of
8# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9
10
11# start config section
12
13SHELL = @SHELL@
14
15srcdir = @srcdir@
16VPATH = @srcdir@
17
18SUBDIRS := ddk directx
19subdirs := ddk directx
20
21host_alias = @host@
22build_alias = @build@
23target_alias = @target@
24prefix = @prefix@
25includedir:=@includedir@
26
27program_transform_name = @program_transform_name@
28exec_prefix = @exec_prefix@
29libdir:=@libdir@
30bindir = @bindir@
31ifeq ($(target_alias),$(host_alias))
32ifeq ($(build_alias),$(host_alias))
33tooldir:=$(exec_prefix)
34else
35tooldir:=$(exec_prefix)/$(target_alias)
36endif
37else
38tooldir:=$(exec_prefix)/$(target_alias)
39endif
40datadir = @datadir@
41infodir = @infodir@
42ifneq (,$(findstring cygwin,$(target_alias)))
43inst_includedir:=$(tooldir)/include/w32api
44inst_libdir:=$(tooldir)/lib/w32api
45else
46inst_includedir:=$(includedir)
47inst_libdir:=$(libdir)
48endif
49
50INSTALL = @INSTALL@
51INSTALL_DATA = @INSTALL_DATA@
52INSTALL_PROGRAM = @INSTALL_PROGRAM@
53mkinstalldirs = mkdir -p
54
55CC = @CC@
56CC_FOR_TARGET = $(CC)
57
58DLLTOOL = @DLLTOOL@
59DLLTOOL_FLAGS = --as=$(AS) -k
60AS = @AS@
61AS_FOR_TARGET = $(AS_FOR_TARGET)
62WINDRES = @WINDRES@
63
64# Depending on if we build as part of winsup or mingw we need to
65# add additional include paths in order to get the correct headers
66# from the C library.
67BUILDENV = @BUILDENV@
68
69ifeq ($(BUILDENV), cygwin)
70# winsup/include
71# winsup/../newlib/libc/include
72# winsup/../newlib/libc/sys/cygwin
73EXTRA_INCLUDES = -I$(srcdir)/../../include -I$(srcdir)/../../../newlib/libc/include -I$(srcdir)/../../../newlib/libc/sys/cygwin
74endif
75ifeq ($(BUILDENV), mingw)
76EXTRA_INCLUDES = -I$(srcdir)/../../mingw/include
77endif
78
79INCLUDES = -I$(srcdir)/../include $(EXTRA_INCLUDES)
80
81CFLAGS = @CFLAGS@
82ALL_CFLAGS = $(CFLAGS) $(INCLUDES)
83
84RANLIB = @RANLIB@
85AR = @AR@
86LD = @LD@
87
88FLAGS_TO_PASS = \
89 AS="$(AS)" \
90 CC="$(CC)" \
91 CPPFLAGS="$(CPPFLAGS)" \
92 CFLAGS="$(CFLAGS)" \
93 CXXFLAGS="$(CXXFLAGS)" \
94 AR="$(AR)" \
95 RANLIB="$(RANLIB)" \
96 LD="$(LD)" \
97 DLLTOOL="$(DLLTOOL)" \
98 TAR="$(TAR)" \
99 TARFLAGS="$(TARFLAGS)" \
100 TARFILEEXT="$(TARFILEEXT)" \
101 WINDRES="$(WINDRES)"
102
103# end config section
104
105# headers
106
107HEADERS = $(notdir $(wildcard $(srcdir)/../include/*.h))
108GL_HEADERS = $(notdir $(wildcard $(srcdir)/../include/GL/*.h))
109
110# libraries
111
112DEF_FILES = $(notdir $(wildcard $(srcdir)/*.def))
113MRI_FILES = $(notdir $(wildcard $(srcdir)/*.mri))
114IMPLIBS = $(addprefix lib,$(subst .def,.a,$(DEF_FILES)))
115MIMPLIBS = $(addprefix lib,$(subst .mri,.a,$(MRI_FILES)))
116EXTRA_LIBS=libuuid.a libscrnsave.a libscrnsavw.a liblargeint.a
117LIBS = $(IMPLIBS) $(MIMPLIBS) $(EXTRA_LIBS)
118UUID_OBJS = uuid.o mshtml-uuid.o msxml-uuid.o
119EXTRA_OBJS = shell32.o scrnsave.o scrnsavw.o largeint.o \
120 $(UUID_OBJS) kernel32.o ws2_32.o
121UUID_SOURCES = uuid.c mshtml-uuid.c msxml-uuid.c
122SOURCES = scrnsave.c shell32.c largeint.c $(UUID_SOURCES)\
123res.rc test.c kernel32.c ws2_32.c
124
125DISTFILES = Makefile.in $(DEF_FILES) $(MRI_FILES) $(SOURCES)
126
127.NOTPARALLEL:
128
129# targets
130all: $(LIBS) $(EXTRA_OBJS) ddk directx
131
132%-subdirs:
133 for i in $(SUBDIRS); do \
134 $(MAKE) $(FLAGS_TO_PASS) -C $$i $*; \
135 done
136
137ddk:
138 $(MAKE) $(FLAGS_TO_PASS) -C $@
139
140directx:
141 $(MAKE) $(FLAGS_TO_PASS) -C $@
142
143TEST_OPTIONS = $(ALL_CFLAGS) -DWINVER=0x0666 \
144 -Wall -pedantic -Wsystem-headers -c $(srcdir)/test.c -o test.o
145.PHONY: test ddk directx
146test:
147 @echo "Testing w32api..."
148 @for lang in c c++ objective-c ; do \
149 echo "$$lang..."; \
150 $(CC) -x$$lang $(TEST_OPTIONS) ; \
151 echo "$$lang UNICODE..."; \
152 $(CC) -x$$lang -DUNICODE $(TEST_OPTIONS) ; \
153 done
154 @echo "windres..."
155 @$(WINDRES) --include-dir $(INCDIR) -i $(srcdir)/res.rc -o test.o
156 @echo "windres UNICODE..."
157 @$(WINDRES) --define UNICODE --include-dir $(INCDIR) -i $(srcdir)/res.rc -o test.o
158 @rm -f test.o
159
160scrnsavw.o: scrnsave.c
161 $(CC) -c $(ALL_CFLAGS) -DUNICODE -o $@ $<
162
163# make rules
164
165.SUFFIXES: .c .o .def .a
166
167.c.o:
168 $(CC) -c $(ALL_CFLAGS) -o $@ $<
169
170libuuid.a : $(UUID_OBJS)
171 $(AR) rc $@ $(UUID_OBJS)
172 $(RANLIB) $@
173
174# libvfw32.a contains import stubs for 3 dll's. Using an MRI script
175# seems to be the simplest way to combine them into one archive.
176# NB: With older dlltool, the object file members will not have unique
177# names.
178libvfw32.a : vfw32.mri libmsvfw32.a libavifil32.a libavicap32.a
179 rm -f $@
180 $(AR) -M < ${word 1,$^}
181 $(RANLIB) $@
182
183lib%.a : %.def %.o
184 $(DLLTOOL) $(DLLTOOL_FLAGS) --output-lib $@ --def $(srcdir)/$*.def
185 $(AR) r $@ $*.o
186 $(RANLIB) $@
187
188lib%.a: %.def
189 $(DLLTOOL) $(DLLTOOL_FLAGS) --output-lib $@ --def $<
190
191lib%.a: %.o
192 $(AR) rc $@ $*.o
193 $(RANLIB) $@
194
195.PHONY: install install-libraries install-headers install-ddk
196# install headers and libraries in a target specified directory.
197install: install-libraries install-headers install-ddk install-directx
198
199install-libraries: all
200 $(mkinstalldirs) $(inst_libdir)
201 for i in $(LIBS); do \
202 $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \
203 done
204
205install-headers:
206 $(mkinstalldirs) $(inst_includedir)
207 for i in $(HEADERS); do \
208 $(INSTALL_DATA) $(srcdir)/../include/$$i $(inst_includedir)/$$i ; \
209 done
210 $(mkinstalldirs) $(inst_includedir)/GL
211 for i in $(GL_HEADERS); do \
212 $(INSTALL_DATA) $(srcdir)/../include/GL/$$i $(inst_includedir)/GL/$$i ; \
213 done
214
215install-ddk: install-libraries install-headers
216 cd ddk && $(MAKE) install $(FLAGS_TO_PASS)
217
218install-directx: install-libraries install-headers
219 cd directx && $(MAKE) install $(FLAGS_TO_PASS)
220
221# uninstall headers and libraries from a target specified directory
222uninstall: uninstall-ddk uninstall-directx uninstall-libraries uninstall-headers
223
224uninstall-libraries:
225 @for i in $(LIBS); do \
226 rm -f $(inst_libdir)/$$i ; \
227 done
228 rmdir $(inst_libdir)
229
230uninstall-headers:
231 @for i in $(HEADERS); do \
232 rm -r $(inst_includedir)/$$i ; \
233 done
234 rmdir $(inst_includedir)
235
236uninstall-ddk:
237 cd ddk && $(MAKE) -C uninstall $(FLAGS_TO_PASS)
238
239uninstall-directx:
240 cd directx && $(MAKE) -C uninstall $(FLAGS_TO_PASS)
241
242dist:
243 mkdir $(distdir)/include
244 chmod 755 $(distdir)/include
245 @for i in $(HEADERS); do \
246 cp -p $(srcdir)/../include/$$i $(distdir)/include/$$i ; \
247 done
248 mkdir $(distdir)/include/GL
249 @for i in $(GL_HEADERS); do \
250 cp -p $(srcdir)/../include/GL/$$i $(distdir)/include/GL/$$i ; \
251 done
252 mkdir $(distdir)/lib
253 chmod 755 $(distdir)/lib
254 @for i in $(DISTFILES); do \
255 cp -p $(srcdir)/$$i $(distdir)/lib/$$i ; \
256 done
257 for i in $(SUBDIRS); do \
258 (cd $$i; $(MAKE) distdir=../$(distdir) dist); \
259 done
260
261Makefile: Makefile.in ../config.status ../configure
262 cd ..; $(SHELL) config.status
263
264# clean
265
266mostlyclean:
267 rm -f *~ *.o *.s
268
269clean:
270 rm -f *.o *.a *.s *~
271
272distclean: clean
273 rm -f config.cache config.status config.log Makefile
274
275maintainer-clean: distclean
276
Note: See TracBrowser for help on using the repository browser.