Added Makeprog.rules.in containing rules for building Winelib
[wine/multimedia.git] / programs / Makeprog.rules.in
blob6b39e5790a02f54ded24e133a9ce735da88b3981
1 # Global rules for building a Winelib program     -*-Makefile-*-
3 # Each individual makefile should define the following variables:
4 # MODULE       : name of the main module being built
5 # EXTRALIBS    : extra libraries to link in (optional)
6 # EXTRADEFS    : extra symbol definitions, like -DWINELIB (optional)
8 # plus all variables required by the global Make.rules.in
11 DEFS       = @DLLFLAGS@ $(EXTRADEFS)
12 LDDLLFLAGS = @LDDLLFLAGS@
13 ALL_OBJS   = $(OBJS) $(MODULE).spec.o
14 ALL_LIBS   = -L$(TOPOBJDIR) -lwine $(EXTRALIBS) $(LIBS)
15 SYMBOLFILE = $(MODULE).tmp.o
17 all: $(MODULE)
19 @MAKE_RULES@
21 # Rules for main module
23 $(MODULE).so: $(ALL_OBJS) Makefile.in
24         $(LDSHARED) $(LDDLLFLAGS) $(ALL_OBJS) -o $@ $(ALL_LIBS)
26 $(MODULE): $(MODULE).so
27         $(RM) $(MODULE) && $(LN_S) $(TOPOBJDIR)/wine $(MODULE)
29 # Rules for checking that no imports are missing
31 checklink:: $(MODULE).so
32         $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c $(MODULE).so $(ALL_LIBS) && $(RM) checklink
34 # Rules for debug channels
36 debug_channels: dummy
37         $(TOPSRCDIR)/tools/make_debug $(MODULE).spec $(C_SRCS)
39 # Rules for installation
41 install:: $(MODULE).so
42         [ -d $(bindir) ] || $(MKDIR) $(bindir)
43         $(INSTALL_PROGRAM) $(MODULE).so $(bindir)/$(MODULE).so
44         cd $(bindir) && $(LN_S) wine $(MODULE)
46 uninstall::
47         cd $(bindir) && $(RM) $(MODULE) $(MODULE).so
49 clean::
50         $(RM) $(MODULE)