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 # OBJC_SRCS : Objective-C sources for the module
6 # RC_SRCS : resource source files
7 # EXTRA_SRCS : extra source files for make depend
8 # EXTRA_OBJS : extra object files
9 # IMPORTS : dlls to import
10 # DELAYIMPORTS : dlls to import in delayed mode
11 # EXTRASUBDIRS : subdirectories that do not contain a Makefile
12 # MODCFLAGS : extra CFLAGS for this module
14 # First some useful definitions
16 INCLUDES = -I$(srcdir) -I. -I$(top_srcdir)/include -I$(top_builddir)/include $(EXTRAINCL)
17 DEFS = -D__WINESRC__ $(EXTRADEFS)
18 ALLCFLAGS = $(INCLUDES) $(DEFS) $(DLLFLAGS) $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS) $(MODCFLAGS)
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 *.res *.fake *.ok *.tab.[ch] *.yy.c
28 CLEAN_TARGETS = $(IDL_GEN_C_SRCS) $(IDL_GEN_HEADERS) \
29 $(IDL_TLB_SRCS:.idl=.tlb) $(IDL_P_SRCS:.idl=_p.c dlldata.c) \
30 $(PO_SRCS:.rc=.res rsrc.pot) $(MC_SRCS:.mc=.res 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) $(OBJC_SRCS:.m=.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)
39 .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
42 $(CC) -c $(ALLCFLAGS) -o $@ $<
45 $(CC) -c $(ALLCFLAGS) -o $@ $<
48 $(CROSSCC) -c $(INCLUDES) $(DEFS) -DWINE_CROSSTEST $(CPPFLAGS) $(CFLAGS) -o $@ $<
51 $(BISON) $(BISONFLAGS) -p $*_ -o $@ $<
54 $(BISON) $(BISONFLAGS) -p $*_ -o $*.tab.c -d $<
57 $(FLEX) $(LEXFLAGS) -o$@ $<
60 $(WMC) -U -O res $(PORCFLAGS) -o $@ $<
63 $(WRC) $(RCFLAGS) -o $@ $<
66 $(WIDL) $(IDLFLAGS) -h -o $@ $<
69 $(WIDL) $(IDLFLAGS) -c -o $@ $<
72 $(WIDL) $(IDLFLAGS) -u -o $@ $<
75 $(WIDL) $(IDLFLAGS) -p -o $@ $<
78 $(WIDL) $(IDLFLAGS) -r -o $@ $<
81 $(WIDL) $(IDLFLAGS) -s -o $@ $<
84 $(WIDL) $(TARGETFLAGS) $(IDLFLAGS) -t -o $@ $<
87 $(WIDL) $(TARGETFLAGS) $(IDLFLAGS) -t -o $@ $<
90 $(RUNTEST) $(RUNTESTFLAGS) $< && touch $@
93 $(FONTFORGE) -script $(top_srcdir)/fonts/genttf.ff $< $@
96 LC_ALL=C sed -e 's,@bindir\@,$(bindir),g' -e 's,@dlldir\@,$(dlldir),g' -e 's,@PACKAGE_STRING\@,@PACKAGE_STRING@,g' $< >$@ || ($(RM) $@ && false)
99 CONVERT="$(CONVERT)" ICOTOOL="$(ICOTOOL)" RSVG="$(RSVG)" $(BUILDIMAGE) $< $@
102 CONVERT="$(CONVERT)" ICOTOOL="$(ICOTOOL)" RSVG="$(RSVG)" $(BUILDIMAGE) $< $@
107 # Rules for IDL files
109 dlldata.c: $(WIDL) Makefile.in
110 $(WIDL) $(IDLFLAGS) --dlldata-only -o $@ $(IDL_P_SRCS)
112 # Rules for dependencies
114 DEPEND_SRCS = $(C_SRCS) $(OBJC_SRCS) $(RC_SRCS) $(MC_SRCS) \
115 $(IDL_H_SRCS) $(IDL_C_SRCS) $(IDL_I_SRCS) $(IDL_P_SRCS) $(IDL_S_SRCS) \
116 $(IDL_GEN_C_SRCS) $(IDL_R_SRCS:.idl=_r.res) $(IDL_TLB_SRCS) $(IDL_TLB_SRCS:.idl=.tlb) \
117 $(BISON_SRCS) $(LEX_SRCS) $(EXTRA_SRCS)
120 $(MAKEDEP) $(MAKEDEPFLAGS) -C$(srcdir) -S$(top_srcdir) -T$(top_builddir) $(EXTRAINCL) $(DEPEND_SRCS)
124 # Rules for man pages
126 MANPAGES = $(MANPAGE) $(EXTRA_MANPAGES)
130 install-man-pages:: $(MANPAGE) $(DESTDIR)$(mandir)/man$(prog_manext)
131 $(INSTALL_DATA) $(MANPAGE) $(DESTDIR)$(mandir)/man$(prog_manext)/$(MANPAGE:.man=).$(prog_manext)
133 uninstall-man-pages::
134 $(RM) $(DESTDIR)$(mandir)/man$(prog_manext)/$(MANPAGE:.man=).$(prog_manext)
136 .PHONY: install-man-pages uninstall-man-pages
140 $(EXTRASUBDIRS:%=%/clean): dummy
141 -cd `dirname $@` && $(RM) $(CLEAN_FILES)
143 clean:: $(EXTRASUBDIRS:%=%/clean)
144 $(RM) $(CLEAN_FILES) $(CLEAN_TARGETS) $(PROGRAMS) $(MANPAGES)
146 .PHONY: clean $(EXTRASUBDIRS:%=%/clean)
148 # Rules for installing
153 install install-lib install-dev uninstall::
155 .PHONY: install install-lib install-dev uninstall
157 # Rules for resources
160 $(WRC) $(RCFLAGS) -O pot -o $@ $(PO_SRCS)
163 $(WMC) -O pot -o $@ $(MC_SRCS)
165 $(MC_SRCS:.mc=.res): $(WMC) $(ALL_MO_FILES)
166 $(RC_SRCS:.rc=.res): $(WRC)
167 $(PO_SRCS:.rc=.res): $(ALL_MO_FILES)
171 $(IDL_GEN_HEADERS) $(IDL_GEN_C_SRCS) $(IDL_TLB_SRCS:.idl=.tlb) $(IDL_TLB_RES) $(IDL_R_SRCS:.idl=_r.res): $(WIDL)
173 # End of global rules