Moved shared crtdll/ntdll functions into ntdll.
[wine.git] / dlls / Makedll.rules.in
blobce995358d0d153786608207710a43c5600d3b549
1 # Global rules for building dlls     -*-Makefile-*-
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)
10 # plus all variables required by the global Make.rules.in
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)
21 all: lib$(MODULE).$(LIBEXT) $(ALTNAMES:%=lib%.$(LIBEXT))
23 @MAKE_RULES@
25 # Rules for .so files
27 lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
28         $(LDSHARED) $(OBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-l%) $(EXTRALIBS)
30 $(ALLNAMES): lib$(MODULE).so.$(SOVERSION)
31         $(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@
33 # Rules for .a files
35 lib$(MODULE).a: $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
36         $(RM) $@
37         $(AR) $@ $(OBJS)
38         $(RANLIB) $@
40 $(ALTNAMES:%=lib%.a): lib$(MODULE).a
41         $(RM) $@ && $(LN_S) lib$(MODULE).a $@
43 # Rules for checking that no imports are missing
45 IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
47 checklink:: lib$(MODULE).$(LIBEXT) $(IMPORTLIBS)
48         $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) -L$(TOPOBJDIR) -lwine $(EXTRALIBS) $(LIBS) && $(RM) checklink
50 $(IMPORTLIBS): dummy
51         @cd $(DLLDIR) && $(MAKE) `basename $@`
53 # Rules for installation
55 .PHONY: install_so install_a
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
62 install_a: lib$(MODULE).a
63         [ -d $(libdir) ] || $(MKDIR) $(libdir)
64         $(INSTALL_DATA) lib$(MODULE).a $(libdir)/lib$(MODULE).a
66 install:: $(LIBEXT:%=install_%)
68 uninstall::
69         cd $(libdir) && $(RM) $(ALLNAMES) lib$(MODULE).so.$(SOVERSION) lib$(MODULE).a
71 clean::
72         $(RM) lib$(MODULE).so.$(SOVERSION)