X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=mk-0th.awk;h=fe91cca689f65883f5eb2fe3e3a9f72a294d722a;hp=b7a40fdc18097e7f8c06b1334e11b5d20bfde83e;hb=e9d205b51699dd452427c908758daa13cccfe2f6;hpb=661078ddbde3ce0f3b06e95642fbb9b5fef7dca1 diff --git a/mk-0th.awk b/mk-0th.awk index b7a40fdc..fe91cca6 100644 --- a/mk-0th.awk +++ b/mk-0th.awk @@ -1,6 +1,6 @@ -# $Id: mk-0th.awk,v 1.7 1998/02/11 12:13:52 tom Exp $ +# $Id: mk-0th.awk,v 1.17 2005/01/22 16:31:40 tom Exp $ ############################################################################## -# Copyright (c) 1998 Free Software Foundation, Inc. # +# Copyright (c) 1998-2004,2005 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"), # @@ -32,26 +32,50 @@ # Generate list of sources for a library, together with lint/lintlib rules # # Variables: -# name (library name, e.g., "ncurses", "panel", "forms", "menus") +# libname (library name, e.g., "ncurses", "panel", "forms", "menus") +# subsets (is used here to decide if wide-character code is used) # BEGIN { - print "" - print "# generated by mk-0th.awk" - print "" + using = 0; found = 0; } !/^[@#]/ { - if ( $0 != "" ) + if (using == 0) + { + print "" + print "# generated by mk-0th.awk" + printf "# libname: %s\n", libname + printf "# subsets: %s\n", subsets + print "" + print ".SUFFIXES: .c .cc .h .i .ii" + print ".c.i :" + printf "\t$(CPP) $(CPPFLAGS) $< >$@\n" + print ".cc.ii :" + printf "\t$(CPP) $(CPPFLAGS) $< >$@\n" + print ".h.i :" + printf "\t$(CPP) $(CPPFLAGS) $< >$@\n" + print "" + using = 1; + } + if ( $0 != "" && $1 != "link_test" ) { if ( found == 0 ) { + if ( subsets ~ /widechar/ ) + widechar = 1; + else + widechar = 0; printf "C_SRC =" if ( $2 == "lib" ) found = 1 else found = 2 } - printf " \\\n\t%s/%s.c", $3, $1 + if ( libname == "c++" || libname == "c++w" ) { + printf " \\\n\t%s/%s.cc", $3, $1 + } else if ( widechar == 1 || $3 != "$(wide)" ) { + printf " \\\n\t%s/%s.c", $3, $1 + } } } END { @@ -59,19 +83,19 @@ END { if ( found == 1 ) { print "" - printf "# Producing llib-l%s is time-consuming, so there's no direct-dependency for\n", name + printf "# Producing llib-l%s is time-consuming, so there's no direct-dependency for\n", libname print "# it in the lintlib rule. We'll only remove in the cleanest setup." print "clean ::" - printf "\trm -f llib-l%s.*\n", name + printf "\trm -f llib-l%s.*\n", libname print "" print "realclean ::" - printf "\trm -f llib-l%s\n", name + printf "\trm -f llib-l%s\n", libname print "" - printf "llib-l%s : $(C_SRC)\n", name - printf "\tcproto -a -l -DLINT $(CPPFLAGS) $(C_SRC) >$@\n" + printf "llib-l%s : $(C_SRC)\n", libname + printf "\tcproto -a -l -DNCURSES_ENABLE_STDBOOL_H=0 -DLINT $(CPPFLAGS) $(C_SRC) >$@\n" print "" print "lintlib :" - printf "\t$(srcdir)/../misc/makellib %s $(CPPFLAGS)", name + printf "\tsh $(srcdir)/../misc/makellib %s $(CPPFLAGS)", libname print "" print "lint :" print "\t$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(C_SRC) $(LINT_LIBS)"