winemac: Tell Wine when Cocoa has brought a window to the front.
[wine/wine-gecko.git] / Make.rules.in
blobdb3a45f2184e830dfe975f7e56ee59af813d1b83
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)
37 # Implicit rules
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
41 .c.o:
42         $(CC) -c $(ALLCFLAGS) -o $@ $<
44 .m.o:
45         $(CC) -c $(ALLCFLAGS) -o $@ $<
47 .c.cross.o:
48         $(CROSSCC) -c $(INCLUDES) $(DEFS) -DWINE_CROSSTEST $(CPPFLAGS) $(CFLAGS) -o $@ $<
50 .y.tab.c:
51         $(BISON) $(BISONFLAGS) -p $*_ -o $@ $<
53 .y.tab.h:
54         $(BISON) $(BISONFLAGS) -p $*_ -o $*.tab.c -d $<
56 .l.yy.c:
57         $(FLEX) $(LEXFLAGS) -o$@ $<
59 .mc.res:
60         $(WMC) -U -O res $(PORCFLAGS) -o $@ $<
62 .rc.res:
63         $(WRC) $(RCFLAGS) -o $@ $<
65 .idl.h:
66         $(WIDL) $(IDLFLAGS) -h -o $@ $<
68 .idl_c.c:
69         $(WIDL) $(IDLFLAGS) -c -o $@ $<
71 .idl_i.c:
72         $(WIDL) $(IDLFLAGS) -u -o $@ $<
74 .idl_p.c:
75         $(WIDL) $(IDLFLAGS) -p -o $@ $<
77 .idl_r.res:
78         $(WIDL) $(IDLFLAGS) -r -o $@ $<
80 .idl_s.c:
81         $(WIDL) $(IDLFLAGS) -s -o $@ $<
83 .idl.tlb:
84         $(WIDL) $(TARGETFLAGS) $(IDLFLAGS) -t -o $@ $<
86 .idl_t.res:
87         $(WIDL) $(TARGETFLAGS) $(IDLFLAGS) -t -o $@ $<
89 .c.ok:
90         $(RUNTEST) $(RUNTESTFLAGS) $< && touch $@
92 .sfd.ttf:
93         $(FONTFORGE) -script $(top_srcdir)/fonts/genttf.ff $< $@
95 .man.in.man:
96         LC_ALL=C sed -e 's,@bindir\@,$(bindir),g' -e 's,@dlldir\@,$(dlldir),g' -e 's,@PACKAGE_STRING\@,@PACKAGE_STRING@,g' $< >$@ || ($(RM) $@ && false)
98 .svg.ico:
99         CONVERT="$(CONVERT)" ICOTOOL="$(ICOTOOL)" RSVG="$(RSVG)" $(BUILDIMAGE) $< $@
101 .svg.bmp:
102         CONVERT="$(CONVERT)" ICOTOOL="$(ICOTOOL)" RSVG="$(RSVG)" $(BUILDIMAGE) $< $@
104 .po.mo:
105         $(MSGFMT) -o $@ $<
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)
119 depend: dummy
120         $(MAKEDEP) $(MAKEDEPFLAGS) -C$(srcdir) -S$(top_srcdir) -T$(top_builddir) $(EXTRAINCL) $(DEPEND_SRCS)
122 .PHONY: depend
124 # Rules for man pages
126 MANPAGES = $(MANPAGE) $(EXTRA_MANPAGES)
128 all: $(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
138 # Rules for cleaning
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
150 $(INSTALLDIRS):
151         $(MKDIR_P) -m 755 $@
153 install install-lib install-dev uninstall::
155 .PHONY: install install-lib install-dev uninstall
157 # Rules for resources
159 rsrc.pot: $(WRC)
160         $(WRC) $(RCFLAGS) -O pot -o $@ $(PO_SRCS)
162 msg.pot: $(WMC)
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)
169 # Misc. rules
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