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 |
|
---|
13 | SHELL = @SHELL@
|
---|
14 |
|
---|
15 | srcdir = @srcdir@
|
---|
16 | VPATH = @srcdir@
|
---|
17 |
|
---|
18 | SUBDIRS := ddk directx
|
---|
19 | subdirs := ddk directx
|
---|
20 |
|
---|
21 | host_alias = @host@
|
---|
22 | build_alias = @build@
|
---|
23 | target_alias = @target@
|
---|
24 | prefix = @prefix@
|
---|
25 | includedir:=@includedir@
|
---|
26 |
|
---|
27 | program_transform_name = @program_transform_name@
|
---|
28 | exec_prefix = @exec_prefix@
|
---|
29 | libdir:=@libdir@
|
---|
30 | bindir = @bindir@
|
---|
31 | ifeq ($(target_alias),$(host_alias))
|
---|
32 | ifeq ($(build_alias),$(host_alias))
|
---|
33 | tooldir:=$(exec_prefix)
|
---|
34 | else
|
---|
35 | tooldir:=$(exec_prefix)/$(target_alias)
|
---|
36 | endif
|
---|
37 | else
|
---|
38 | tooldir:=$(exec_prefix)/$(target_alias)
|
---|
39 | endif
|
---|
40 | datadir = @datadir@
|
---|
41 | infodir = @infodir@
|
---|
42 | ifneq (,$(findstring cygwin,$(target_alias)))
|
---|
43 | inst_includedir:=$(tooldir)/include/w32api
|
---|
44 | inst_libdir:=$(tooldir)/lib/w32api
|
---|
45 | else
|
---|
46 | inst_includedir:=$(includedir)
|
---|
47 | inst_libdir:=$(libdir)
|
---|
48 | endif
|
---|
49 |
|
---|
50 | INSTALL = @INSTALL@
|
---|
51 | INSTALL_DATA = @INSTALL_DATA@
|
---|
52 | INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
---|
53 | mkinstalldirs = mkdir -p
|
---|
54 |
|
---|
55 | CC = @CC@
|
---|
56 | CC_FOR_TARGET = $(CC)
|
---|
57 |
|
---|
58 | DLLTOOL = @DLLTOOL@
|
---|
59 | DLLTOOL_FLAGS = --as=$(AS) -k
|
---|
60 | AS = @AS@
|
---|
61 | AS_FOR_TARGET = $(AS_FOR_TARGET)
|
---|
62 | WINDRES = @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.
|
---|
67 | BUILDENV = @BUILDENV@
|
---|
68 |
|
---|
69 | ifeq ($(BUILDENV), cygwin)
|
---|
70 | # winsup/include
|
---|
71 | # winsup/../newlib/libc/include
|
---|
72 | # winsup/../newlib/libc/sys/cygwin
|
---|
73 | EXTRA_INCLUDES = -I$(srcdir)/../../include -I$(srcdir)/../../../newlib/libc/include -I$(srcdir)/../../../newlib/libc/sys/cygwin
|
---|
74 | endif
|
---|
75 | ifeq ($(BUILDENV), mingw)
|
---|
76 | EXTRA_INCLUDES = -I$(srcdir)/../../mingw/include
|
---|
77 | endif
|
---|
78 |
|
---|
79 | INCLUDES = -I$(srcdir)/../include $(EXTRA_INCLUDES)
|
---|
80 |
|
---|
81 | CFLAGS = @CFLAGS@
|
---|
82 | ALL_CFLAGS = $(CFLAGS) $(INCLUDES)
|
---|
83 |
|
---|
84 | RANLIB = @RANLIB@
|
---|
85 | AR = @AR@
|
---|
86 | LD = @LD@
|
---|
87 |
|
---|
88 | FLAGS_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 |
|
---|
107 | HEADERS = $(notdir $(wildcard $(srcdir)/../include/*.h))
|
---|
108 | GL_HEADERS = $(notdir $(wildcard $(srcdir)/../include/GL/*.h))
|
---|
109 |
|
---|
110 | # libraries
|
---|
111 |
|
---|
112 | DEF_FILES = $(notdir $(wildcard $(srcdir)/*.def))
|
---|
113 | MRI_FILES = $(notdir $(wildcard $(srcdir)/*.mri))
|
---|
114 | IMPLIBS = $(addprefix lib,$(subst .def,.a,$(DEF_FILES)))
|
---|
115 | MIMPLIBS = $(addprefix lib,$(subst .mri,.a,$(MRI_FILES)))
|
---|
116 | EXTRA_LIBS=libuuid.a libscrnsave.a libscrnsavw.a liblargeint.a
|
---|
117 | LIBS = $(IMPLIBS) $(MIMPLIBS) $(EXTRA_LIBS)
|
---|
118 | UUID_OBJS = uuid.o mshtml-uuid.o msxml-uuid.o
|
---|
119 | EXTRA_OBJS = shell32.o scrnsave.o scrnsavw.o largeint.o \
|
---|
120 | $(UUID_OBJS) kernel32.o ws2_32.o
|
---|
121 | UUID_SOURCES = uuid.c mshtml-uuid.c msxml-uuid.c
|
---|
122 | SOURCES = scrnsave.c shell32.c largeint.c $(UUID_SOURCES)\
|
---|
123 | res.rc test.c kernel32.c ws2_32.c
|
---|
124 |
|
---|
125 | DISTFILES = Makefile.in $(DEF_FILES) $(MRI_FILES) $(SOURCES)
|
---|
126 |
|
---|
127 | .NOTPARALLEL:
|
---|
128 |
|
---|
129 | # targets
|
---|
130 | all: $(LIBS) $(EXTRA_OBJS) ddk directx
|
---|
131 |
|
---|
132 | %-subdirs:
|
---|
133 | for i in $(SUBDIRS); do \
|
---|
134 | $(MAKE) $(FLAGS_TO_PASS) -C $$i $*; \
|
---|
135 | done
|
---|
136 |
|
---|
137 | ddk:
|
---|
138 | $(MAKE) $(FLAGS_TO_PASS) -C $@
|
---|
139 |
|
---|
140 | directx:
|
---|
141 | $(MAKE) $(FLAGS_TO_PASS) -C $@
|
---|
142 |
|
---|
143 | TEST_OPTIONS = $(ALL_CFLAGS) -DWINVER=0x0666 \
|
---|
144 | -Wall -pedantic -Wsystem-headers -c $(srcdir)/test.c -o test.o
|
---|
145 | .PHONY: test ddk directx
|
---|
146 | test:
|
---|
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 |
|
---|
160 | scrnsavw.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 |
|
---|
170 | libuuid.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.
|
---|
178 | libvfw32.a : vfw32.mri libmsvfw32.a libavifil32.a libavicap32.a
|
---|
179 | rm -f $@
|
---|
180 | $(AR) -M < ${word 1,$^}
|
---|
181 | $(RANLIB) $@
|
---|
182 |
|
---|
183 | lib%.a : %.def %.o
|
---|
184 | $(DLLTOOL) $(DLLTOOL_FLAGS) --output-lib $@ --def $(srcdir)/$*.def
|
---|
185 | $(AR) r $@ $*.o
|
---|
186 | $(RANLIB) $@
|
---|
187 |
|
---|
188 | lib%.a: %.def
|
---|
189 | $(DLLTOOL) $(DLLTOOL_FLAGS) --output-lib $@ --def $<
|
---|
190 |
|
---|
191 | lib%.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.
|
---|
197 | install: install-libraries install-headers install-ddk install-directx
|
---|
198 |
|
---|
199 | install-libraries: all
|
---|
200 | $(mkinstalldirs) $(inst_libdir)
|
---|
201 | for i in $(LIBS); do \
|
---|
202 | $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \
|
---|
203 | done
|
---|
204 |
|
---|
205 | install-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 |
|
---|
215 | install-ddk: install-libraries install-headers
|
---|
216 | cd ddk && $(MAKE) install $(FLAGS_TO_PASS)
|
---|
217 |
|
---|
218 | install-directx: install-libraries install-headers
|
---|
219 | cd directx && $(MAKE) install $(FLAGS_TO_PASS)
|
---|
220 |
|
---|
221 | # uninstall headers and libraries from a target specified directory
|
---|
222 | uninstall: uninstall-ddk uninstall-directx uninstall-libraries uninstall-headers
|
---|
223 |
|
---|
224 | uninstall-libraries:
|
---|
225 | @for i in $(LIBS); do \
|
---|
226 | rm -f $(inst_libdir)/$$i ; \
|
---|
227 | done
|
---|
228 | rmdir $(inst_libdir)
|
---|
229 |
|
---|
230 | uninstall-headers:
|
---|
231 | @for i in $(HEADERS); do \
|
---|
232 | rm -r $(inst_includedir)/$$i ; \
|
---|
233 | done
|
---|
234 | rmdir $(inst_includedir)
|
---|
235 |
|
---|
236 | uninstall-ddk:
|
---|
237 | cd ddk && $(MAKE) -C uninstall $(FLAGS_TO_PASS)
|
---|
238 |
|
---|
239 | uninstall-directx:
|
---|
240 | cd directx && $(MAKE) -C uninstall $(FLAGS_TO_PASS)
|
---|
241 |
|
---|
242 | dist:
|
---|
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 |
|
---|
261 | Makefile: Makefile.in ../config.status ../configure
|
---|
262 | cd ..; $(SHELL) config.status
|
---|
263 |
|
---|
264 | # clean
|
---|
265 |
|
---|
266 | mostlyclean:
|
---|
267 | rm -f *~ *.o *.s
|
---|
268 |
|
---|
269 | clean:
|
---|
270 | rm -f *.o *.a *.s *~
|
---|
271 |
|
---|
272 | distclean: clean
|
---|
273 | rm -f config.cache config.status config.log Makefile
|
---|
274 |
|
---|
275 | maintainer-clean: distclean
|
---|
276 |
|
---|