2000-03-04 23:31:27 +01:00
|
|
|
# Global rules for building dlls -*-Makefile-*-
|
|
|
|
#
|
|
|
|
# Each individual makefile should define the following variables:
|
|
|
|
# MODULE : name of the main module being built
|
|
|
|
# SOVERSION : version of the .so file
|
2000-03-05 14:08:24 +01:00
|
|
|
# ALTNAMES : alternate names for this dll (optional)
|
2000-03-04 23:31:27 +01:00
|
|
|
# IMPORTS : dlls to import (optional)
|
2000-04-24 19:17:49 +02:00
|
|
|
# EXTRALIBS : extra libraries to link in (optional)
|
2000-03-04 23:31:27 +01:00
|
|
|
#
|
|
|
|
# plus all variables required by the global Make.rules.in
|
|
|
|
#
|
|
|
|
|
|
|
|
DEFS = @DLLFLAGS@ -D__WINE__
|
|
|
|
LIBEXT = @LIBEXT@
|
|
|
|
LDSHARED = @LDSHARED@
|
|
|
|
SONAME = lib$(MODULE).so
|
|
|
|
IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
|
2000-03-05 14:08:24 +01:00
|
|
|
ALLNAMES = lib$(MODULE).so $(ALTNAMES:%=lib%.so)
|
2000-06-20 22:24:14 +02:00
|
|
|
SPEC_SRCS = $(MODULE).spec $(ALTNAMES:%=%.spec)
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2000-03-05 14:08:24 +01:00
|
|
|
all: lib$(MODULE).$(LIBEXT) $(ALTNAMES:%=lib%.$(LIBEXT))
|
2000-03-04 23:31:27 +01:00
|
|
|
|
|
|
|
@MAKE_RULES@
|
|
|
|
|
2000-03-05 14:08:24 +01:00
|
|
|
# Rules for .so files
|
|
|
|
|
2000-03-04 23:31:27 +01:00
|
|
|
lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
|
2000-04-24 19:17:49 +02:00
|
|
|
$(LDSHARED) $(OBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-l%) $(EXTRALIBS)
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2000-03-05 14:08:24 +01:00
|
|
|
$(ALLNAMES): lib$(MODULE).so.$(SOVERSION)
|
2000-03-04 23:31:27 +01:00
|
|
|
$(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@
|
|
|
|
|
2000-03-05 14:08:24 +01:00
|
|
|
# Rules for .a files
|
|
|
|
|
2000-03-04 23:31:27 +01:00
|
|
|
lib$(MODULE).a: $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
|
|
|
|
$(RM) $@
|
|
|
|
$(AR) $@ $(OBJS)
|
|
|
|
$(RANLIB) $@
|
|
|
|
|
2000-03-05 14:08:24 +01:00
|
|
|
$(ALTNAMES:%=lib%.a): lib$(MODULE).a
|
|
|
|
$(RM) $@ && $(LN_S) lib$(MODULE).a $@
|
|
|
|
|
2000-03-04 23:31:27 +01:00
|
|
|
# Rules for checking that no imports are missing
|
|
|
|
|
|
|
|
IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
|
|
|
|
|
|
|
|
checklink:: lib$(MODULE).$(LIBEXT) $(IMPORTLIBS)
|
2000-04-24 19:17:49 +02:00
|
|
|
$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) -L$(TOPOBJDIR) -lwine $(EXTRALIBS) $(LIBS) && $(RM) checklink
|
2000-03-04 23:31:27 +01:00
|
|
|
|
|
|
|
$(IMPORTLIBS): dummy
|
|
|
|
@cd $(DLLDIR) && $(MAKE) `basename $@`
|
|
|
|
|
|
|
|
# Rules for installation
|
|
|
|
|
|
|
|
.PHONY: install_so install_a
|
|
|
|
|
|
|
|
install_so: lib$(MODULE).so.$(SOVERSION)
|
|
|
|
[ -d $(libdir) ] || $(MKDIR) $(libdir)
|
|
|
|
$(INSTALL_PROGRAM) lib$(MODULE).so.$(SOVERSION) $(libdir)/lib$(MODULE).so.$(SOVERSION)
|
2000-03-05 14:08:24 +01:00
|
|
|
cd $(libdir) && for i in $(ALLNAMES); do $(RM) $$i && $(LN_S) lib$(MODULE).so.$(SOVERSION) $$i; done
|
2000-03-04 23:31:27 +01:00
|
|
|
|
|
|
|
install_a: lib$(MODULE).a
|
|
|
|
[ -d $(libdir) ] || $(MKDIR) $(libdir)
|
|
|
|
$(INSTALL_DATA) lib$(MODULE).a $(libdir)/lib$(MODULE).a
|
|
|
|
|
|
|
|
install:: $(LIBEXT:%=install_%)
|
|
|
|
|
|
|
|
uninstall::
|
2000-03-05 14:08:24 +01:00
|
|
|
cd $(libdir) && $(RM) $(ALLNAMES) lib$(MODULE).so.$(SOVERSION) lib$(MODULE).a
|
2000-03-04 23:31:27 +01:00
|
|
|
|
|
|
|
clean::
|
|
|
|
$(RM) lib$(MODULE).so.$(SOVERSION)
|