OSDN Git Service

Improve self-documentation of 'for' loop commands.
[pf3gnuchains/pf3gnuchains4x.git] / winsup / w32api / lib / Makefile.in
1 # @configure_input@
2 #
3 #
4 # Makefile.in
5 #
6 # This file is part of a free library for the Win32 API.
7
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
12 srcdir = @srcdir@
13 top_srcdir = @top_srcdir@
14 top_builddir = @top_builddir@
15
16 VPATH = @srcdir@
17
18 include ${top_builddir}/Makefile.comm
19
20 SUBDIRS := ddk directx
21 subdirs := ddk directx
22
23 # Depending on if we build as part of winsup or mingw we need to
24 # add additional include paths in order to get the correct headers
25 # from the C library.
26 #
27 BUILDENV = @BUILDENV@
28
29 ifeq ($(BUILDENV), cygwin)
30 # winsup/include
31 # winsup/../newlib/libc/include
32 # winsup/../newlib/libc/sys/cygwin
33 EXTRA_INCLUDES = -I$(srcdir)/../../include -I$(srcdir)/../../../newlib/libc/include -I$(srcdir)/../../../newlib/libc/sys/cygwin
34 endif
35 ifeq ($(BUILDENV), mingw)
36 EXTRA_INCLUDES = -I$(srcdir)/../../mingw/include
37 endif
38
39 INCLUDES = -I$(srcdir)/../include $(EXTRA_INCLUDES)
40
41 # Headers
42 #
43 HEADERS = $(notdir $(wildcard $(srcdir)/../include/*.h))
44 GL_HEADERS = $(notdir $(wildcard $(srcdir)/../include/GL/*.h))
45 GDIPLUS_HEADERS = $(notdir $(wildcard $(srcdir)/../include/gdiplus/*.h))
46
47 # Libraries
48 #
49 DEF_FILES = $(notdir $(wildcard $(srcdir)/*.def))
50 MRI_FILES = $(notdir $(wildcard $(srcdir)/*.mri))
51 IMPLIBS = $(addprefix lib,$(subst .def,.a,$(DEF_FILES)))
52 MIMPLIBS = $(addprefix lib,$(subst .mri,.a,$(MRI_FILES)))
53
54 EXTRA_LIBS = libuuid.a libscrnsave.a libscrnsavw.a liblargeint.a
55
56 LIBS = $(IMPLIBS) $(MIMPLIBS) $(EXTRA_LIBS)
57 UUID_OBJS = mshtml-uuid.o msxml-uuid.o unknwn-uuid.o \
58                         servprov-uuid.o oleidl-uuid.o oleacc-uuid.o ocidl-uuid.o \
59                         objsafe-uuid.o oaidl-uuid.o docobj-uuid.o comcat-uuid.o \
60                         exdisp-uuid.o mlang-uuid.o objidl-uuid.o cguid-uuid.o \
61                         olectlid-uuid.o ativscp-uuid.o urlmon-uuid.o hlink-uuid.o \
62                         hlguids-uuid.o extras-uuid.o devguid.o power-uuid.o
63 EXTRA_OBJS = shell32.o scrnsave.o scrnsavw.o largeint.o gdiplus.o \
64         $(UUID_OBJS) ws2_32.o
65 UUID_SOURCES = mshtml-uuid.c msxml-uuid.c unknwn-uuid.c \
66                            servprov-uuid.c oleidl-uuid.c oleacc-uuid.c ocidl-uuid.c \
67                            objsafe-uuid.c oaidl-uuid.c docobj-uuid.c comcat-uuid.c \
68                            exdisp-uuid.c mlang-uuid.c objidl-uuid.c cguid-uuid.c \
69                            olectlid-uuid.c ativscp-uuid.c urlmon-uuid.c hlink-uuid.c \
70                            hlguids-uuid.c extras-uuid.c devguid.c power-uuid.c
71 SOURCES = scrnsave.c shell32.c  largeint.c gdiplus.c $(UUID_SOURCES) \
72 res.rc test.c ws2_32.c
73
74 DISTFILES = Makefile.in $(DEF_FILES) $(MRI_FILES) $(SOURCES)
75
76 .NOTPARALLEL:
77
78 # Targets: (note that 'all-default' is a redirection from 'all',
79 # which is the primary default target identified in the included
80 # common makefile fragment, ${top_builddir}/Makefile.comm
81 #
82 all-default: $(EXTRA_OBJS) $(LIBS) ddk directx
83
84 %-subdirs:
85         for dir in $(SUBDIRS); do \
86           $(MAKE) -C $$dir $*; \
87         done
88
89 ddk:
90         $(MAKE) -C $@
91
92 directx:
93         $(MAKE) -C $@
94
95 TEST_OPTIONS = $(ALL_CFLAGS) -DWINVER=0x0666  \
96         -Wall -pedantic -Wsystem-headers -c $(srcdir)/test.c -o test.o
97 .PHONY: test ddk directx
98 test:
99         @echo "Testing w32api..."
100         @for lang in c c++ objective-c ; do \
101           echo "$$lang..."; \
102           $(CC) -x$$lang $(TEST_OPTIONS); \
103           echo "$$lang UNICODE..."; \
104           $(CC) -x$$lang -DUNICODE $(TEST_OPTIONS); \
105         done
106         @echo "windres..."
107         $(WINDRES) --include-dir $(INCDIR) -i ${srcdir}/res.rc -o test.o
108         @echo "windres UNICODE..."
109         $(WINDRES) --define UNICODE --include-dir $(INCDIR) -i ${srcdir}/res.rc -o test.o
110         rm -f test.o
111
112 scrnsavw.o: scrnsave.c
113         $(CC) -c $(ALL_CFLAGS) -DUNICODE -o $@ $<
114
115 # Rules
116 #
117 libuuid.a: $(UUID_OBJS)
118         $(AR) rc $@ $(UUID_OBJS)
119         $(RANLIB) $@
120
121 # libvfw32.a contains import stubs for 3 dll's.  Using an MRI script
122 # seems to be the simplest way to combine them into one archive.
123 #
124 # NB: With older dlltool, the object file members will not have
125 #     unique names.
126 #
127 libvfw32.a: vfw32.mri libmsvfw32.a libavifil32.a libavicap32.a
128         rm -f $@
129         $(AR) -M < ${word 1,$^}
130         $(RANLIB) $@
131
132 .PHONY: install install-libraries install-headers install-ddk
133 # Install headers and libraries in a target specified directory.
134 #
135 install: install-libraries install-headers install-ddk install-directx
136
137 install-libraries: all $(need-DESTDIR-compatibility)
138         $(mkinstalldirs) $(DESTDIR)$(inst_libdir)
139         for file in $(LIBS); do \
140           $(INSTALL_DATA) $$file $(DESTDIR)$(inst_libdir)/$$file ; \
141         done
142
143 install-headers: $(need-DESTDIR-compatibility)
144         $(mkinstalldirs) $(DESTDIR)$(inst_includedir)
145         for file in $(HEADERS); do \
146           $(INSTALL_DATA) $(srcdir)/../include/$$file $(DESTDIR)$(inst_includedir)/$$file ; \
147         done
148         $(mkinstalldirs) $(DESTDIR)$(inst_includedir)/GL
149         for file in $(GL_HEADERS); do \
150           $(INSTALL_DATA) $(srcdir)/../include/GL/$$file $(DESTDIR)$(inst_includedir)/GL/$$file ; \
151         done
152         $(mkinstalldirs) $(DESTDIR)$(inst_includedir)/gdiplus
153         for file in $(GDIPLUS_HEADERS); do \
154           $(INSTALL_DATA) $(srcdir)/../include/gdiplus/$$file $(DESTDIR)$(inst_includedir)/gdiplus/$$file ; \
155         done
156
157 install-ddk: install-libraries install-headers
158         cd ddk && $(MAKE) install
159
160 install-directx: install-libraries install-headers
161         cd directx && $(MAKE) install
162
163 # Uninstall headers and libraries from a target specified directory
164 #
165 uninstall: uninstall-ddk uninstall-directx uninstall-libraries uninstall-headers
166
167 uninstall-libraries: $(need-DESTDIR-compatibility)
168         for file in $(LIBS); do \
169           rm -f $(DESTDIR)$(inst_libdir)/$$file ; \
170         done
171         rmdir $(DESTDIR)$(inst_libdir)
172
173 uninstall-headers: $(need-DESTDIR-compatibility)
174         for file in $(HEADERS); do \
175           rm -r $(DESTDIR)$(inst_includedir)/$$file ; \
176         done
177         rmdir $(DESTDIR)$(inst_includedir)
178
179 uninstall-ddk:
180         cd ddk && $(MAKE) uninstall
181
182 uninstall-directx:
183         cd directx && $(MAKE) uninstall
184
185 dist:
186         mkdir $(distdir)/include
187         chmod 755 $(distdir)/include
188         for file in $(HEADERS); do \
189           cp -p $(srcdir)/../include/$$file $(distdir)/include/$$file ; \
190         done
191         mkdir $(distdir)/include/GL
192         for file in $(GL_HEADERS); do \
193           cp -p $(srcdir)/../include/GL/$$file $(distdir)/include/GL/$$file ; \
194         done
195         mkdir $(distdir)/include/gdiplus
196         for file in $(GDIPLUS_HEADERS); do \
197           cp -p $(srcdir)/../include/gdiplus/$$file $(distdir)/include/gdiplus/$$file ; \
198         done
199         mkdir $(distdir)/lib
200         chmod 755 $(distdir)/lib
201         for file in $(DISTFILES); do \
202           cp -p $(srcdir)/$$file $(distdir)/lib/$$file ; \
203         done
204         for dir in $(SUBDIRS); do \
205           (cd $$dir; $(MAKE) distdir=../$(distdir) dist); \
206         done
207
208 Makefile: Makefile.in ../config.status ../configure
209         cd ..; $(SHELL) config.status
210
211 # Makefile.in: end of file