+function make_lintlib(name,sources) {
+ print ""
+ print "clean ::"
+ printf "\trm -f llib-l%s.*\n", name
+ print ""
+ print "realclean ::"
+ printf "\trm -f llib-l%s\n", name
+ print ""
+ printf "llib-l%s : %s\n", name, sources
+ printf "\tcproto -a -l -DNCURSES_ENABLE_STDBOOL_H=0 -DLINT $(CPPFLAGS) %s >$@\n", sources
+ print ""
+ print "lintlib ::"
+ printf "\tsh $(srcdir)/../misc/makellib %s $(CPPFLAGS)\n", name
+ print ""
+ print "lint ::"
+ printf "\t$(LINT) $(LINT_OPTS) $(CPPFLAGS) %s $(LINT_LIBS)\n", sources
+}
+
+# A blank in "subsets" indicates a split-off of the library into a separate
+# file, e.g., for libtic or libtinfo. They are all logical parts of the same
+# library.
+function which_library() {
+ if ( ( which == "ticlib" ) && ( subsets ~ /ticlib / ) ) {
+ return ticlib;
+ } else if ( ( which == "termlib" || which == "ext_tinfo" ) && ( subsets ~ /[[:space:]]base/ ) ) {
+ return termlib;
+ } else {
+ return libname;
+ }
+}
+
+function show_list(name, len, list) {
+ if ( len > 0 ) {
+ printf "\n%s_SRC =", toupper(name);
+ for (n = 0; n < len; ++n)
+ printf " \\\n\t%s", list[n];
+ print "";
+ make_lintlib(name, sprintf("$(%s_SRC)", toupper(name)));
+ }
+}
+