Added 'owner' field to 16-bit spec files to specify the name of the
[wine] / dlls / Makedll.rules.in
1 # Global rules for building dlls     -*-Makefile-*-
2 #
3 # Each individual makefile should define the following variables:
4 # MODULE       : name of the main module being built
5 # SOVERSION    : version of the .so file
6 # ALTNAMES     : alternate names for this dll (optional)
7 # IMPORTS      : dlls to import (optional)
8 # EXTRALIBS    : extra libraries to link in (optional)
9 #
10 # plus all variables required by the global Make.rules.in
11 #
12
13 DEFS       = @DLLFLAGS@ -D__WINE__
14 LIBEXT     = @LIBEXT@
15 LDSHARED   = @LDSHARED@
16 SONAME     = lib$(MODULE).so
17 IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
18 ALLNAMES   = lib$(MODULE).so $(ALTNAMES:%=lib%.so)
19 SPEC_SRCS  = $(MODULE).spec $(ALTNAMES:%=%.spec)
20
21 all: lib$(MODULE).$(LIBEXT) $(ALTNAMES:%=lib%.$(LIBEXT))
22
23 @MAKE_RULES@
24
25 # Rules for .so files
26
27 lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
28         $(LDSHARED) $(OBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-l%) $(EXTRALIBS)
29
30 $(ALLNAMES): lib$(MODULE).so.$(SOVERSION)
31         $(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@
32
33 # Rules for .a files
34
35 lib$(MODULE).a: $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
36         $(RM) $@
37         $(AR) $@ $(OBJS)
38         $(RANLIB) $@
39
40 $(ALTNAMES:%=lib%.a): lib$(MODULE).a
41         $(RM) $@ && $(LN_S) lib$(MODULE).a $@
42
43 # Rules for checking that no imports are missing
44
45 IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
46
47 checklink:: lib$(MODULE).$(LIBEXT) $(IMPORTLIBS)
48         $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) -L$(TOPOBJDIR) -lwine -lwine_unicode $(EXTRALIBS) $(LIBS) && $(RM) checklink
49
50 $(IMPORTLIBS): dummy
51         @cd $(DLLDIR) && $(MAKE) `basename $@`
52
53 # Rules for installation
54
55 .PHONY: install_so install_a
56
57 install_so: lib$(MODULE).so.$(SOVERSION)
58         [ -d $(libdir) ] || $(MKDIR) $(libdir)
59         $(INSTALL_PROGRAM) lib$(MODULE).so.$(SOVERSION) $(libdir)/lib$(MODULE).so.$(SOVERSION)
60         cd $(libdir) && for i in $(ALLNAMES); do $(RM) $$i && $(LN_S) lib$(MODULE).so.$(SOVERSION) $$i; done
61
62 install_a: lib$(MODULE).a
63         [ -d $(libdir) ] || $(MKDIR) $(libdir)
64         $(INSTALL_DATA) lib$(MODULE).a $(libdir)/lib$(MODULE).a
65
66 install:: $(LIBEXT:%=install_%)
67
68 uninstall::
69         cd $(libdir) && $(RM) $(ALLNAMES) lib$(MODULE).so.$(SOVERSION) lib$(MODULE).a
70
71 clean::
72         $(RM) lib$(MODULE).so.$(SOVERSION)