automatically updates a library from a file listing of constituent .o
files. It only calls "ar" if it absolutely has to, in order to speed
things up for partial recompilations. (ar is dreadfully slow if
you're using one based on the BFD library.)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4602
dc483132-0cff-0310-8789-
dd5450dbe970
+Tue Nov 1 14:49:00 1994 (tytso@rsx-11)
+
+ * configure.in:
+ * Makefile.in:
+ * libupdate.sh: Add support for the new libupdate shell script.
+ It automatically updates a library from a file listing of
+ constituent .o files. It only calls "ar" if it absolutely
+ has to, in order to speed things up for partial
+ recompilations. (ar is dreadfully slow if you're using
+ one based on the BFD library.)
+
Tue Oct 11 19:07:09 1994 Mark Eichin (eichin@cygnus.com)
* kbuild (MAKETARGETS): default to "all check" for make, but allow
CFLAGS = $(CCOPTS)
LDFLAGS = -g
+editsh = sed -e 's,@''ARADD''@,$(ARADD),g' -e 's,@''ARCHIVE''@,$(ARCHIVE),g'
+
+all:: libupdate
+
+libupdate: $(srcdir)/libupdate.sh
+ rm -f $@ $@.tmp
+ $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
+
+clean::
+ $(RM) libupdate
+
install::
@echo nothing to install in util
WITH_CCOPTS
CONFIG_RULES
AC_SET_BUILDTOP
+AC_PROG_ARCHIVE
+AC_PROG_ARCHIVE_ADD
CONFIG_DIRS(et ss)
MAKE_SUBDIRS("making",all)
MAKE_SUBDIRS("cleaning",clean)
--- /dev/null
+#!/bin/sh
+#
+# libupdate: Update a library based on a file of object files.
+#
+# Usage: libupdate <library> <object filelist> <directory>
+#
+
+ARADD="@ARADD@"
+ARCHIVE="@ARCHIVE@"
+
+force=
+arcmd="$ARADD"
+if test "$1" = "--force"
+then
+ force=yes
+ arcmd="$ARCHIVE"
+ shift
+fi
+
+library=$1
+oblist=$2
+dir=$3
+
+if test "$force" != yes -a -f $library && \
+ ls -lt $library $oblist | head -1 | grep $library$ > /dev/null || \
+ test -z "`cat $oblist`"
+then
+ exit 0
+fi
+
+echo "Updating library $library from $oblist"
+
+$arcmd $library `cat $oblist | \
+ sed -e "s;^\([^ ]*\);$dir/\1;g" -e "s; \([^ ]*\); $dir/\1;g"`
+touch $library
+
+
+
+
+
+
+