Reimplemented Unicode case mapping in a slightly more efficient way.
[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
20 all: lib$(MODULE).$(LIBEXT) $(ALTNAMES:%=lib%.$(LIBEXT))
21
22 @MAKE_RULES@
23
24 # Rules for .so files
25
26 lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
27         $(LDSHARED) $(OBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-l%) $(EXTRALIBS)
28
29 $(ALLNAMES): lib$(MODULE).so.$(SOVERSION)
30         $(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@
31
32 # Rules for .a files
33
34 lib$(MODULE).a: $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
35         $(RM) $@
36         $(AR) $@ $(OBJS)
37         $(RANLIB) $@
38
39 $(ALTNAMES:%=lib%.a): lib$(MODULE).a
40         $(RM) $@ && $(LN_S) lib$(MODULE).a $@
41
42 # Rules for checking that no imports are missing
43
44 IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
45
46 checklink:: lib$(MODULE).$(LIBEXT) $(IMPORTLIBS)
47         $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) -L$(TOPOBJDIR) -lwine $(EXTRALIBS) $(LIBS) && $(RM) checklink
48
49 $(IMPORTLIBS): dummy
50         @cd $(DLLDIR) && $(MAKE) `basename $@`
51
52 # Rules for installation
53
54 .PHONY: install_so install_a
55
56 install_so: lib$(MODULE).so.$(SOVERSION)
57         [ -d $(libdir) ] || $(MKDIR) $(libdir)
58         $(INSTALL_PROGRAM) lib$(MODULE).so.$(SOVERSION) $(libdir)/lib$(MODULE).so.$(SOVERSION)
59         cd $(libdir) && for i in $(ALLNAMES); do $(RM) $$i && $(LN_S) lib$(MODULE).so.$(SOVERSION) $$i; done
60
61 install_a: lib$(MODULE).a
62         [ -d $(libdir) ] || $(MKDIR) $(libdir)
63         $(INSTALL_DATA) lib$(MODULE).a $(libdir)/lib$(MODULE).a
64
65 install:: $(LIBEXT:%=install_%)
66
67 uninstall::
68         cd $(libdir) && $(RM) $(ALLNAMES) lib$(MODULE).so.$(SOVERSION) lib$(MODULE).a
69
70 clean::
71         $(RM) lib$(MODULE).so.$(SOVERSION)