vbscript: 'property' may be both keyword and identifier.
[wine/multimedia.git] / Make.rules.in
blob7c4a65c4aa6c3e502126884d90a4b29d457a54fe
1 # Global rules shared by all makefiles     -*-Makefile-*-
3 # Each individual makefile may define the following variables:
4 # C_SRCS       : C sources for the module
5 # RC_SRCS      : resource source files
6 # EXTRA_SRCS   : extra source files for make depend
7 # EXTRA_OBJS   : extra object files
8 # IMPORTS      : dlls to import
9 # DELAYIMPORTS : dlls to import in delayed mode
10 # EXTRASUBDIRS : subdirectories that do not contain a Makefile
11 # MODCFLAGS    : extra CFLAGS for this module
13 # First some useful definitions
15 LDSHARED     = @LDSHARED@
16 INCLUDES     = -I$(srcdir) -I. -I$(top_srcdir)/include -I$(top_builddir)/include $(EXTRAINCL)
17 ALLCFLAGS    = $(INCLUDES) $(DEFS) $(DLLFLAGS) $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS) $(MODCFLAGS)
18 ALLLINTFLAGS = $(INCLUDES) $(DEFS) $(LINTFLAGS)
19 IDLFLAGS     = $(INCLUDES) $(DEFS) $(EXTRAIDLFLAGS)
20 RCFLAGS      = --nostdinc $(PORCFLAGS) $(TARGETFLAGS) $(INCLUDES) $(DEFS) $(EXTRARCFLAGS)
22 IDL_GEN_C_SRCS  = $(IDL_C_SRCS:.idl=_c.c) $(IDL_I_SRCS:.idl=_i.c) \
23                   $(IDL_P_SRCS:.idl=_p.c) $(IDL_S_SRCS:.idl=_s.c)
24 IDL_GEN_HEADERS = $(IDL_H_SRCS:.idl=.h) $(IDL_C_SRCS:.idl=.h) $(IDL_I_SRCS:.idl=.h) \
25                   $(IDL_P_SRCS:.idl=.h) $(IDL_S_SRCS:.idl=.h)
27 CLEAN_FILES   = *.o *.a *.so *.mo *.ln *.res *.fake *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej *.flc core
28 CLEAN_TARGETS = $(IDL_GEN_C_SRCS) $(IDL_GEN_HEADERS) $(IDL_TLB_SRCS:.idl=.tlb) $(IDL_P_SRCS:%=dlldata.c) \
29                 $(BISON_SRCS:.y=.tab.c) $(BISON_SRCS:.y=.tab.h) $(LEX_SRCS:.l=.yy.c) \
30                 $(PO_SRCS:%=rsrc.pot) $(MC_SRCS:%=msg.pot) $(XTEMPLATE_SRCS:.x=.h)
32 OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) $(IDL_GEN_C_SRCS:.c=.o) \
33        $(IDL_R_SRCS:.idl=_r.res) $(IDL_TLB_RES) $(RC_SRCS:.rc=.res) $(MC_SRCS:.mc=.res) $(EXTRA_OBJS)
35 CROSSOBJS = $(OBJS:.o=.cross.o)
36 LINTS  = $(C_SRCS:.c=.ln)
38 filter: dummy
39         @$(top_srcdir)/tools/winapi/make_filter --make $(MAKE) all
41 .PHONY: all filter
43 # Implicit rules
45 .SUFFIXES: .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 _r.res _t.res .cross.o .po .mo @MAINTAINER_MODE@ .sfd .ttf .svg .ico .bmp
47 .c.o:
48         $(CC) -c $(ALLCFLAGS) -o $@ $<
50 .c.cross.o:
51         $(CROSSCC) -c $(INCLUDES) $(DEFS) -DWINE_CROSSTEST $(CPPFLAGS) $(CFLAGS) -o $@ $<
53 .y.tab.c:
54         $(BISON) $(BISONFLAGS) -p $*_ -o $@ $<
56 .y.tab.h:
57         $(BISON) $(BISONFLAGS) -p $*_ -o $*.tab.c -d $<
59 .l.yy.c:
60         $(FLEX) $(LEXFLAGS) -o$@ $<
62 .mc.res:
63         $(LDPATH) $(WMC) -U -O res -P $(top_srcdir)/po -o $@ $<
65 .rc.res:
66         $(LDPATH) $(WRC) $(RCFLAGS) -o $@ $<
68 .idl.h:
69         $(WIDL) $(IDLFLAGS) -h -o $@ $<
71 .idl_c.c:
72         $(WIDL) $(IDLFLAGS) -c -o $@ $<
74 .idl_i.c:
75         $(WIDL) $(IDLFLAGS) -u -o $@ $<
77 .idl_p.c:
78         $(WIDL) $(IDLFLAGS) -p -o $@ $<
80 .idl_r.res:
81         $(WIDL) $(IDLFLAGS) -r -o $@ $<
83 .idl_s.c:
84         $(WIDL) $(IDLFLAGS) -s -o $@ $<
86 .idl.tlb:
87         $(WIDL) $(TARGETFLAGS) $(IDLFLAGS) -t -o $@ $<
89 .idl_t.res:
90         $(WIDL) $(TARGETFLAGS) $(IDLFLAGS) -t -o $@ $<
92 .c.ln:
93         $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
95 .c.ok:
96         $(RUNTEST) $(RUNTESTFLAGS) $< && touch $@
98 .sfd.ttf:
99         $(FONTFORGE) -script $(top_srcdir)/fonts/genttf.ff $< $@
101 .man.in.man:
102         LC_ALL=C sed -e 's,@bindir\@,$(bindir),g' -e 's,@dlldir\@,$(dlldir),g' -e 's,@PACKAGE_STRING\@,@PACKAGE_STRING@,g' $< >$@ || ($(RM) $@ && false)
104 .svg.ico:
105         CONVERT="$(CONVERT)" ICOTOOL="$(ICOTOOL)" RSVG="$(RSVG)" $(BUILDIMAGE) $< $@
107 .svg.bmp:
108         CONVERT="$(CONVERT)" ICOTOOL="$(ICOTOOL)" RSVG="$(RSVG)" $(BUILDIMAGE) $< $@
110 .po.mo:
111         $(MSGFMT) -o $@ $<
113 # Rules for IDL files
115 dlldata.c: $(WIDL) Makefile.in
116         $(WIDL) $(IDLFLAGS) --dlldata-only -o $@ $(IDL_P_SRCS)
118 # Rule for linting
120 $(MODULE).ln : $(LINTS)
121         if test "$(LINTS)" ; \
122         then \
123                 $(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
124                 $(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
125         else \
126                 $(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
127         fi
129 lint:: $(MODULE).ln
131 # Rules for Windows API checking
133 winapi_check:: dummy
134         $(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
136 .PHONY: winapi_check
138 # Rules for dependencies
140 DEPEND_SRCS = $(C_SRCS) $(RC_SRCS) $(MC_SRCS) \
141               $(IDL_H_SRCS) $(IDL_C_SRCS) $(IDL_I_SRCS) $(IDL_P_SRCS) $(IDL_S_SRCS) \
142               $(IDL_GEN_C_SRCS) $(IDL_R_SRCS:.idl=_r.res) $(IDL_TLB_SRCS) $(IDL_TLB_SRCS:.idl=.tlb) \
143               $(BISON_SRCS) $(LEX_SRCS) $(EXTRA_SRCS)
145 depend: dummy
146         $(MAKEDEP) $(MAKEDEPFLAGS) -C$(srcdir) -S$(top_srcdir) -T$(top_builddir) $(EXTRAINCL) $(DEPEND_SRCS)
148 .PHONY: depend
150 # Rules for man pages
152 MANPAGES = $(MANPAGE) $(EXTRA_MANPAGES)
154 all: $(MANPAGES)
156 install-man-pages:: $(MANPAGE) $(DESTDIR)$(mandir)/man$(prog_manext)
157         $(INSTALL_DATA) $(MANPAGE) $(DESTDIR)$(mandir)/man$(prog_manext)/$(MANPAGE:.man=).$(prog_manext)
159 uninstall-man-pages::
160         $(RM) $(DESTDIR)$(mandir)/man$(prog_manext)/$(MANPAGE:.man=).$(prog_manext)
162 install:: @WOW64_DISABLE@ $(MANPAGE:%=install-man-pages)
163 uninstall:: @WOW64_DISABLE@ $(MANPAGE:%=uninstall-man-pages)
165 # Rules for cleaning
167 $(EXTRASUBDIRS:%=%/__clean__): dummy
168         -cd `dirname $@` && $(RM) $(CLEAN_FILES)
170 clean:: $(EXTRASUBDIRS:%=%/__clean__)
171         $(RM) $(CLEAN_FILES) $(CLEAN_TARGETS) $(PROGRAMS) $(MANPAGES)
173 .PHONY: clean $(EXTRASUBDIRS:%=%/__clean__)
175 # Rules for installing
177 $(INSTALLDIRS):
178         $(MKINSTALLDIRS) $@
180 install install-lib install-dev uninstall::
182 .PHONY: install install-lib install-dev uninstall
184 # Rules for resources
186 rsrc.pot: $(WRC)
187         $(LDPATH) $(WRC) $(RCFLAGS) -O pot -o $@ $(PO_SRCS)
189 msg.pot: $(WMC)
190         $(LDPATH) $(WMC) -O pot -o $@ $(MC_SRCS)
192 $(MC_SRCS:.mc=.res): $(WMC) $(ALL_MO_FILES)
193 $(RC_SRCS:.rc=.res): $(WRC)
194 $(PO_SRCS:.rc=.res): $(ALL_MO_FILES)
196 # Misc. rules
198 $(IDL_GEN_HEADERS) $(IDL_GEN_C_SRCS) $(IDL_TLB_SRCS:.idl=.tlb) $(IDL_TLB_RES) $(IDL_R_SRCS:.idl=_r.res): $(WIDL)
200 dummy:
202 .PHONY: dummy
204 # End of global rules