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
|
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@
|
|
|
|
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-11-10 21:35:39 +01:00
|
|
|
SPEC_SRCS = $(ALTNAMES:%=%.spec)
|
|
|
|
ALL_OBJS = $(OBJS) $(MODULE).spec.o
|
|
|
|
ALL_LIBS = -L$(TOPOBJDIR) -lwine $(EXTRALIBS) $(LIBS)
|
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-11-10 21:35:39 +01:00
|
|
|
lib$(MODULE).so: $(ALL_OBJS) Makefile.in
|
|
|
|
$(LDSHARED) $(LDDLLFLAGS) $(ALL_OBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2000-11-10 21:35:39 +01:00
|
|
|
$(ALTNAMES:%=lib%.$(LIBEXT)): lib$(MODULE).$(LIBEXT)
|
|
|
|
$(RM) $@ && $(LN_S) lib$(MODULE).$(LIBEXT) $@
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2000-03-05 14:08:24 +01:00
|
|
|
# Rules for .a files
|
|
|
|
|
2000-11-10 21:35:39 +01:00
|
|
|
lib$(MODULE).a: $(ALL_OBJS) Makefile.in
|
2000-03-04 23:31:27 +01:00
|
|
|
$(RM) $@
|
2000-11-10 21:35:39 +01:00
|
|
|
$(AR) $@ $(ALL_OBJS)
|
2000-03-04 23:31:27 +01:00
|
|
|
$(RANLIB) $@
|
|
|
|
|
|
|
|
# Rules for checking that no imports are missing
|
|
|
|
|
2000-08-03 02:04:24 +02:00
|
|
|
checklink:: lib$(MODULE).$(LIBEXT)
|
2000-11-10 21:35:39 +01:00
|
|
|
$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) $(ALL_LIBS) && $(RM) checklink
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2000-11-05 05:53:07 +01:00
|
|
|
# Rules for debug channels
|
|
|
|
|
|
|
|
debug_channels: dummy
|
|
|
|
$(TOPSRCDIR)/tools/make_debug $(MODULE).spec $(C_SRCS) $(SUBDIRS:%=%/*.c)
|
|
|
|
|
2000-03-04 23:31:27 +01:00
|
|
|
# Rules for installation
|
|
|
|
|
|
|
|
.PHONY: install_so install_a
|
|
|
|
|
2000-11-10 21:35:39 +01:00
|
|
|
$(ALTNAMES:%=_install_/lib%.$(LIBEXT)): $(LIBEXT:%=install_%)
|
|
|
|
cd $(libdir) && $(RM) `basename $@` && $(LN_S) lib$(MODULE).$(LIBEXT) `basename $@`
|
|
|
|
|
|
|
|
install_so: lib$(MODULE).so
|
2000-03-04 23:31:27 +01:00
|
|
|
[ -d $(libdir) ] || $(MKDIR) $(libdir)
|
2000-11-10 21:35:39 +01:00
|
|
|
$(INSTALL_PROGRAM) lib$(MODULE).so $(libdir)/lib$(MODULE).so
|
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
|
|
|
|
|
2000-11-10 21:35:39 +01:00
|
|
|
install:: $(LIBEXT:%=install_%) $(ALTNAMES:%=_install_/lib%.$(LIBEXT))
|
2000-03-04 23:31:27 +01:00
|
|
|
|
|
|
|
uninstall::
|
2000-11-10 21:35:39 +01:00
|
|
|
cd $(libdir) && $(RM) lib$(MODULE).$(LIBEXT) $(ALTNAMES:%=lib%.$(LIBEXT))
|