+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
+prefix=@prefix@
+bindir=@bindir@
+datadir=@datadir@
+mydatadir=$(datadir)/et
thisconfigdir=.
myfulldir=util/et
mydir=.
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
#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
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),)
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