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-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
|
|
|
|
#
|
|
|
|
|
2002-05-09 02:05:48 +02:00
|
|
|
DEFS = @DLLFLAGS@ -D__WINE__ $(EXTRADEFS)
|
|
|
|
DLLEXT = @DLLEXT@
|
|
|
|
ALTSPECS = $(ALTNAMES:%.dll=%)
|
|
|
|
SPEC_SRCS = $(ALTSPECS:%=%.spec)
|
2002-05-12 01:06:32 +02:00
|
|
|
MAINSPEC = $(MODULE:%.dll=%).spec
|
|
|
|
SPEC_DEF = $(MAINSPEC).def
|
2002-10-02 04:34:09 +02:00
|
|
|
WIN16_FILES = $(SPEC_SRCS:.spec=.spec.o) $(C_SRCS16:.c=.o) $(EXTRA_OBJS16)
|
|
|
|
ALL_OBJS = @WIN16_FILES@ $(OBJS) $(MODULE).dbg.o
|
2002-05-09 02:05:48 +02:00
|
|
|
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2002-03-20 23:19:06 +01:00
|
|
|
all: $(MODULE)$(DLLEXT)
|
2000-03-04 23:31:27 +01:00
|
|
|
|
|
|
|
@MAKE_RULES@
|
|
|
|
|
2002-08-01 20:36:58 +02:00
|
|
|
# Rules for .so files
|
2002-05-12 01:06:32 +02:00
|
|
|
|
|
|
|
$(MAINSPEC).c: $(MAINSPEC) $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
|
2002-11-06 21:02:59 +01:00
|
|
|
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ --spec $(SRCDIR)/$(MAINSPEC) $(RC_SRCS:%.rc=-r %.res) $(SYMBOLFILE) $(DLLMAIN:%=-e %) -L$(DLLDIR) $(DELAYIMPORTS:%=-d%) $(IMPORTS:%=-l%)
|
2002-05-12 01:06:32 +02:00
|
|
|
|
2002-08-01 20:36:58 +02:00
|
|
|
$(MODULE).so: $(MAINSPEC).o $(ALL_OBJS) Makefile.in
|
2002-11-21 04:47:45 +01:00
|
|
|
$(LDSHARED) $(LDDLLFLAGS) $(MAINSPEC).o $(ALL_OBJS) -o $@ -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(ALL_LIBS) -lc
|
2000-03-05 14:08:24 +01:00
|
|
|
|
2002-08-01 20:36:58 +02:00
|
|
|
$(MODULE).tmp.o: $(ALL_OBJS) Makefile.in
|
|
|
|
$(LDCOMBINE) $(ALL_OBJS) -o $@
|
|
|
|
-$(STRIP) --strip-unneeded $@
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2002-10-02 04:34:09 +02:00
|
|
|
# Rule for 16-bit glue
|
|
|
|
|
|
|
|
$(MODULE).glue.c: $(C_SRCS) $(C_SRCS16) $(WINEBUILD)
|
2002-11-06 21:02:59 +01:00
|
|
|
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ --glue -C$(SRCDIR) $(C_SRCS) $(C_SRCS16)
|
2002-10-02 04:34:09 +02:00
|
|
|
|
2000-12-22 23:28:00 +01:00
|
|
|
# Rules for .dll files
|
2001-09-17 22:09:08 +02:00
|
|
|
|
2002-07-30 01:28:09 +02:00
|
|
|
$(MODULE): $(RCOBJS) $(OBJS) $(MODULE).dbg.o $(SPEC_DEF) Makefile.in
|
2002-11-06 21:02:59 +01:00
|
|
|
$(DLLWRAP) $(DLLWRAPFLAGS) --def $(SPEC_DEF) --implib lib$(MODULE:.dll=.a) -o $@ $(RCOBJS) $(OBJS) $(MODULE).dbg.o $(DLLMAIN:%=--entry %) -L$(DLLDIR) $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(ALL_LIBS)
|
2002-05-12 01:06:32 +02:00
|
|
|
|
|
|
|
$(SPEC_DEF): $(WINEBUILD)
|
2000-12-22 23:28:00 +01:00
|
|
|
|
2000-03-04 23:31:27 +01:00
|
|
|
# Rules for checking that no imports are missing
|
|
|
|
|
2002-09-25 05:29:55 +02:00
|
|
|
CHECKLINK_RPATH = dlls library unicode
|
2002-05-22 23:32:49 +02:00
|
|
|
|
2002-10-30 00:14:11 +01:00
|
|
|
.PHONY: checklink16 $(WIN16_FILES:%=__checklink16__%)
|
|
|
|
|
|
|
|
$(WIN16_FILES:%=__checklink16__%): checklink16
|
|
|
|
|
|
|
|
checklink16:: $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o dummy
|
2002-10-02 04:34:09 +02:00
|
|
|
$(CC) -o checklink $(CHECKLINK_RPATH:%=-Wl,-rpath,$(TOPOBJDIR)/%) $(TOPSRCDIR)/library/checklink.c $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(ALL_LIBS) && $(RM) checklink
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2002-10-30 00:14:11 +01:00
|
|
|
checklink:: $(MODULE)$(DLLEXT) $(SUBDIRS:%=%/__checklink__) $(WIN16_FILES:%=__checklink16__%)
|
|
|
|
$(CC) -o checklink $(CHECKLINK_RPATH:%=-Wl,-rpath,$(TOPOBJDIR)/%) $(TOPSRCDIR)/library/checklink.c $(MODULE)$(DLLEXT) && $(RM) checklink
|
|
|
|
|
2002-01-10 04:30:21 +01:00
|
|
|
# Rules for testing
|
|
|
|
|
2002-08-09 03:22:40 +02:00
|
|
|
check test:: $(SUBDIRS:%=%/__test__)
|
|
|
|
|
2002-09-06 21:46:00 +02:00
|
|
|
crosstest:: $(SUBDIRS:%=%/__crosstest__)
|
|
|
|
|
2002-03-20 23:19:06 +01:00
|
|
|
$(TESTRESULTS): $(MODULE)$(DLLEXT)
|
2002-01-10 04:30:21 +01:00
|
|
|
|
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!
|
2002-06-01 04:55:48 +02:00
|
|
|
@exit 1
|
2001-05-07 20:22:43 +02:00
|
|
|
|
2000-03-04 23:31:27 +01:00
|
|
|
# Rules for installation
|
|
|
|
|
2002-10-02 04:34:09 +02:00
|
|
|
WIN16_INSTALL = $(ALTNAMES:%=_install_/%$(DLLEXT))
|
|
|
|
|
|
|
|
.PHONY: install_lib $(WIN16_INSTALL)
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2002-03-20 23:19:06 +01:00
|
|
|
$(ALTNAMES:%=_install_/%$(DLLEXT)): install_lib
|
|
|
|
cd $(dlldir) && $(RM) `basename $@` && $(LN_S) $(MODULE)$(DLLEXT) `basename $@`
|
2000-11-10 21:35:39 +01:00
|
|
|
|
2002-03-20 23:19:06 +01:00
|
|
|
install_lib: $(MODULE)$(DLLEXT)
|
2002-05-09 06:31:39 +02:00
|
|
|
$(MKINSTALLDIRS) $(dlldir)
|
2002-03-20 23:19:06 +01:00
|
|
|
$(INSTALL_PROGRAM) $(MODULE)$(DLLEXT) $(dlldir)/$(MODULE)$(DLLEXT)
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2002-10-02 04:34:09 +02:00
|
|
|
install:: install_lib @WIN16_INSTALL@
|
2000-03-04 23:31:27 +01:00
|
|
|
|
|
|
|
uninstall::
|
2002-03-20 23:19:06 +01:00
|
|
|
$(RM) $(dlldir)/$(MODULE)$(DLLEXT) $(ALTNAMES:%=$(dlldir)/%$(DLLEXT))
|
|
|
|
|
2001-09-17 22:09:08 +02:00
|
|
|
# End of global dll rules
|