- Eliminate extra background fills.
[wine/wine-kai.git] / Make.rules.in
blob554b4fc38d883f87f6e513382c421393e867a3bb
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 # ASM_SRCS     : assembly sources
12 # GEN_C_SRCS   : generated C files
13 # GEN_ASM_SRCS : generated assembly sources
14 # RC_SRCS      : resource source files
15 # SPEC_SRCS    : interface definition files
16 # EXTRA_SRCS   : extra source files for make depend
17 # EXTRA_OBJS   : extra object files
18 # IMPORTS      : dlls to import
19 # DELAYIMPORTS : dlls to import in delayed mode
20 # SUBDIRS      : subdirectories that contain a Makefile
21 # EXTRASUBDIRS : subdirectories that do not contain a Makefile
22 # INSTALLSUBDIRS : subdirectories to run make install/uninstall into
24 # First some useful definitions
26 SHELL     = /bin/sh
27 CC        = @CC@
28 CPP       = @CPP@
29 CFLAGS    = @CFLAGS@ $(EXTRACFLAGS)
30 OPTIONS   = @OPTIONS@ -D_REENTRANT
31 X_CFLAGS  = @X_CFLAGS@
32 X_LIBS    = @X_LIBS@
33 XLIB      = @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@
34 LIBS      = @LIBS@
35 YACC      = @YACC@
36 LEX       = @LEX@
37 LEXLIB    = @LEXLIB@
38 EXEEXT    = @EXEEXT@
39 OBJEXT    = @OBJEXT@
40 LIBEXT    = @LIBEXT@
41 DLLEXT    = @DLLEXT@
42 CROSSCC   = @CROSSCC@
43 LDSHARED  = @LDSHARED@
44 DLLWRAP   = @DLLWRAP@
45 DLLWRAPFLAGS = --add-stdcall-alias
46 AR        = @AR@ rc
47 RANLIB    = @RANLIB@
48 STRIP     = @STRIP@
49 WINDRES   = @WINDRES@
50 LN        = @LN@
51 LN_S      = @LN_S@
52 TOOLSDIR  = @TOOLSDIR@
53 DIVINCL   = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include $(EXTRAINCL)
54 ALLCFLAGS = $(DIVINCL) $(CFLAGS) $(DEFS) $(OPTIONS) $(X_CFLAGS)
55 LD        = @LD@
56 LDFLAGS   = @LDFLAGS@
57 LDCOMBINE = $(LD) -r
58 RM        = rm -f
59 MV        = mv
60 C2MAN     = @C2MAN@
61 MANSPECS  = -w $(TOPSRCDIR)/dlls/gdi/gdi32.spec \
62             -w $(TOPSRCDIR)/dlls/user/user32.spec \
63             -w $(TOPSRCDIR)/dlls/comctl32/comctl32.spec \
64             -w $(TOPSRCDIR)/dlls/commdlg/comdlg32.spec \
65             -w $(TOPSRCDIR)/dlls/kernel/kernel32.spec
66 LINT      = @LINT@
67 LINTFLAGS = @LINTFLAGS@
68 ALLLINTFLAGS = $(LINTFLAGS) $(DEFS) $(OPTIONS) $(DIVINCL)
69 MKINSTALLDIRS= $(TOPSRCDIR)/tools/mkinstalldirs
70 WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi_check/winapi_check
71 WINEWRAPPER  = $(TOPSRCDIR)/tools/winewrapper
72 RUNTEST      = $(TOPSRCDIR)/programs/winetest/runtest
73 WINEBUILD    = $(TOOLSDIR)/tools/winebuild/winebuild
74 MAKEDEP      = $(TOOLSDIR)/tools/makedep
75 WRC          = $(TOOLSDIR)/tools/wrc/wrc
76 WMC          = $(TOOLSDIR)/tools/wmc/wmc
77 LDPATH    = @LDPATH@
78 DLLDIR    = $(TOPOBJDIR)/dlls
79 LIBWINE   = -L$(TOPOBJDIR)/library -lwine
80 LIBUNICODE= -L$(TOPOBJDIR)/unicode -lwine_unicode
81 LIBUUID   = -L$(TOPOBJDIR)/ole -lwine_uuid
83 @SET_MAKE@
85 # Installation infos
87 INSTALL         = @INSTALL@ $(INSTALL_FLAGS)
88 INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(INSTALL_PROGRAM_FLAGS)
89 INSTALL_SCRIPT  = @INSTALL_SCRIPT@ $(INSTALL_SCRIPT_FLAGS)
90 INSTALL_DATA    = @INSTALL_DATA@ $(INSTALL_DATA_FLAGS)
91 prefix          = @prefix@
92 exec_prefix     = @exec_prefix@
93 bindir          = @bindir@
94 libdir          = @libdir@
95 datadir         = @datadir@
96 infodir         = @infodir@
97 mandir          = @mandir@
98 sysconfdir      = @sysconfdir@
99 includedir      = @includedir@/wine
100 dlldir          = @libdir@/wine
101 prog_manext     = 1
102 conf_manext     = 5
103 CLEAN_FILES     = *.o *.a *.so *.ln *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \
104                   *.flc *.spec.c *.spec.def *.glue.c *.dbg.c y.tab.c y.tab.h @LEX_OUTPUT_ROOT@.c core
106 OBJS = $(C_SRCS:.c=.o) $(GEN_C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) $(ASM_SRCS:.S=.o) $(EXTRA_OBJS)
108 RCOBJS = $(RC_SRCS:.rc=.res.o)
109 LINTS  = $(C_SRCS:.c=.ln)
111 # Implicit rules
113 .SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.c .spec.def .pl .ok .cross.o
115 .c.o:
116         $(CC) -c $(ALLCFLAGS) -o $@ $<
118 .c.cross.o:
119         $(CROSSCC) -c $(ALLCFLAGS) -o $@ $<
121 .s.o:
122         $(AS) -o $@ $<
124 .S.o:
125         $(CC) -c -o $@ $<
127 .mc.mc.rc:
128         $(LDPATH) $(WMC) -i -H /dev/null -o $@ $<
130 .rc.res:
131         $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -r $<
133 .res.res.o:
134         $(WINDRES) -i $< -o $@
136 .spec.spec.c:
137         $(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -M $(MODULE) -spec $<
139 .spec.spec.def:
140         $(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -def $<
142 .c.ln:
143         $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
145 .c.ok:
146         $(RUNTEST) $(RUNTESTFLAGS) $< && touch $@
148 .pl.ok:
149         $(RUNTEST) $(RUNTESTFLAGS) $< && touch $@
151 # 'all' target first in case the enclosing Makefile didn't define any target
153 all: Makefile
155 filter:
156         @$(TOPSRCDIR)/tools/winapi/make_filter --make $(MAKE) all
158 .PHONY: all filter
160 # Rule for main module debug channels
162 $(MODULE).dbg.c: $(C_SRCS) $(WINEBUILD)
163         $(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -debug -C$(SRCDIR) $(C_SRCS)
165 # Rule for 16-bit glue
167 $(MODULE).glue.c: $(C_SRCS) $(WINEBUILD)
168         $(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -glue -C$(SRCDIR) $(C_SRCS)
170 # Rule to rebuild the tools
172 $(MAKEDEP) $(WINEBUILD) $(WMC) $(WRC):
173         cd $(TOOLSDIR)/tools && $(MAKE) `basename $@`
175 # Rules for makefile
177 Makefile: Makefile.in $(TOPSRCDIR)/configure
178         @echo Makefile is older than $?, please rerun $(TOPSRCDIR)/configure
179         @exit 1
181 # Rules for auto documentation
183 $(SUBDIRS:%=%/__man__): dummy
184         cd `dirname $@` && $(MAKE) man
186 man: $(C_SRCS) $(SUBDIRS:%=%/__man__)
187         if [ -n "$(C_SRCS)" ]; then $(MKINSTALLDIRS) $(TOPOBJDIR)/documentation/man3w; for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/man3w -S3w $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done; fi
189 $(SUBDIRS:%=%/__doc_html__): dummy
190         cd `dirname $@` && $(MAKE) doc-html
192 doc-html: $(C_SRCS) $(SUBDIRS:%=%/__doc_html__)
193         if [ -n "$(C_SRCS)" ]; then $(MKINSTALLDIRS) $(TOPOBJDIR)/documentation/html; for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/html -Th -iwindows.h  $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done; fi
195 .PHONY: man doc-html $(SUBDIRS:%=%/__man__) $(SUBDIRS:%=%/__doc_html__)
197 # Rule for linting
199 $(MODULE).ln : $(LINTS)
200         if test "$(LINTS)" ; \
201         then \
202                 $(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
203                 $(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
204         else \
205                 $(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
206         fi
208 lint:: $(MODULE).ln
210 # Rules for Windows API checking
212 winapi_check:: dummy
213         $(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
215 .PHONY: winapi_check
217 # Rules for dependencies
219 $(SUBDIRS:%=%/__depend__): $(MAKEDEP) dummy
220         cd `dirname $@` && $(MAKE) depend
222 depend: $(MAKEDEP) $(SUBDIRS:%=%/__depend__)
223         $(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) $(EXTRA_SRCS)
225 .PHONY: depend $(SUBDIRS:%=%/__depend__)
227 # Rules for cleaning
229 $(SUBDIRS:%=%/__clean__): dummy
230         cd `dirname $@` && $(MAKE) clean
232 $(SUBDIRS:%=%/__testclean__): dummy
233         cd `dirname $@` && $(MAKE) testclean
235 $(EXTRASUBDIRS:%=%/__clean__): dummy
236         -cd `dirname $@` && $(RM) $(CLEAN_FILES)
238 testclean:: $(SUBDIRS:%=%/__testclean__)
240 clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
241         $(RM) $(CLEAN_FILES) $(GEN_C_SRCS) $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.res) $(RC_SRCS16:.rc=.res) $(MC_SRCS:.mc=.mc.rc) $(PROGRAMS)
243 .PHONY: clean testclean $(SUBDIRS:%=%/__clean__) $(SUBDIRS:%=%/__testclean__) $(EXTRASUBDIRS:%=%/__clean__)
245 # Rules for installing
247 $(INSTALLSUBDIRS:%=%/__install__): dummy
248         cd `dirname $@` && $(MAKE) install
250 $(INSTALLSUBDIRS:%=%/__uninstall__): dummy
251         cd `dirname $@` && $(MAKE) uninstall
253 install:: $(INSTALLSUBDIRS:%=%/__install__)
255 uninstall:: $(INSTALLSUBDIRS:%=%/__uninstall__)
257 .PHONY: install uninstall $(INSTALLSUBDIRS:%=%/__install__) $(INSTALLSUBDIRS:%=%/__uninstall__)
259 # Rules for checking that no imports are missing
261 $(SUBDIRS:%=%/__checklink__): dummy
262         @cd `dirname $@` && $(MAKE) checklink
264 .PHONY: checklink $(SUBDIRS:%=%/__checklink__)
266 # Rules for testing
268 $(SUBDIRS:%=%/__test__): dummy
269         @cd `dirname $@` && $(MAKE) test
271 $(SUBDIRS:%=%/__crosstest__): dummy
272         @cd `dirname $@` && $(MAKE) crosstest
274 .PHONY: check test crosstest $(SUBDIRS:%=%/__test__) $(SUBDIRS:%=%/__crosstest__)
276 # Misc. rules
278 $(SPEC_SRCS:.spec=.spec.c): $(WINEBUILD)
280 $(RC_SRCS:.rc=.res): $(WRC)
282 $(RC_SRCS16:.rc=.res): $(WRC)
284 $(MC_SRCS:.mc=.mc.rc): $(WMC)
286 $(SUBDIRS): dummy
287         @cd $@ && $(MAKE)
289 dummy:
291 .PHONY: dummy $(SUBDIRS)
293 # End of global rules