kernel32: Fix some pointer to integer casts.
[wine] / libs / Makelib.rules.in
1 # Global rules for building shared libraries     -*-Makefile-*-
2 #
3 # Each individual makefile should define the following variables:
4 # LIBRARY      : name of the library being built (without the lib prefix)
5 # SOVERSION    : the .so file version
6 #
7 # plus all variables required by the global Make.rules.in
8 #
9
10 DEFS      = $(EXTRADEFS)
11 DLLFLAGS  = @DLLFLAGS@
12 LIBEXT    = @LIBEXT@
13 LIBNAME   = lib$(LIBRARY)
14 DEFNAME   = $(LIBRARY).def
15 SONAME    = $(LIBNAME).so.$(SOVERSION)
16 DYNAME    = $(LIBNAME).$(SOVERSION).dylib
17 MODULE    = $(LIBNAME).$(LIBEXT)
18
19 all: $(MODULE) $(MODULE:.dll=.a)
20
21 @MAKE_RULES@
22
23 $(LIBNAME).so.$(SOVERSION): $(OBJS) $(VERSCRIPT) Makefile.in
24         $(LDSHARED) $(OBJS) $(EXTRALIBS) $(LDFLAGS) $(LIBS) -o $@
25
26 $(LIBNAME).so: $(LIBNAME).so.$(SOVERSION)
27         $(RM) $@ && $(LN_S) $(LIBNAME).so.$(SOVERSION) $@
28
29 $(LIBNAME).a: $(DEFNAME)
30         $(DLLTOOL) -l $@ -d $(SRCDIR)/$(DEFNAME)
31
32 $(LIBNAME).dll: $(OBJS) $(DEFNAME) Makefile.in
33         $(DLLWRAP) --def $(SRCDIR)/$(DEFNAME) -o $@ $(OBJS) $(EXTRALIBS)
34
35 $(LIBNAME).$(SOVERSION).dylib: $(OBJS) $(RELPATH) Makefile.in
36         $(LDSHARED) $(OBJS) $(EXTRALIBS) $(LDFLAGS) $(LIBS) -o $@
37
38 $(LIBNAME).dylib: $(LIBNAME).$(SOVERSION).dylib
39         $(RM) $@ && $(LN_S) $(LIBNAME).$(SOVERSION).dylib $@
40
41 .PHONY: install-lib-so install-lib-dll install-lib-dylib install-dev-so install-dev-dll install-dev-dylib
42
43 install-lib-so: $(LIBNAME).so.$(SOVERSION) dummy
44         $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
45         $(INSTALL_PROGRAM) $(LIBNAME).so.$(SOVERSION) $(DESTDIR)$(libdir)/$(LIBNAME).so.$(SOVERSION)
46
47 install-lib-dll: $(LIBNAME).dll dummy
48         $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
49         $(INSTALL_DATA) $(LIBNAME).dll $(DESTDIR)$(libdir)/$(LIBNAME).dll
50
51 install-lib-dylib: $(LIBNAME).$(SOVERSION).dylib dummy
52         $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
53         $(INSTALL_PROGRAM) $(LIBNAME).$(SOVERSION).dylib $(DESTDIR)$(libdir)/$(LIBNAME).$(SOVERSION).dylib
54
55 install-dev-so: dummy
56         $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
57         cd $(DESTDIR)$(libdir) && $(RM) $(LIBNAME).so && $(LN_S) $(LIBNAME).so.$(SOVERSION) $(LIBNAME).so
58
59 install-dev-dll: $(LIBNAME).a dummy
60         $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
61         $(INSTALL_DATA) $(LIBNAME).a $(DESTDIR)$(libdir)/$(LIBNAME).a
62
63 install-dev-dylib: dummy
64         $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
65         cd $(DESTDIR)$(libdir) && $(RM) $(LIBNAME).dylib && $(LN_S) $(LIBNAME).$(SOVERSION).dylib $(LIBNAME).dylib
66
67 install install-lib:: $(LIBEXT:%=install-lib-%)
68 install install-dev:: $(LIBEXT:%=install-dev-%)
69
70 uninstall::
71         -cd $(DESTDIR)$(libdir) && $(RM) $(LIBNAME).a $(LIBNAME).dll $(LIBNAME).so $(LIBNAME).so.$(SOVERSION) $(LIBNAME).dylib $(LIBNAME).$(SOVERSION).dylib
72
73 clean::
74         $(RM) $(LIBNAME).so.$(SOVERSION) $(LIBNAME).dll $(LIBNAME).$(SOVERSION).dylib
75
76 $(RELPATH):
77         @cd $(TOOLSDIR)/tools && $(MAKE) relpath