]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/mk-test.awk
ncurses 6.0 - patch 20160903
[ncurses.git] / test / mk-test.awk
index a89c150ef7298ae44050d7082852e5a360222117..81491768a9d197daac167206893d702cd9d53286 100644 (file)
@@ -1,6 +1,6 @@
-# $Id: mk-test.awk,v 1.4 2006/10/21 22:56:50 tom Exp $
+# $Id: mk-test.awk,v 1.13 2015/05/01 00:47:26 tom Exp $
 ##############################################################################
-# Copyright (c) 2006 Free Software Foundation, Inc.                          #
+# Copyright (c) 2006-2010,2015 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"), #
@@ -34,7 +34,13 @@ BEGIN        {
                first = 1;
                count = 0;
        }
-!/^#/  {
+/^#/   {
+               next;
+       }
+/^$/   {
+               next;
+       }
+       {
                if (first) {
                        print "# generated by mk-test.awk\n";
                        first = 0;
@@ -67,31 +73,52 @@ END {
        print   "sources:"
        print   ""
        print   "tags:"
-       print   "       ctags *.[ch]"
+       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   "install \\"
+               print   "install.test: $(BINDIR) $(TESTS)"
+               print   "       $(SHELL) -c 'for src in $(TESTS); do \\"
+               print   "       dst=`echo $$src | $(TRANSFORM)`; \\"
+               print   "       $(INSTALL_PROG) $$src $(BINDIR)/$$dst; \\"
+               print   "       done'"
+               print   ""
+               print   "uninstall \\"
+               print   "uninstall.test:"
+               print   "       $(SHELL) -c 'for src in $(TESTS); do \\"
+               print   "       dst=`echo $$src | $(TRANSFORM)`; \\"
+               print   "       rm -f $(BINDIR)/$$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   ""
        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) :"
+       print   "       mkdir -p $@"
+
 
        if (ECHO_LINK != "") {
                ECHO_LINK="@ echo linking $@ ... ;"