1996-05-04 19:45:30 +04:00
|
|
|
# $NetBSD: makeconf.awk,v 1.3 1996/05/04 15:45:32 pk Exp $
|
|
|
|
|
|
|
|
#
|
|
|
|
# generate crunchgen(1) configuration file from `list' spec.
|
|
|
|
#
|
1995-12-19 01:47:26 +03:00
|
|
|
|
|
|
|
BEGIN {
|
1996-05-04 19:45:30 +04:00
|
|
|
printf("#\n# This file is automatically generated by `makeconf'\n#\n\n");
|
|
|
|
printf("\nlibs -ledit -lutil -lcurses -ltermcap -lcrypt -ll -lm -lkvm\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$1 == "SRCDIRS" {
|
|
|
|
$1 = tolower($1);
|
|
|
|
print;
|
1995-12-19 01:47:26 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
($1 == "LINK" || $1 == "SYMLINK") && index($2,CBIN) {
|
1996-05-04 19:45:30 +04:00
|
|
|
# find basenames for inclusion in crunchgen's `prog' and `ln' directives
|
1995-12-19 01:47:26 +03:00
|
|
|
n = split($3, x, "/");
|
|
|
|
p = x[n];
|
1996-05-04 19:45:30 +04:00
|
|
|
progs[p] = NF - 3;
|
|
|
|
for (i = 4; i <= NF; i++) {
|
|
|
|
n = split($i, x, "/");
|
|
|
|
l = x[n];
|
|
|
|
links[i - 3, p] = l;
|
1995-12-19 01:47:26 +03:00
|
|
|
}
|
1996-05-04 19:45:30 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
$1 == "ARGVLINK" {
|
|
|
|
# add extra `ln' entries (these don't appear in the filesystem)
|
|
|
|
n = progs[$2];
|
|
|
|
progs[$2] = ++n;
|
|
|
|
links[n, $2] = $3;
|
|
|
|
}
|
|
|
|
|
|
|
|
$1 == "CRUNCHSPECIAL" {
|
|
|
|
# collect crunchgen `special' directives
|
|
|
|
$1 = "";
|
|
|
|
specials[$0] = 1;
|
1995-12-19 01:47:26 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
END {
|
|
|
|
# write crunchgen configuration
|
|
|
|
|
1996-05-04 19:45:30 +04:00
|
|
|
# `prog' directives; print 8 to a line
|
|
|
|
column = 0;
|
1995-12-19 01:47:26 +03:00
|
|
|
for (p in progs) {
|
1996-05-04 19:45:30 +04:00
|
|
|
if ((column++ % 8) == 0)
|
1995-12-19 01:47:26 +03:00
|
|
|
printf("\nprogs");
|
|
|
|
printf(" %s", p);
|
|
|
|
}
|
|
|
|
printf("\n\n");
|
|
|
|
|
1996-05-04 19:45:30 +04:00
|
|
|
# `ln' directives
|
|
|
|
for (p in progs) {
|
|
|
|
n = progs[p];
|
|
|
|
for (i = 1; i <= n; i++)
|
|
|
|
printf("ln %s %s\n", p, links[i,p]);
|
1995-12-19 01:47:26 +03:00
|
|
|
}
|
1996-05-04 19:45:30 +04:00
|
|
|
printf("\n\n");
|
1995-12-19 01:47:26 +03:00
|
|
|
|
1996-05-04 19:45:30 +04:00
|
|
|
# `special' directives
|
|
|
|
for (s in specials) {
|
|
|
|
printf("special %s\n", s);
|
|
|
|
}
|
1995-12-19 01:47:26 +03:00
|
|
|
}
|