X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fmk-test.awk;h=a194a5d4ee7fb322d18c5ac2a8a847d0460756da;hp=b752152da8e27c39bf156d356891b433f28e56d2;hb=1ddfa997c0965852dbdc738aa6d92c0cd0975f3b;hpb=cf94c7485f7b40ff7870b5bf9a65e7ab87481a76 diff --git a/test/mk-test.awk b/test/mk-test.awk index b752152d..a194a5d4 100644 --- a/test/mk-test.awk +++ b/test/mk-test.awk @@ -1,6 +1,7 @@ -# $Id: mk-test.awk,v 1.6 2010/04/03 15:32:15 tom Exp $ +# $Id: mk-test.awk,v 1.30 2021/12/19 16:54:36 tom Exp $ ############################################################################## -# Copyright (c) 2006-2007,2010 Free Software Foundation, Inc. # +# Copyright 2019-2020,2021 Thomas E. Dickey # +# Copyright 2006-2017,2018 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -67,37 +68,115 @@ END { } print ""; } + print "SCRIPTS = \\" + print " $(srcdir)/savescreen.sh \\" + print " $(srcdir)/tput-colorcube \\" + print " $(srcdir)/tput-initc \\" + print " $(srcdir)/tracemunch" + print "DATAFILES = \\" + print " $(srcdir)/*.x* \\" + print " $(srcdir)/*.dat" print "" - print "all: $(TESTS)" + print "all:: $(TESTS)" print "" print "sources:" print "" + print "check::" + print " @ echo The test-programs are interactive" print "tags:" print " $(CTAGS) *.[ch]" print "" + print "# no libraries here" print "libs \\" - print "install \\" print "install.libs \\" - print "install.test:" - print "" - print "uninstall:" print "uninstall.libs:" - print "uninstall.test:" + print "" + if (INSTALL == "yes") { + print "# we might install the test-programs" + print "$(PACKAGE) :" + print " @echo \"creating $(PACKAGE) script\"" + print " @$(SHELL) -c '\\" + print " L=$(real_bindir); \\" + print " rm -f $@; \\" + print " echo \"#!$(SHELL)\" > $@;\\" + print " echo \"PATH=\\\"$$L\\\":\\$$PATH\" >>$@;\\" + print " echo \"export PATH\" >>$@;\\" + print " echo \"if test \\$$# != 0; then\" >>$@;\\" + print " echo \" exec \\\"\\$$@\\\"\" >>$@;\\" + print " echo \"elif test -t 1; then\" >>$@;\\" + print " echo \" cd \\\"$$L\\\" || exit\" >>$@;\\" + print " echo \" ls -l | \\$${PAGER:-less}\" >>$@;\\" + print " echo \"fi\" >>$@;\\" + print " echo \"echo \\\"usage: $@ [program]\\\"\" >>$@'" + print "" + print "install \\" + print "install.test: $(PACKAGE) $(BINDIR) $(REAL_BINDIR) $(DATADIR) $(TESTS)" + + print " @echo \"installing $(PACKAGE) -> $(BINDIR)/\"" + print " @$(INSTALL_SCRIPT) $(PACKAGE) $(BINDIR)" + + print " @$(SHELL) -c 'for src in $(TESTS); do \\" + print " dst=`echo $$src | $(TRANSFORM)`; \\" + print " echo \"installing $$src -> $(REAL_BINDIR)/$$dst\"; \\" + print " $(INSTALL_PROG) $$src $(REAL_BINDIR)/$$dst; \\" + print " done'" + + print " @$(SHELL) -c 'for src in $(SCRIPTS); do \\" + print " dst=`echo $$src | sed -e 's,^.*/,,' | $(TRANSFORM)`; \\" + print " echo \"installing $$src -> $(REAL_BINDIR)/$$dst\"; \\" + print " $(INSTALL_SCRIPT) $$src $(REAL_BINDIR)/$$dst; \\" + print " done'" + + print " @$(SHELL) -c 'for src in $(DATAFILES); do \\" + print " dst=`echo $$src | sed -e 's,^.*/,,'`; \\" + print " echo \"installing $$src -> $(DATADIR)/$$dst\"; \\" + print " $(INSTALL_DATA) $$src $(DATADIR)/$$dst; \\" + print " done'" + print "" + print "uninstall \\" + print "uninstall.test:" + + print " -rm -f $(BINDIR)/$(PACKAGE)" + + print " @$(SHELL) -c 'for src in $(TESTS); do \\" + print " dst=`echo $$src | $(TRANSFORM)`; \\" + print " rm -f $(REAL_BINDIR)/$$dst; \\" + print " done'" + + print " @$(SHELL) -c 'for src in $(SCRIPTS); do \\" + print " dst=`echo $$src | sed -e 's,^.*/,,' | $(TRANSFORM)`; \\" + print " rm -f $(REAL_BINDIR)/$$dst; \\" + print " done'" + + print " @$(SHELL) -c 'for src in $(DATAFILES); do \\" + print " dst=`echo $$src | sed -e 's,^.*/,,'`; \\" + print " rm -f $(DATADIR)/$$dst; \\" + print " done'" + } else { + print "install \\" + print "install.test \\" + print "uninstall \\" + print "uninstall.test:" + } print "" print "mostlyclean ::" print " -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace" print "" print "clean :: mostlyclean" - print " -sh -c \"if test -n '$x' ; then $(MAKE) clean x=''; fi\"" - print " -rm -rf *$o screendump *.lis $(TESTS) .libs" + print " -$(SHELL) -c \"if test -n '$x' ; then $(MAKE) clean x=''; fi\"" + print " -rm -rf *$o screendump *.lis $(TESTS) .libs *.dSYM" + print " -rm -f $(PACKAGE)" print "" print "distclean :: clean" - print " -rm -f Makefile ncurses_cfg.h config.*" + print " -rm -f Makefile ncurses_cfg.h config.status config.log" print "" print "realclean :: distclean" print "" print "lint:" - print " sh -c 'for N in $(TESTS); do echo LINT:$$N; $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/$$N.c $(LINT_LIBS); done'" + print " $(SHELL) -c 'for N in $(TESTS); do echo LINT:$$N; $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/$$N.c $(LINT_LIBS); done'" + print "$(BINDIR) $(REAL_BINDIR) $(DATADIR) :" + print " mkdir -p $@" + if (ECHO_LINK != "") { ECHO_LINK="@ echo linking $@ ... ;"