2000-03-04 22:31:27 +00: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 13:08:24 +00:00
|
|
|
# ALTNAMES : alternate names for this dll (optional)
|
2000-03-04 22:31:27 +00:00
|
|
|
# IMPORTS : dlls to import (optional)
|
2000-04-24 17:17:49 +00:00
|
|
|
# EXTRALIBS : extra libraries to link in (optional)
|
2000-03-04 22:31:27 +00:00
|
|
|
#
|
|
|
|
# plus all variables required by the global Make.rules.in
|
|
|
|
#
|
|
|
|
|
2001-04-10 23:22:22 +00:00
|
|
|
DEFS = @DLLFLAGS@ -D__WINE__ $(EXTRADEFS)
|
2000-03-04 22:31:27 +00:00
|
|
|
LIBEXT = @LIBEXT@
|
|
|
|
IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
|
2000-11-10 20:35:39 +00:00
|
|
|
SPEC_SRCS = $(ALTNAMES:%=%.spec)
|
2000-12-02 20:38:47 +00:00
|
|
|
ALL_OBJS = $(MODULE).spec.o $(OBJS)
|
2000-12-06 00:05:14 +00:00
|
|
|
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
|
2000-03-04 22:31:27 +00:00
|
|
|
|
2001-09-17 20:09:08 +00:00
|
|
|
all: lib$(MODULE).$(LIBEXT)
|
2000-03-04 22:31:27 +00:00
|
|
|
|
|
|
|
@MAKE_RULES@
|
|
|
|
|
2000-03-05 13:08:24 +00:00
|
|
|
# Rules for .so files
|
|
|
|
|
2000-11-10 20:35:39 +00:00
|
|
|
lib$(MODULE).so: $(ALL_OBJS) Makefile.in
|
|
|
|
$(LDSHARED) $(LDDLLFLAGS) $(ALL_OBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
|
2000-03-04 22:31:27 +00:00
|
|
|
|
2000-12-22 22:28:00 +00:00
|
|
|
# Rules for .dll files
|
2001-09-17 20:09:08 +00:00
|
|
|
|
2000-12-22 22:28:00 +00: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 22:31:27 +00:00
|
|
|
# Rules for checking that no imports are missing
|
|
|
|
|
2000-08-03 00:04:24 +00:00
|
|
|
checklink:: lib$(MODULE).$(LIBEXT)
|
2000-11-10 20:35:39 +00:00
|
|
|
$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) $(ALL_LIBS) && $(RM) checklink
|
2000-03-04 22:31:27 +00:00
|
|
|
|
2002-01-10 03:30:21 +00:00
|
|
|
# Rules for testing
|
|
|
|
|
|
|
|
$(TESTRESULTS): lib$(MODULE).$(LIBEXT)
|
|
|
|
|
2000-11-05 04:53:07 +00:00
|
|
|
# Rules for debug channels
|
|
|
|
|
|
|
|
debug_channels: dummy
|
|
|
|
$(TOPSRCDIR)/tools/make_debug $(MODULE).spec $(C_SRCS) $(SUBDIRS:%=%/*.c)
|
|
|
|
|
2001-05-07 18:22:43 +00: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 22:31:27 +00:00
|
|
|
# Rules for installation
|
|
|
|
|
2001-09-17 20:09:08 +00:00
|
|
|
.PHONY: install_lib $(ALTNAMES:%=_install_/lib%.$(LIBEXT))
|
2000-03-04 22:31:27 +00:00
|
|
|
|
2001-09-17 20:09:08 +00:00
|
|
|
$(ALTNAMES:%=_install_/lib%.$(LIBEXT)): install_lib
|
2000-11-10 20:35:39 +00:00
|
|
|
cd $(libdir) && $(RM) `basename $@` && $(LN_S) lib$(MODULE).$(LIBEXT) `basename $@`
|
|
|
|
|
2001-09-17 20:09:08 +00:00
|
|
|
install_lib: lib$(MODULE).$(LIBEXT)
|
2000-03-04 22:31:27 +00:00
|
|
|
[ -d $(libdir) ] || $(MKDIR) $(libdir)
|
2001-09-17 20:09:08 +00:00
|
|
|
$(INSTALL_PROGRAM) lib$(MODULE).$(LIBEXT) $(libdir)/lib$(MODULE).$(LIBEXT)
|
2000-03-04 22:31:27 +00:00
|
|
|
|
2001-09-17 20:09:08 +00:00
|
|
|
install:: install_lib $(ALTNAMES:%=_install_/lib%.$(LIBEXT))
|
2000-03-04 22:31:27 +00:00
|
|
|
|
|
|
|
uninstall::
|
2000-11-10 20:35:39 +00:00
|
|
|
cd $(libdir) && $(RM) lib$(MODULE).$(LIBEXT) $(ALTNAMES:%=lib%.$(LIBEXT))
|
2001-09-17 20:09:08 +00:00
|
|
|
|
|
|
|
# End of global dll rules
|