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
|
|
|
|
#
|
|
|
|
|
2001-04-11 01:22:22 +02:00
|
|
|
DEFS = @DLLFLAGS@ -D__WINE__ $(EXTRADEFS)
|
2000-03-04 23:31:27 +01:00
|
|
|
LIBEXT = @LIBEXT@
|
|
|
|
SONAME = lib$(MODULE).so
|
|
|
|
IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
|
2000-11-10 21:35:39 +01:00
|
|
|
SPEC_SRCS = $(ALTNAMES:%=%.spec)
|
2000-12-02 21:38:47 +01:00
|
|
|
ALL_OBJS = $(MODULE).spec.o $(OBJS)
|
2000-12-06 01:05:14 +01:00
|
|
|
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2001-09-17 22:09:08 +02:00
|
|
|
all: lib$(MODULE).$(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-12-22 23:28:00 +01:00
|
|
|
# Rules for .dll files
|
2001-09-17 22:09:08 +02:00
|
|
|
|
2000-12-22 23:28:00 +01:00
|
|
|
lib$(MODULE).dll: $(ALL_OBJS) Makefile.in
|
|
|
|
$(DLLWRAP) $(DLLWRAPFLAGS) --implib lib$(MODULE).a -o lib$(MODULE).dll $(ALL_OBJS) -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
|
|
|
|
|
2000-03-04 23:31:27 +01:00
|
|
|
# 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)
|
|
|
|
|
2001-05-07 20:22:43 +02:00
|
|
|
# Sanity check
|
|
|
|
|
|
|
|
Makedll.rules: $(TOPSRCDIR)/Makedll.rules.in $(TOPSRCDIR)/configure
|
|
|
|
@echo $? is newer than 'Makedll.rules', please rerun ./configure!
|
|
|
|
@exit 1
|
|
|
|
|
2000-03-04 23:31:27 +01:00
|
|
|
# Rules for installation
|
|
|
|
|
2001-09-17 22:09:08 +02:00
|
|
|
.PHONY: install_lib $(ALTNAMES:%=_install_/lib%.$(LIBEXT))
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2001-09-17 22:09:08 +02:00
|
|
|
$(ALTNAMES:%=_install_/lib%.$(LIBEXT)): install_lib
|
2000-11-10 21:35:39 +01:00
|
|
|
cd $(libdir) && $(RM) `basename $@` && $(LN_S) lib$(MODULE).$(LIBEXT) `basename $@`
|
|
|
|
|
2001-09-17 22:09:08 +02:00
|
|
|
install_lib: lib$(MODULE).$(LIBEXT)
|
2000-03-04 23:31:27 +01:00
|
|
|
[ -d $(libdir) ] || $(MKDIR) $(libdir)
|
2001-09-17 22:09:08 +02:00
|
|
|
$(INSTALL_PROGRAM) lib$(MODULE).$(LIBEXT) $(libdir)/lib$(MODULE).$(LIBEXT)
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2001-09-17 22:09:08 +02:00
|
|
|
install:: install_lib $(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))
|
2001-09-17 22:09:08 +02:00
|
|
|
|
|
|
|
# End of global dll rules
|