gdi32: Don't truncate the added pixels with FT_LCD_FILTER_DEFAULT.
[wine/wine64.git] / Make.rules.in
blobd49d2a36446f0585f616d52058d5fa793f565eac
1 # Global rules shared by all makefiles     -*-Makefile-*-
3 # Each individual makefile must define the following variables:
4 # TOPSRCDIR    : top-level source directory
5 # TOPOBJDIR    : top-level object directory
6 # SRCDIR       : source directory for this module
7 # MODULE       : name of the module being built
9 # Each individual makefile may define the following additional variables:
10 # C_SRCS       : C sources for the module
11 # C_SRCS16     : 16-bit C sources for the module
12 # RC_SRCS      : resource source files
13 # EXTRA_SRCS   : extra source files for make depend
14 # EXTRA_OBJS   : extra object files
15 # IMPORTS      : dlls to import
16 # DELAYIMPORTS : dlls to import in delayed mode
17 # SUBDIRS      : subdirectories that contain a Makefile
18 # EXTRASUBDIRS : subdirectories that do not contain a Makefile
19 # INSTALLSUBDIRS : subdirectories to run make install/uninstall into
20 # MODCFLAGS    : extra CFLAGS for this module
22 # First some useful definitions
24 SHELL     = /bin/sh
25 CC        = @CC@
26 CFLAGS    = @CFLAGS@
27 CPPFLAGS  = @CPPFLAGS@
28 LIBS      = @LIBS@
29 BISON     = @BISON@
30 FLEX      = @FLEX@
31 EXEEXT    = @EXEEXT@
32 OBJEXT    = @OBJEXT@
33 LIBEXT    = @LIBEXT@
34 DLLEXT    = @DLLEXT@
35 IMPLIBEXT = @IMPLIBEXT@
36 LDSHARED  = @LDSHARED@
37 DLLTOOL   = @DLLTOOL@
38 DLLWRAP   = @DLLWRAP@
39 AR        = @AR@
40 ARFLAGS   = @ARFLAGS@
41 RANLIB    = @RANLIB@
42 STRIP     = @STRIP@
43 WINDRES   = @WINDRES@
44 LN        = @LN@
45 LN_S      = @LN_S@
46 TOOLSDIR  = @TOOLSDIR@
47 AS        = @AS@
48 LD        = @LD@
49 NM        = @NM@
50 LDFLAGS   = @LDFLAGS@
51 PRELINK   = @PRELINK@
52 RM        = rm -f
53 MV        = mv
54 LINT      = @LINT@
55 LINTFLAGS = @LINTFLAGS@
56 FONTFORGE = @FONTFORGE@
57 RSVG      = @RSVG@
58 ICOTOOL   = @ICOTOOL@
59 INCLUDES     = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include $(EXTRAINCL)
60 EXTRACFLAGS  = @EXTRACFLAGS@
61 ALLCFLAGS    = $(INCLUDES) $(DEFS) $(DLLFLAGS) $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS) $(MODCFLAGS)
62 ALLLINTFLAGS = $(INCLUDES) $(DEFS) $(LINTFLAGS)
63 IDLFLAGS     = $(INCLUDES) $(DEFS) $(EXTRAIDLFLAGS)
64 WINEBUILDFLAGS = $(DLLFLAGS) --as-cmd "$(AS)"
65 MKINSTALLDIRS= $(TOPSRCDIR)/tools/mkinstalldirs -m 755
66 WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi/winapi_check
67 WINEWRAPPER  = $(TOPSRCDIR)/tools/winewrapper
68 C2MAN        = $(TOPSRCDIR)/tools/c2man.pl
69 RUNTEST      = $(TOPSRCDIR)/tools/runtest
70 WINEBUILD    = $(TOOLSDIR)/tools/winebuild/winebuild
71 MAKEDEP      = $(TOOLSDIR)/tools/makedep
72 MAKECTESTS   = $(TOOLSDIR)/tools/make_ctests
73 WRC          = $(TOOLSDIR)/tools/wrc/wrc
74 WMC          = $(TOOLSDIR)/tools/wmc/wmc
75 WIDL         = $(TOOLSDIR)/tools/widl/widl
76 WINEGCC      = $(TOOLSDIR)/tools/winegcc/winegcc
77 RELPATH      = $(TOOLSDIR)/tools/relpath
78 SFNT2FNT     = $(TOOLSDIR)/tools/sfnt2fnt
79 FNT2FON      = $(TOOLSDIR)/tools/fnt2fon
80 RC           = $(WRC)
81 RC16         = $(WRC)
82 RCFLAGS      = --nostdinc $(INCLUDES) $(DEFS) $(EXTRARCFLAGS)
83 RC16FLAGS    = -O res16 $(RCFLAGS)
84 LDPATH       = @LDPATH@
85 DLLDIR       = $(TOPOBJDIR)/dlls
86 LIBPORT      = $(TOPOBJDIR)/libs/port/libwine_port.a
87 LIBWPP       = $(TOPOBJDIR)/libs/wpp/libwpp.a
88 LIBWINE      = -L$(TOPOBJDIR)/libs/wine -lwine
89 LDRPATH_INSTALL = @LDRPATH_INSTALL@
90 LDRPATH_LOCAL   = @LDRPATH_LOCAL@
92 @SET_MAKE@
94 # Installation infos
96 INSTALL         = @INSTALL@ $(INSTALL_FLAGS)
97 INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(INSTALL_PROGRAM_FLAGS)
98 INSTALL_SCRIPT  = @INSTALL_SCRIPT@ $(INSTALL_SCRIPT_FLAGS)
99 INSTALL_DATA    = @INSTALL_DATA@ $(INSTALL_DATA_FLAGS)
100 prefix          = @prefix@
101 exec_prefix     = @exec_prefix@
102 bindir          = @bindir@
103 libdir          = @libdir@
104 datarootdir     = @datarootdir@
105 datadir         = @datadir@
106 infodir         = @infodir@
107 mandir          = @mandir@
108 sysconfdir      = @sysconfdir@
109 includedir      = @includedir@/wine
110 dlldir          = @libdir@/wine
111 prog_manext     = 1
112 api_manext      = 3w
113 conf_manext     = 5
114 CLEAN_FILES     = *.o *.a *.so *.ln *.res *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej *.flc core
116 IDL_GEN_C_SRCS  = $(IDL_C_SRCS:.idl=_c.c) $(IDL_I_SRCS:.idl=_i.c) \
117                   $(IDL_P_SRCS:.idl=_p.c) $(IDL_S_SRCS:.idl=_s.c)
118 IDL_GEN_HEADERS = $(IDL_H_SRCS:.idl=.h) $(IDL_C_SRCS:.idl=.h) $(IDL_I_SRCS:.idl=.h) \
119                   $(IDL_P_SRCS:.idl=.h) $(IDL_S_SRCS:.idl=.h)
121 CLEAN_TARGETS = $(IDL_GEN_C_SRCS) $(IDL_GEN_HEADERS) $(IDL_TLB_SRCS:.idl=.tlb) $(IDL_P_SRCS:%=dlldata.c) \
122                 $(BISON_SRCS:.y=.tab.c) $(BISON_SRCS:.y=.tab.h) $(LEX_SRCS:.l=.yy.c) $(MC_SRCS:.mc=.mc.rc)
124 OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) $(IDL_GEN_C_SRCS:.c=.o) $(EXTRA_OBJS)
126 RCOBJS = $(RC_SRCS:.rc=.res.o)
127 LINTS  = $(C_SRCS:.c=.ln)
129 # 'all' target first in case the enclosing Makefile didn't define any target
131 all:
133 filter: dummy
134         @$(TOPSRCDIR)/tools/winapi/make_filter --make $(MAKE) all
136 .PHONY: all filter
138 # Implicit rules
140 .SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.o .idl .tlb .h .y .l .tab.c .tab.h .yy.c .ok .man.in .man _c.c _i.c _p.c _s.c @MAINTAINER_MODE@ .sfd .ttf .svg .ico
142 .c.o:
143         $(CC) -c $(ALLCFLAGS) -o $@ $<
145 .s.o:
146         $(AS) -o $@ $<
148 .y.tab.c:
149         $(BISON) $(BISONFLAGS) -p $*_ -o $@ $<
151 .y.tab.h:
152         $(BISON) $(BISONFLAGS) -p $*_ -o $*.tab.c -d $<
154 .l.yy.c:
155         $(FLEX) $(LEXFLAGS) -o$@ $<
157 .mc.mc.rc:
158         $(LDPATH) $(WMC) -i -U -H /dev/null -o $@ $<
160 .rc.res:
161         $(LDPATH) $(RC) $(RCFLAGS) -fo$@ $<
163 .res.res.o:
164         $(WINDRES) -i $< -o $@
166 .spec.spec.o:
167         $(WINEBUILD) $(WINEBUILDFLAGS) --dll -o $@ --main-module $(MODULE) --export $<
169 .idl.h:
170         $(WIDL) $(IDLFLAGS) -h -H $@ $<
172 .idl_c.c:
173         $(WIDL) $(IDLFLAGS) -c -C $@ $<
175 .idl_i.c:
176         $(WIDL) $(IDLFLAGS) -u -U $@ $<
178 .idl_p.c:
179         $(WIDL) $(IDLFLAGS) -p -P $@ $<
181 .idl_s.c:
182         $(WIDL) $(IDLFLAGS) -s -S $@ $<
184 .idl.tlb:
185         $(WIDL) $(IDLFLAGS) -t -T $@ $<
187 .c.ln:
188         $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
190 .c.ok:
191         $(RUNTEST) $(RUNTESTFLAGS) $< && touch $@
193 .sfd.ttf:
194         $(FONTFORGE) -script $(TOPSRCDIR)/fonts/genttf.ff $< $@
196 .man.in.man:
197         LC_ALL=C sed -e 's,@bindir\@,$(bindir),g' -e 's,@dlldir\@,$(dlldir),g' -e 's,@PACKAGE_STRING\@,@PACKAGE_STRING@,g' $< >$@ || ($(RM) $@ && false)
199 .svg.ico:
200         $(RSVG) -w 16 -h 16 -f png $< $*-16.png
201         $(RSVG) -w 32 -h 32 -f png $< $*-32.png
202         $(RSVG) -w 48 -h 48 -f png $< $*-48.png
203         $(ICOTOOL) -c -o $@ $*-16.png $*-32.png $*-48.png
204         $(RM) $*-16.png $*-32.png $*-48.png
206 # Rules for IDL files
208 dlldata.c: $(WIDL) Makefile.in
209         $(WIDL) $(IDLFLAGS) --dlldata-only --dlldata=$@ $(IDL_P_SRCS)
211 # Rule for linting
213 $(MODULE).ln : $(LINTS)
214         if test "$(LINTS)" ; \
215         then \
216                 $(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
217                 $(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
218         else \
219                 $(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
220         fi
222 lint:: $(MODULE).ln
224 # Rules for Windows API checking
226 winapi_check:: dummy
227         $(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
229 .PHONY: winapi_check
231 # Rules for dependencies
233 DEPEND_SRCS = $(C_SRCS) $(C_SRCS16) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) \
234               $(IDL_H_SRCS) $(IDL_C_SRCS) $(IDL_I_SRCS) $(IDL_P_SRCS) $(IDL_S_SRCS) \
235               $(IDL_GEN_C_SRCS) $(IDL_TLB_SRCS) $(IDL_TLB_SRCS:.idl=.tlb) \
236               $(BISON_SRCS) $(LEX_SRCS) $(EXTRA_SRCS)
238 $(SUBDIRS:%=%/__depend__): dummy
239         @cd `dirname $@` && $(MAKE) depend
241 depend: $(SUBDIRS:%=%/__depend__) dummy
242         $(MAKEDEP) -C$(SRCDIR) -S$(TOPSRCDIR) -T$(TOPOBJDIR) $(EXTRAINCL) $(DEPEND_SRCS)
244 .PHONY: depend $(SUBDIRS:%=%/__depend__)
246 # Rules for cleaning
248 $(SUBDIRS:%=%/__clean__): dummy
249         @cd `dirname $@` && $(MAKE) clean
251 $(EXTRASUBDIRS:%=%/__clean__): dummy
252         -cd `dirname $@` && $(RM) $(CLEAN_FILES)
254 clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
255         $(RM) $(CLEAN_FILES) $(CLEAN_TARGETS) $(PROGRAMS) $(MANPAGES)
257 .PHONY: clean $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
259 # Rules for installing
261 $(SUBDIRS:%=%/__install__): dummy
262         @cd `dirname $@` && $(MAKE) install
264 $(SUBDIRS:%=%/__install-lib__): dummy
265         @cd `dirname $@` && $(MAKE) install-lib
267 $(SUBDIRS:%=%/__install-dev__): dummy
268         @cd `dirname $@` && $(MAKE) install-dev
270 $(SUBDIRS:%=%/__uninstall__): dummy
271         @cd `dirname $@` && $(MAKE) uninstall
273 install:: $(INSTALLSUBDIRS:%=%/__install__)
274 install-lib:: $(INSTALLSUBDIRS:%=%/__install-lib__)
275 install-dev:: $(INSTALLSUBDIRS:%=%/__install-dev__)
276 uninstall:: $(INSTALLSUBDIRS:%=%/__uninstall__)
278 $(INSTALLDIRS):
279         $(MKINSTALLDIRS) $@
281 .PHONY: install install-lib install-dev uninstall \
282         $(SUBDIRS:%=%/__install__) $(SUBDIRS:%=%/__uninstall__) \
283         $(SUBDIRS:%=%/__install-lib__) $(SUBDIRS:%=%/__install-dev__)
285 # Rules for testing
287 $(TESTSUBDIRS:%=%/__test__): dummy
288         @cd `dirname $@` && $(MAKE) test
290 $(TESTSUBDIRS:%=%/__crosstest__): dummy
291         @cd `dirname $@` && $(MAKE) crosstest
293 $(TESTSUBDIRS:%=%/__testclean__): dummy
294         @cd `dirname $@` && $(MAKE) testclean
296 check test:: $(TESTSUBDIRS:%=%/__test__)
298 crosstest:: $(TESTSUBDIRS:%=%/__crosstest__)
300 testclean:: $(TESTSUBDIRS:%=%/__testclean__)
302 .PHONY: check test testclean crosstest $(TESTSUBDIRS:%=%/__test__) $(TESTSUBDIRS:%=%/__crosstest__) $(TESTSUBDIRS:%=%/__testclean__) 
304 # Rules for auto documentation
306 $(DOCSUBDIRS:%=%/__man__): dummy
307         @cd `dirname $@` && $(MAKE) man
309 $(DOCSUBDIRS:%=%/__doc_html__): dummy
310         @cd `dirname $@` && $(MAKE) doc-html
312 $(DOCSUBDIRS:%=%/__doc_sgml__): dummy
313         @cd `dirname $@` && $(MAKE) doc-sgml
315 man: $(DOCSUBDIRS:%=%/__man__)
316 doc-html: $(DOCSUBDIRS:%=%/__doc_html__)
317 doc-sgml: $(DOCSUBDIRS:%=%/__doc_sgml__)
319 .PHONY: man doc-html doc-sgml $(DOCSUBDIRS:%=%/__man__) $(DOCSUBDIRS:%=%/__doc_html__) $(DOCSUBDIRS:%=%/__doc_sgml__)
321 # Misc. rules
323 $(MC_SRCS:.mc=.mc.rc): $(WMC)
325 $(IDL_GEN_HEADERS) $(IDL_GEN_C_SRCS) $(IDL_TLB_SRCS:.idl=.tlb): $(WIDL)
327 $(RC_SRCS:.rc=.res) $(RC_SRCS16:.rc=.res): $(WRC)
329 $(SUBDIRS): dummy
330         @cd $@ && $(MAKE)
332 dummy:
334 .PHONY: dummy $(SUBDIRS)
336 # End of global rules