summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2001-01-18 01:05:22 +0000
committerKen Raeburn <raeburn@mit.edu>2001-01-18 01:05:22 +0000
commit4f75ee1e3b14017a62de5d15a0844cf524182677 (patch)
treeb973fc11d02bca0e5f155705b9e2ca311a603790 /src
parent233a0e3b1dec0016e4e00be05c6744ad515593b4 (diff)
downloadkrb5-4f75ee1e3b14017a62de5d15a0844cf524182677.tar.gz
krb5-4f75ee1e3b14017a62de5d15a0844cf524182677.tar.xz
krb5-4f75ee1e3b14017a62de5d15a0844cf524182677.zip
Make compile_et script installable, and install it.
Use it when building test programs too. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12910 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/util/et/ChangeLog14
-rw-r--r--src/util/et/Makefile.in30
-rw-r--r--src/util/et/compile_et.sh13
-rw-r--r--src/util/et/config_script11
4 files changed, 47 insertions, 21 deletions
diff --git a/src/util/et/ChangeLog b/src/util/et/ChangeLog
index 3bfd7b5b41..f88ea5c2c0 100644
--- a/src/util/et/ChangeLog
+++ b/src/util/et/ChangeLog
@@ -1,3 +1,17 @@
+2001-01-16 Ken Raeburn <raeburn@mit.edu>
+
+ * Makefile.in (test1.c, test2.c, et1.c, et2.c, test1.h, test2.h,
+ et1.h, et2.h): All depend on compile_et and awk scripts.
+ (prefix, bindir, datadir, mydatadir): New variables.
+ (install-unix): Install compile_et and awk scripts, and compile_et
+ man page.
+ (compile_et): Pass awk script install dir as extra argument.
+ (et_c.awk, et_h.awk): Delete targets for putting copies in build
+ tree.
+ * config_script: Take install dir as extra argument.
+ * compile_et.sh: Accept "-d DIR" to override awk script
+ directory. Set "-ex" shell flags before running awk commands.
+
2000-12-05 Ken Raeburn <raeburn@mit.edu>
* et_c.awk: Don't generate macros we won't use. Assume ANSI C
diff --git a/src/util/et/Makefile.in b/src/util/et/Makefile.in
index fc06d47f41..a6f85798a2 100644
--- a/src/util/et/Makefile.in
+++ b/src/util/et/Makefile.in
@@ -1,3 +1,7 @@
+prefix=@prefix@
+bindir=@bindir@
+datadir=@datadir@
+mydatadir=$(datadir)/et
thisconfigdir=.
myfulldir=util/et
mydir=.
@@ -82,8 +86,8 @@ test2.o: test2.c
test_et.o: test1.h test2.h
et1.o: et1.c
et2.o: et2.c
-test1.c test2.c et1.c et2.c: et_c.awk
-test1.h test2.h et1.h et2.h: et_h.awk
+test1.c test2.c et1.c et2.c test1.h test2.h et1.h et2.h: \
+ compile_et et_c.awk et_h.awk
t_com_err.o: et1.h et2.h t_com_err.c
# /u1/kr/lclint-2.5q/bin/lclint -warnposix -D__sparc
@@ -147,19 +151,17 @@ check-unix:: t_com_err test_et
#compile_et: compile_et.o error_table.o
# $(CC) $(CFLAGS) -o $@ compile_et.o error_table.o $(LEXLIB) $(BSDLIB)
#
-#install::
-# $(INSTALLPROG) compile_et $(DESTDIR)$(PROGDIR)/compile_et
+install-unix:: compile_et
+ $(INSTALL) compile_et $(DESTDIR)$(bindir)/compile_et
+ test -d $(DESTDIR)$(mydatadir) || mkdir $(DESTDIR)$(mydatadir)
+ $(INSTALL_DATA) $(srcdir)/et_c.awk $(DESTDIR)$(mydatadir)
+ $(INSTALL_DATA) $(srcdir)/et_h.awk $(DESTDIR)$(mydatadir)
compile_et: $(srcdir)/compile_et.sh $(srcdir)/config_script
$(SHELL) $(srcdir)/config_script $(srcdir)/compile_et.sh \
- $(AWK) $(SED) > compile_et
+ $(mydatadir) $(AWK) $(SED) > compile_et
chmod 755 compile_et
-et_c.awk: $(srcdir)/et_c.awk
- $(CP) $(srcdir)/et_c.awk et_c.awk
-et_h.awk: $(srcdir)/et_h.awk
- $(CP) $(srcdir)/et_h.awk et_h.awk
-
rebuild: rebuild-c rebuild-h
rebuild-c:
a2p < $(srcdir)/et_c.awk > $(srcdir)/et_c.tmp
@@ -179,10 +181,10 @@ install:: com_err.h
install:: mit-sipb-copyright.h
$(INSTALL_DATA) $(srcdir)/mit-sipb-copyright.h $(DESTDIR)$(KRB5_INCDIR)/mit-sipb-copyright.h
-#
-#install:: compile_et.1
-# $(INSTALL_DATA) $(srcdir)/compile_et.1 $(DESTDIR)$(CLIENT_MANDIR)/compile_et.1
-#
+
+install-unix:: compile_et.1
+ $(INSTALL_DATA) $(srcdir)/compile_et.1 $(DESTDIR)$(CLIENT_MANDIR)/compile_et.1
+
## install_library_target(com_err,$(LIBOBJS),$(LINTFILES),)
diff --git a/src/util/et/compile_et.sh b/src/util/et/compile_et.sh
index 2b17bffcf0..adb0be6662 100644
--- a/src/util/et/compile_et.sh
+++ b/src/util/et/compile_et.sh
@@ -4,8 +4,21 @@
AWK=@AWK@
DIR=@DIR@
+usage="usage: $0 [ -d scriptDir ] inputfile.et"
+
+if [ "$1" = "-d" ]; then
+ if [ $# -lt 3 ]; then
+ echo $usage 1>&2 ; exit 1
+ fi
+ DIR=$2 ; shift ; shift
+fi
+if [ $# -ne 1 ]; then
+ echo $usage 1>&2 ; exit 1
+fi
+
ROOT=`echo $1 | sed -e s/.et$//`
BASE=`echo $ROOT | sed -e 's;.*/;;'`
+set -ex
$AWK -f ${DIR}/et_h.awk outfile=${BASE}.h $ROOT.et
$AWK -f ${DIR}/et_c.awk outfile=${BASE}.c $ROOT.et
diff --git a/src/util/et/config_script b/src/util/et/config_script
index e3de35c878..ee3bb2702e 100644
--- a/src/util/et/config_script
+++ b/src/util/et/config_script
@@ -5,16 +5,13 @@
# @AWK@
# @SED@
#
-# Usage: config_script <filename> [<awk>] [<sed>]
+# Usage: config_script <filename> [<dir>] [<awk>] [<sed>]
#
FILE=$1
-AWK=$2
-SED=$3
-
-# Grr.... not all Unix's have the dirname command
-TMP=`echo $1 | sed -e 's;[^/]*$;;' -e 's/^$/./'`
-DIR=`cd ${TMP}; pwd`
+DIR=$2
+AWK=$3
+SED=$4
if test "${AWK}x" = "x" ; then
AWK=awk