1997-04-26 17:34:30 +04:00
|
|
|
#
|
|
|
|
# This is a Makefile stub which handles the creation of Linux DLL-style shared
|
|
|
|
# libraries.
|
|
|
|
#
|
|
|
|
# In order to use this stub, the following makefile variables must be defined.
|
|
|
|
#
|
|
|
|
# DLL_ADDRESS = 0x80000000
|
|
|
|
# DLL_JUMPSIZE = 0x1000
|
|
|
|
# DLL_GOTSIZE = 0x1000
|
|
|
|
# DLL_VERSION = 1.0
|
|
|
|
# DLL_IMAGE = libce
|
|
|
|
# DLL_STUB = libcom_err
|
|
|
|
# DLL_MYDIR = et
|
|
|
|
# DLL_INSTALL_DIR = $(SHLIBDIR)
|
|
|
|
#
|
|
|
|
|
1997-04-26 17:58:21 +04:00
|
|
|
all:: jump image stubs
|
|
|
|
|
|
|
|
subdirs:: jump jump/jump.funcs jump/jump.ignore jump/jump.import \
|
|
|
|
jump/jump.params jump/jump.undefs jump/jump.vars
|
|
|
|
|
|
|
|
jump:
|
|
|
|
mkdir jump
|
|
|
|
|
|
|
|
jump/jump.funcs: dll/jump.funcs
|
|
|
|
$(CP) $< $@
|
|
|
|
|
|
|
|
jump/jump.ignore: dll/jump.ignore
|
|
|
|
$(CP) $< $@
|
|
|
|
|
|
|
|
jump/jump.import: dll/jump.import
|
|
|
|
$(CP) $< $@
|
|
|
|
|
|
|
|
jump/jump.params: dll/jump.params
|
|
|
|
$(CP) $< $@
|
|
|
|
|
|
|
|
jump/jump.undefs: dll/jump.undefs
|
|
|
|
$(CP) $< $@
|
|
|
|
|
|
|
|
jump/jump.vars: dll/jump.vars
|
|
|
|
$(CP) $< $@
|
1997-04-26 17:34:30 +04:00
|
|
|
|
|
|
|
#
|
|
|
|
# This is a horrible hack to try to find libgcc.a --- the DLL documentation
|
|
|
|
# states that you should just be able to do -lgcc, but modern gcc
|
|
|
|
# installation packages don't install /usr/lib/libgcc.a --- as well they
|
|
|
|
# shouldn't since libgcc.a can be gcc version dependent.
|
|
|
|
# If this hack doesn't work, try replacing it with a hardcoded path to
|
|
|
|
# libgcc.a, or -lgcc.
|
|
|
|
#
|
|
|
|
#DLL_LIBGCC ="`$(CC) -v 2>&1 | head -1 | \
|
|
|
|
# sed -e 's;[^/]*;;' -e 's/specs/libgcc.a/'`"
|
|
|
|
DLL_LIBGCC ="`$(CC) --print-libgcc-file-name`"
|
|
|
|
|
|
|
|
image: $(DLL_IMAGE).so.$(DLL_VERSION)
|
|
|
|
|
|
|
|
stubs: $(DLL_STUB).sa $(OBJS)
|
|
|
|
|
|
|
|
$(DLL_IMAGE).so.$(DLL_VERSION): $(OBJS)
|
|
|
|
(cd jump; export JUMP_DIR=`pwd`; \
|
|
|
|
$(DLL_BIN)/mkimage -l $(DLL_IMAGE) -v $(DLL_VERSION) \
|
|
|
|
-a $(DLL_ADDRESS) -j $(DLL_JUMPSIZE) -g $(DLL_GOTSIZE) -- \
|
|
|
|
$(OBJS) -lc $(DLL_LIBS) $(DLL_LIBGCC) -lc)
|
1997-04-26 17:58:21 +04:00
|
|
|
$(MV) jump/$(DLL_IMAGE).so.$(DLL_VERSION) .
|
1997-04-26 18:25:20 +04:00
|
|
|
$(LN) -f $(DLL_IMAGE).so.$(DLL_VERSION) \
|
|
|
|
`echo ../$(DLL_IMAGE).so.$(DLL_VERSION) | \
|
|
|
|
sed -e 's/\.[0-9]*\$$//'`
|
1997-04-26 17:34:30 +04:00
|
|
|
|
|
|
|
$(DLL_STUB).sa:
|
|
|
|
(cd jump; export JUMP_DIR=`pwd`; \
|
|
|
|
$(DLL_BIN)/mkstubs -l $(DLL_IMAGE) -v $(DLL_VERSION) \
|
|
|
|
-a $(DLL_ADDRESS) -j $(DLL_JUMPSIZE) -g $(DLL_GOTSIZE) \
|
|
|
|
-- $(DLL_STUB))
|
1997-04-26 17:58:21 +04:00
|
|
|
$(MV) jump/$(DLL_STUB).sa .
|
|
|
|
$(RM) -f ../$@
|
|
|
|
$(LN) $@ ../$@
|
1997-04-26 17:34:30 +04:00
|
|
|
|
1997-04-26 17:58:21 +04:00
|
|
|
installdirs::
|
|
|
|
$(top_srcdir)/mkinstalldirs $(DESTDIR)$(DLL_INSTALL_DIR)
|
1997-04-26 17:34:30 +04:00
|
|
|
|
1997-04-26 17:58:21 +04:00
|
|
|
install-shlibs install:: $(DLL_IMAGE).so.$(DLL_VERSION) installdirs
|
|
|
|
$(INSTALL_PROGRAM) $(DLL_IMAGE).so.$(DLL_VERSION) \
|
|
|
|
$(DESTDIR)$(DLL_INSTALL_DIR)/$(DLL_IMAGE).so.$(DLL_VERSION)
|
1997-04-26 18:37:06 +04:00
|
|
|
$(STRIP) $(DESTDIR)$(DLL_INSTALL_DIR)/$(DLL_IMAGE).so.$(DLL_VERSION)
|
2001-05-20 02:07:36 +04:00
|
|
|
-$(LDCONFIG)
|
1997-04-26 17:34:30 +04:00
|
|
|
|
1998-04-01 06:51:21 +04:00
|
|
|
uninstall-shlibs unistall::
|
|
|
|
$(RM) $(DESTDIR)$(DLL_INSTALL_DIR)/$(DLL_IMAGE).so.$(DLL_VERSION)
|
|
|
|
|
1997-04-26 17:58:21 +04:00
|
|
|
install:: $(DLL_STUB).sa
|
1998-04-01 06:51:21 +04:00
|
|
|
$(INSTALL_DATA) $(DLL_STUB).sa $(DESTDIR)$(libdir)/$(DLL_STUB).sa
|
|
|
|
$(CHMOD) 644 $(DESTDIR)$(libdir)/$(DLL_STUB).sa
|
|
|
|
$(RANLIB) $(DESTDIR)$(libdir)/$(DLL_STUB).sa
|
|
|
|
$(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/$(DLL_STUB).sa
|
1997-04-26 17:34:30 +04:00
|
|
|
|
|
|
|
clean::
|
1997-04-26 18:25:20 +04:00
|
|
|
$(RM) -f ../$(DLL_STUB).sa $(DLL_STUB).sa \
|
|
|
|
$(DLL_IMAGE).so.$(DLL_VERSION) ../$(DLL_IMAGE).so.*
|
1997-04-26 17:58:21 +04:00
|
|
|
$(RM) -rf jump
|
1997-04-26 18:25:20 +04:00
|
|
|
|
|
|
|
|