rpcrt4: Implement proxy/stub delegation for x86_64.
[wine.git] / Make.rules.in
blob77cf55800d843df8cb8e66c59a90e10b08e34d8c
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 # RC_SRCS      : resource source files
12 # EXTRA_SRCS   : extra source files for make depend
13 # EXTRA_OBJS   : extra object files
14 # IMPORTS      : dlls to import
15 # DELAYIMPORTS : dlls to import in delayed mode
16 # EXTRASUBDIRS : subdirectories that do not contain a Makefile
17 # MODCFLAGS    : extra CFLAGS for this module
19 # First some useful definitions
21 SHELL     = /bin/sh
22 CC        = @CC@
23 CFLAGS    = @CFLAGS@
24 CPPFLAGS  = @CPPFLAGS@
25 LIBS      = @LIBS@
26 BISON     = @BISON@
27 FLEX      = @FLEX@
28 EXEEXT    = @EXEEXT@
29 OBJEXT    = @OBJEXT@
30 LIBEXT    = @LIBEXT@
31 DLLEXT    = @DLLEXT@
32 TOOLSEXT  = @TOOLSEXT@
33 IMPLIBEXT = @IMPLIBEXT@
34 LDSHARED  = @LDSHARED@
35 DLLTOOL   = @DLLTOOL@
36 DLLWRAP   = @DLLWRAP@
37 AR        = @AR@
38 ARFLAGS   = @ARFLAGS@
39 RANLIB    = @RANLIB@
40 STRIP     = @STRIP@
41 LN_S      = @LN_S@
42 TOOLSDIR  = @TOOLSDIR@
43 LDFLAGS   = @LDFLAGS@
44 PRELINK   = @PRELINK@
45 RM        = rm -f
46 MV        = mv
47 LINT      = @LINT@
48 LINTFLAGS = @LINTFLAGS@
49 FONTFORGE = @FONTFORGE@
50 RSVG      = @RSVG@
51 CONVERT   = @CONVERT@
52 ICOTOOL   = @ICOTOOL@
53 CROSSCC   = @CROSSCC@
54 CROSSTARGET = @CROSSTARGET@
55 CROSSAR     = $(CROSSTARGET)-ar
56 CROSSRANLIB = $(CROSSTARGET)-ranlib
57 FAKEEXT   = $(DLLEXT:.so=.fake)
58 INCLUDES     = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include $(EXTRAINCL)
59 EXTRACFLAGS  = @EXTRACFLAGS@
60 ALLCFLAGS    = $(INCLUDES) $(DEFS) $(DLLFLAGS) $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS) $(MODCFLAGS)
61 ALLLINTFLAGS = $(INCLUDES) $(DEFS) $(LINTFLAGS)
62 IDLFLAGS     = $(INCLUDES) $(DEFS) $(EXTRAIDLFLAGS)
63 TARGETFLAGS  = @TARGETFLAGS@
64 WINEBUILDFLAGS = $(TARGETFLAGS) $(DLLFLAGS)
65 MKINSTALLDIRS= $(TOPSRCDIR)/tools/mkinstalldirs -m 755
66 WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi/winapi_check
67 BUILDICON    = $(TOPSRCDIR)/tools/buildicon
68 C2MAN        = $(TOPSRCDIR)/tools/c2man.pl
69 RUNTEST      = $(TOPSRCDIR)/tools/runtest
70 WINEBUILD    = $(TOOLSDIR)/tools/winebuild/winebuild$(TOOLSEXT)
71 MAKEDEP      = $(TOOLSDIR)/tools/makedep$(TOOLSEXT)
72 MAKECTESTS   = $(TOOLSDIR)/tools/make_ctests$(TOOLSEXT)
73 WRC          = $(TOOLSDIR)/tools/wrc/wrc$(TOOLSEXT)
74 WMC          = $(TOOLSDIR)/tools/wmc/wmc$(TOOLSEXT)
75 WIDL         = $(TOOLSDIR)/tools/widl/widl$(TOOLSEXT)
76 WINEGCC      = $(TOOLSDIR)/tools/winegcc/winegcc $(TARGETFLAGS) -B$(TOOLSDIR)/tools/winebuild --sysroot=$(TOPOBJDIR)
77 CROSSWINEGCC = $(TOOLSDIR)/tools/winegcc/winegcc $(CROSSTARGET:%=-b %) -B$(TOOLSDIR)/tools/winebuild --sysroot=$(TOPOBJDIR) --lib-suffix=.cross.a
78 RELPATH      = $(TOOLSDIR)/tools/relpath$(TOOLSEXT)
79 SFNT2FNT     = $(TOOLSDIR)/tools/sfnt2fnt$(TOOLSEXT)
80 RC           = $(WRC)
81 RCFLAGS      = --nostdinc $(INCLUDES) $(DEFS) $(EXTRARCFLAGS)
82 LDPATH       = @LDPATH@
83 DLLDIR       = $(TOPOBJDIR)/dlls
84 LIBPORT      = $(TOPOBJDIR)/libs/port/libwine_port.a
85 LIBWPP       = $(TOPOBJDIR)/libs/wpp/libwpp.a
86 LIBWINE      = -L$(TOPOBJDIR)/libs/wine -lwine
87 LDRPATH_INSTALL = @LDRPATH_INSTALL@
88 LDRPATH_LOCAL   = @LDRPATH_LOCAL@
90 @SET_MAKE@
92 # Installation infos
94 INSTALL         = @INSTALL@ $(INSTALL_FLAGS)
95 INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(INSTALL_PROGRAM_FLAGS)
96 INSTALL_SCRIPT  = @INSTALL_SCRIPT@ $(INSTALL_SCRIPT_FLAGS)
97 INSTALL_DATA    = @INSTALL_DATA@ $(INSTALL_DATA_FLAGS)
98 prefix          = @prefix@
99 exec_prefix     = @exec_prefix@
100 bindir          = @bindir@
101 libdir          = @libdir@
102 datarootdir     = @datarootdir@
103 datadir         = @datadir@
104 infodir         = @infodir@
105 mandir          = @mandir@
106 sysconfdir      = @sysconfdir@
107 includedir      = @includedir@/wine
108 dlldir          = @libdir@/wine
109 fakedlldir      = $(dlldir)/fakedlls
110 prog_manext     = 1
111 api_manext      = 3w
112 conf_manext     = 5
113 CLEAN_FILES     = *.o *.a *.so *.ln *.res *.fake *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej *.flc core
115 IDL_GEN_C_SRCS  = $(IDL_C_SRCS:.idl=_c.c) $(IDL_I_SRCS:.idl=_i.c) \
116                   $(IDL_P_SRCS:.idl=_p.c) $(IDL_S_SRCS:.idl=_s.c)
117 IDL_GEN_HEADERS = $(IDL_H_SRCS:.idl=.h) $(IDL_C_SRCS:.idl=.h) $(IDL_I_SRCS:.idl=.h) \
118                   $(IDL_P_SRCS:.idl=.h) $(IDL_S_SRCS:.idl=.h)
120 CLEAN_TARGETS = $(IDL_GEN_C_SRCS) $(IDL_GEN_HEADERS) $(IDL_TLB_SRCS:.idl=.tlb) $(IDL_P_SRCS:%=dlldata.c) \
121                 $(BISON_SRCS:.y=.tab.c) $(BISON_SRCS:.y=.tab.h) $(LEX_SRCS:.l=.yy.c) $(MC_SRCS:.mc=.mc.rc)
123 OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) $(IDL_GEN_C_SRCS:.c=.o) \
124        $(RC_SRCS:.rc=.res) $(MC_SRCS:.mc=.mc.res) $(EXTRA_OBJS)
126 CROSSOBJS = $(OBJS:.o=.cross.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 .idl .tlb .h .y .l .tab.c .tab.h .yy.c .ok .man.in .man _c.c _i.c _p.c _s.c .cross.o @MAINTAINER_MODE@ .sfd .ttf .svg .ico
142 .c.o:
143         $(CC) -c $(ALLCFLAGS) -o $@ $<
145 .c.cross.o:
146         $(CROSSCC) -c $(INCLUDES) $(DEFS) $(CPPFLAGS) $(CFLAGS) -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 .idl.h:
164         $(WIDL) $(IDLFLAGS) -h -H $@ $<
166 .idl_c.c:
167         $(WIDL) $(IDLFLAGS) -c -C $@ $<
169 .idl_i.c:
170         $(WIDL) $(IDLFLAGS) -u -U $@ $<
172 .idl_p.c:
173         $(WIDL) $(IDLFLAGS) -p -P $@ $<
175 .idl_s.c:
176         $(WIDL) $(IDLFLAGS) -s -S $@ $<
178 .idl.tlb:
179         $(WIDL) $(TARGETFLAGS) $(IDLFLAGS) -t -T $@ $<
181 .c.ln:
182         $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
184 .c.ok:
185         $(RUNTEST) $(RUNTESTFLAGS) $< && touch $@
187 .sfd.ttf:
188         $(FONTFORGE) -script $(TOPSRCDIR)/fonts/genttf.ff $< $@
190 .man.in.man:
191         LC_ALL=C sed -e 's,@bindir\@,$(bindir),g' -e 's,@dlldir\@,$(dlldir),g' -e 's,@PACKAGE_STRING\@,@PACKAGE_STRING@,g' $< >$@ || ($(RM) $@ && false)
193 .svg.ico:
194         CONVERT="$(CONVERT)" ICOTOOL="$(ICOTOOL)" RSVG="$(RSVG)" $(BUILDICON) $< $@
196 # Rules for IDL files
198 dlldata.c: $(WIDL) Makefile.in
199         $(WIDL) $(IDLFLAGS) --dlldata-only --dlldata=$@ $(IDL_P_SRCS)
201 # Rule for linting
203 $(MODULE).ln : $(LINTS)
204         if test "$(LINTS)" ; \
205         then \
206                 $(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
207                 $(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
208         else \
209                 $(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
210         fi
212 lint:: $(MODULE).ln
214 # Rules for Windows API checking
216 winapi_check:: dummy
217         $(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
219 .PHONY: winapi_check
221 # Rules for dependencies
223 DEPEND_SRCS = $(C_SRCS) $(RC_SRCS) $(MC_SRCS) \
224               $(IDL_H_SRCS) $(IDL_C_SRCS) $(IDL_I_SRCS) $(IDL_P_SRCS) $(IDL_S_SRCS) \
225               $(IDL_GEN_C_SRCS) $(IDL_TLB_SRCS) $(IDL_TLB_SRCS:.idl=.tlb) \
226               $(BISON_SRCS) $(LEX_SRCS) $(EXTRA_SRCS)
228 depend: dummy
229         $(MAKEDEP) $(MAKEDEPFLAGS) -C$(SRCDIR) -S$(TOPSRCDIR) -T$(TOPOBJDIR) $(EXTRAINCL) $(DEPEND_SRCS)
231 .PHONY: depend
233 # Rules for cleaning
235 $(EXTRASUBDIRS:%=%/__clean__): dummy
236         -cd `dirname $@` && $(RM) $(CLEAN_FILES)
238 clean:: $(EXTRASUBDIRS:%=%/__clean__)
239         $(RM) $(CLEAN_FILES) $(CLEAN_TARGETS) $(PROGRAMS) $(MANPAGES)
241 .PHONY: clean $(EXTRASUBDIRS:%=%/__clean__)
243 # Rules for installing
245 $(INSTALLDIRS):
246         $(MKINSTALLDIRS) $@
248 install install-lib install-dev uninstall::
250 .PHONY: install install-lib install-dev uninstall
252 # Misc. rules
254 $(MC_SRCS:.mc=.mc.rc): $(WMC)
256 $(IDL_GEN_HEADERS) $(IDL_GEN_C_SRCS) $(IDL_TLB_SRCS:.idl=.tlb): $(WIDL)
258 $(RC_SRCS:.rc=.res) $(MC_SRCS:.mc=.mc.res): $(WRC)
260 dummy:
262 .PHONY: dummy
264 # End of global rules