1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983
|
/*
* cook - file construction tool
* Copyright (C) 1994-1999, 2001-2004, 2006-2009 Peter Miller
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see
* <http://www.gnu.org/licenses/>.
*/
/*
* remove targets before running recipe bodies
*/
set unlink;
/*
* make directories above targets before running recipe bodies
*/
set mkdir;
/*
* Update file times if necessary, to ensure outputs are newer then inputs.
* On fast machines, that happens frequently for transitive dependencies.
*/
set time-adjust;
/*
* You may want to change some of these options.
* ([debug] must be defined, even if empty, use comments.)
*
* If you want to turn the DEBUG compile flag on,
* edit the common/main.h file.
*/
debug = -g ;
/*
* Make sure the [project], [change], [version] and [arch] variables are set.
*/
#ifndef project
echo "The [project] variable was not set from the command line." set silent;
echo "If you want to do a build which is not a development build" set silent;
echo "or an integration build, use the make command, not cook." set silent;
fail;
#endif
#ifndef change
echo "The [change] variable was not set from the command line." set silent;
echo "If you want to do a build which is not a development build" set silent;
echo "or an integration build, use the make command, not cook." set silent;
fail;
#endif
#ifndef version
echo "The [version] variable was not set from the command line." set silent;
echo "If you want to do a build which is not a development build" set silent;
echo "or an integration build, use the make command, not cook." set silent;
fail;
#endif
#ifndef arch
echo "The [arch] variable was not set from the command line." set silent;
echo "If you want to do a build which is not a development build" set silent;
echo "or an integration build, use the make command, not cook." set silent;
fail;
#endif
#ifndef search_path
echo "The [search_path] variable was not set from the command line." set silent;
echo "If you want to do a build which is not a development build" set silent;
echo "or an integration build, use the make command, not cook." set silent;
fail;
#endif
/*
* The first item in search list should be the absolute path of the
* current directory. Assume that it is.
*/
search_list = .;
search_tmp = [tail [split ':' [search_path]]];
/*
* Try to shorten the search path in command lines, too.
*
* This takes a little getting used to....
* 1. For development builds, the search path is dev dir, then branch bl,
* then ... project bl. Thus, bl in a dev dir winds up pointing to
* the branch repository.
* 2. For integration builds, aegis deliberately omits the branch
* baseline from the path, but include's the branch's parents and
* ancestors. Thus, bl in an int dir winds up pointing to the
* branch's parent's reporitory.
* The idea is that integration builds in a branch are like a
* development build of the branch's dev dir.
*/
search_name = bl;
loop
{
search_dir = [head [search_tmp]];
if [not [search_dir]] then
loopstop;
search_tmp = [tail [search_tmp]];
if [not [exists [search_name]]] then
ln -s [search_dir] [search_name]
set clearstat;
search_list = [search_list] [search_name];
search_name = [search_name]bl;
}
/*
* If this is a development build, the version will be x.y.Czzz,
* so look to see if there is a C in the version string.
*/
if [match_mask %1C%2 [version]] then
{
/*
* The develop_begin_command in the config file
* always creates the "bl" symbolic link.
*/
baseline = bl;
}
if [not [defined baseline]] then
{
/*
* Turn on aggressive updating to ensure the smallest possible
* range of mod times at aeipass. This also ensures mod time
* consistency on fast machines.
*/
set time-adjust-back;
}
else
{
/*
* Use finger prints for development builds.
* They avoid much of the tedium.
*/
set fingerprint;
}
/*
* determine the short version:
* no change or delta number
*/
version_short = [fromto %1.C%2 %1 [subst D C [version]]];
version_shorter = [split "." [version_short]] _ _;
version_shorter = [unsplit "." [word 1 [version_shorter]]
[word 2 [version_shorter]]];
project_short = [fromto %.[version_short] % [project]];
project_minus = [project_short]-[version_short];
/*
* This file is generated by autoconf.
* It is architecture specific.
* If it is not found (not cooked yet) the following
* symbols will be undefined.
*
* Must be included *after* the search_list is defined.
*/
#include-cooked-nowarn [arch]/etc/Howto.conf
if [not [defined prefix]] then
prefix = /usr/local;
if [not [defined exec_prefix]] then
exec_prefix = [prefix];
if [not [defined yacc]] then
yacc = yacc;
if [not [defined libs]] then
libs = ;
if [not [defined cc]] then
cc = ['if' [find_command gcc] 'then' gcc 'else' cc];
awk = gawk;
/*
* The source files.
* This is given to us by aegis.
*/
vs_file = common/patchlevel.h;
change_files = ;
#include-cooked-nowarn etc/cook/change_files.[version]
etc/cook/change_files.[version]:
set shallow nodefault
{
echo "'change_files ='" > [target];
aegis -l cf -p [project] -c [change] -unf
| [awk] "'/^build/{next};$2==\"remove\"{next};{print $NF}'"
>> [target];
echo "';'" >> [target];
}
project_files = ;
#include-cooked-nowarn etc/cook/project_files.[version]
etc/cook/project_files.[version]:
set shallow nodefault
{
echo "'project_files ='" > [target];
aegis -l pf -p [project] -c [change] -unf
| [awk] "'/^build/{next};$2==\"remove\"{next};{print $NF}'"
>> [target];
echo "';'" >> [target];
}
source_files =
[sort [stringset [project_files] [change_files]]]
[vs_file] etc/version.so
;
/*
* Speed up graph building by stating the leaves explictly.
* This also gives more useful error messages.
*/
if [count [project_files]] then
if [count [change_files]] then
{
/* obsolete */ leaf_file_accept = [project_files] [change_files];
graph_leaf_file = [project_files] [change_files];
/* obsolete */ leaf_pattern_accept = /%0%;
graph_leaf_pattern = /%0%;
}
source_files = [source_files]
[fromto
lib/%1/readme/main.%2 lib/%1/readme/new.so
[match_mask lib/%1/readme/main.%2 [source_files]]
]
[fromto
lib/%1/refman/main.%2 lib/%1/refman/index.so
[match_mask lib/%1/refman/main.%2 [source_files]]
]
[fromto
lib/%1/refman/main.%2 lib/%1/refman/parts.so
[match_mask lib/%1/refman/main.%2 [source_files]]
]
[fromto
lib/%1/user-guide/main.%2 lib/%1/user-guide/function.so
[match_mask lib/%1/user-guide/main.%2 [source_files]]
]
[fromto
lib/%1/user-guide/main.%2 lib/%1/user-guide/system.list.so
[match_mask lib/%1/user-guide/main.%2 [source_files]]
];
/*
* There is a special list of files you must use, in preference to the
* standard C files. This ensures appropriate operating system insulation
* is always in place.
*/
c_incl_excludes =
[fromto common/ac/%0%.h -ex\=%0%.h
[match_mask common/ac/%0%.h [source_files]]
];
/*
* determine the list of commands,
* and their object file lists
*/
commands =
[stringset
[fromto %1/%0%2 %1 [match_mask %1/%0%2.c [source_files]]]
[fromto %1/%0%2 %1 [match_mask %1/%0%2.y [source_files]]]
-
common
];
cmd_list = [commands];
loop
{
cmd = [head [cmd_list]];
if [not [cmd]] then
loopstop;
cmd_list = [tail [cmd_list]];
[cmd]_obj =
[fromto [cmd]/%0%.y [arch]/[cmd]/%0%.gen.o
[match_mask [cmd]/%0%.y [source_files]]
]
[fromto [cmd]/%0%.c [arch]/[cmd]/%0%.o
[match_mask [cmd]/%0%.c [source_files]]
]
[arch]/common/lib.a
[arch]/common/version-stmp.o
;
[cmd],I =
[fromto [cmd]/%0%.y [cmd]/%0%.gen.c,I
[match_mask [cmd]/%0%.y [source_files]]
]
[fromto [cmd]/%0%.c [cmd]/%0%.c,I
[match_mask [cmd]/%0%.c [source_files]]
]
;
}
/*
* The default recipe
*/
all =
doc.targets
[prepost [arch]/bin/ "" [commands]]
internationalization
[fromto script/%.in [arch]/bin/%
[match_mask script/%.in [source_files]]
]
;
all: [all]
set default;
common_obj = [arch]/common/lib.a [arch]/common/version-stmp.o;
lib_obj =
[stringset
[fromto
common/%0%.c
[arch]/common/%0%.o
[match_mask common/%0%.c [source_files]]
]
[fromto
common/%0%.y
[arch]/common/%0%.gen.o
[match_mask common/%0%.y [source_files]]
]
-
[common_obj]
];
lib_srcs =
[match_mask lib/% [source_files]]
;
/*
* how to compile C sources
*/
cc_flags = -O2 [debug];
cc_include_flags = ;
/*
* this next section is for gcc
* comment it out if you don't have gcc
*
* The gcc include files MUST be first.
*/
if [in [cc] gcc] then
{
local Wextra = "-W";
g++_v34 =
[collect
g++ -dumpversion |
cut -d. -f1,2 |
[awk] "'{print ($1 >= 3.4)}'"
];
if [g++_v34] then
Wextra = -Wextra -Wold-style-definition;
cc_flags +=
-ansi
-Wall
-Wmissing-declarations
-Wmissing-prototypes
[Wextra]
-Wpointer-arith
-Wshadow
-Wstrict-prototypes
/* -Wswitch-enum */
;
if [in [arch] linux-i486 linux-x86_64 sun5] then
if [defined baseline] then
cc_flags += -Werror -fno-builtin;
}
/*
* include files from the common directory.
*/
cc_include_flags =
[cc_include_flags]
[prepost "-I" /[arch] [search_list]]
[addprefix "-I" [search_list]]
;
/*
* Build %.o from %.c
*/
[arch]/%1/%0%2.o: %1/%0%2.c
single-thread %2.o
{
extra = [cc_flags];
if [defined %2_flags] then
extra = [extra] [%2_flags];
if [match %%.gen %2] then
{
/*
* Generated files may have warnings, because we have no
* control over the quality of generated code (usually
* warnings about missing prototypes or unreferenced
* labels).
*/
extra = [stringset [extra] - -Werror];
}
[cc] [extra]
[cc_include_flags]
-c [resolve %1/%0%2.c]
['if' [in gcc [cc]] 'then' -o [target]];
if [not [in gcc [cc]]] then
mv %2.o [target];
}
%1/%0%2.c.d: %1/%0%2.c
set no-cascade
{
c_incl
-nc /* no cache */
-ns /* no system */
-eia /* empty if absent */
-nrec /* no recursion */
[cc_include_flags]
-prefix "'cascade %1/%0%2.c ='"
-suffix "';'" [resolve %1/%0%2.c]
-nsri /* no source relative includes */
[prepost "-rlp=" "" [search_list]] /* remove leading path */
-slp [arch] "'[arch]'" /* substitute leading path */
['if' [not [filter common/ac/%%0%% %1/%0%2.c]]
'then'
[c_incl_excludes]
]
-o [target];
}
%1/%0%2.h.d: %1/%0%2.h
set no-cascade
{
c_incl
-nc /* no cache */
-ns /* no system */
-eia /* empty if absent */
-nrec /* no recursion */
[cc_include_flags]
-prefix "'cascade %1/%0%2.h ='"
-suffix "';'" [resolve %1/%0%2.h]
-nsri /* no source relative includes */
[prepost "-rlp=" "" [search_list]] /* remove leading path */
-slp [arch] "'[arch]'" /* substitute leading path */
['if' [not [filter common/ac/%%0%% %1/%0%2.h]]
'then'
[c_incl_excludes]
]
-o [target];
}
c-dep-files =
[fromto %0% %0%.d [match_mask %0%.c [source_files]]]
[fromto %0%.y %0%.gen.c.d [match_mask %0%.y [source_files]]]
;
h-dep-files =
[fromto %0% %0%.d [match_mask %0%.h [source_files]]]
[fromto %0%.y %0%.gen.h.d [match_mask %0%.y [source_files]]]
;
ac-h-files = [match_mask common/ac/%0%.h [source_files]] ;
#if [count [ac-h-files]]
cascade [ac-h-files] = [arch]/common/config.h;
#endif
#include-cooked-nowarn [c-dep-files] [h-dep-files]
/*
* Dependencies on generated files are impossible to determine a priori.
* Catch 22: you need the files to exist to determine whether you need
* them to exist. Sigh.
*/
cascade common/libdir.c = [arch]/etc/libdir-h;
cascade common/sub/expr_lex.c = common/sub/expr_gram.gen.h;
cascade common/version-stmp.c = [vs_file];
cascade cook/fingerprint/lex.c = cook/fingerprint/gram.gen.h;
cascade cook/lex.c = cook/parse.gen.h cook/hashline.gen.h;
cascade lib/en/readme/main.man = lib/en/readme/new.so;
cascade make2cook/lex.c = make2cook/gram.gen.h;
cascade make2cook/variable.c = make2cook/vargram.gen.h;
cascade cook/builtin/expr_lex.c = cook/builtin/expr_parse.gen.h;
/*
* How to use yacc sources.
*/
yacc = bison -y;
yacc_flags = -v;
%1/%0%2.gen.c %1/%0%2.gen.h: %1/%0%2.y
single-thread y.tab.c y.tab.h y.output
{
rm -f %1/%0%2.list y.output
set silent;
if [exists %1/%0%2.gen.c] then
rm %1/%0%2.gen.c
set clearstat;
if [exists %1/%0%2.gen.h] then
rm %1/%0%2.gen.h
set clearstat;
[yacc] -d [yacc_flags] [resolve %1/%0%2.y];
yy = [collect echo %0%2 | sed "'s/[^a-zA-Z0-9]/_/g'"];
sed -e "'s/\[yY\]\[yY\]/"[yy]"_/g'"
-e "'/<stdio.h>/d'"
-e "'/<stdlib.h>/d'"
-e "'/<stddef.h>/d'"
-e "'/<libintl.h>/d'"
y.tab.c > %1/%0%2.gen.c;
rm y.tab.c;
sed -e \'s/\[yY\]\[yY\]/[yy]_/g\'
-e \'s/Y_TAB_H/[yy]_TAB_H/\'
y.tab.h > %1/%0%2.gen.h;
rm y.tab.h;
if [exists y.output] then
mv y.output %1/%0%2.list
set clearstat;
}
/*
* build the scripts
*/
[arch]/bin/%: script/%.in [arch]/config.status
single-thread conftest.subs
{
CONFIG_FILES\=[target]\:[resolve script/%.in] CONFIG_HEADERS\=
[resolve [arch]/config.status];
chmod a+rx [target];
}
/*
* build the programs
*/
[arch]/bin/%: [%_obj]
{
[cc] [debug] -o [target] [resolve [%_obj]] [libs];
chmod 755 [target];
}
/*
* The version stamp is to be updated for every
* integration and development build.
* (The integrate_begin_command in the config file
* deletes them for integration builds.)
*/
[vs_file]:
set shallow
{
copyright_years =
[collect
aegis -list version -p [project] -c [change]
| [awk] "-F'[[\\\\]]'" "'/^copyright_years/{print $2}'"
];
echo "'#define PATCHLEVEL \""[version]"\"'" > [target];
echo "'#define COPYRIGHT_YEARS \""[copyright_years]"\"'" >> [target];
}
/*
* Not a shallow recipe because content changes according to Aegis, not
* cookable.
*/
etc/version.so:
set ['if' [or [not [defined baseline] ] [not [exists bl/etc/version.so
] ] ] 'then' shallow]
{
copyright_years =
[collect
aegis -list version -p [project] -c [change]
| [awk] "-F'[[\\\\]]'" "'/^copyright_years/{print $2}'"
];
echo "'.ds V) "[version]"'" > [target];
echo "'.ds v) "[version_short]"'" >> [target];
aegis -list version -p [project] -c [change]
| [awk] -F'\'"\'' "'/previous/{print $2}'"
| [awk] -F. "'{print \".ds w) \"$1\".\"$2}'"
>> [target];
echo "'.ds Y) "[copyright_years]"'" >> [target];
}
/*
* formatting documents and manual entries
*/
doc.targets: cat txt special;
/*
* manual entries
*/
cat =
[fromto lib/%3/man%1/%2.%1 lib/%3/cat%1/%2.%1
[match_mask lib/%3/man%1/%2.%1 [source_files]]
];
cat: [cat];
lib/%3/cat%1/%2.%1: lib/%3/man%1/%2.%1
{
roffpp
[prepost "-I" "/lib/%3/man%1" [search_list]]
[prepost "-I" /[arch]/etc [search_list]]
[prepost "-I" "/etc" [search_list]]
[resolve lib/%3/man%1/%2.%1]
| GROFF_NO_SGR\=-c
groff -Tascii -t -man
> [target];
}
lib/%3/man%1/%2.%1.d: lib/%3/man%1/%2.%1
set no-cascade
{
c_incl -nc -ns -eia -r
-nrec /* no recursion */
[stringset
[cc_include_flags]
[prepost "-I" "/lib/%3/man%1" [search_list]]
[prepost "-I" /[arch]/etc [search_list]]
[prepost "-I" "/etc" [search_list]]
]
-prefix "'cascade lib/%3/man%1/%2.%1 ='"
-suffix "';'"
[resolve lib/%3/man%1/%2.%1]
[prepost "-rlp=" "" [search_list]] /* remove leading path */
-slp [arch] "'[arch]'" /* substitute leading path */
-o [target];
}
%0%.so.d: %0%.so
set no-cascade
{
c_incl -nc -ns -eia -r
-nrec /* no recursion */
[stringset
[cc_include_flags]
[prepost "-I"
"/"[unsplit /
[wordlist 1 3
[split / [dirname %0%.so]]
]
]
[search_list]
]
[prepost "-I" /[arch]/etc [search_list]]
[prepost "-I" "/etc" [search_list]]
]
-prefix "'cascade %0%.so ='"
-suffix "';'"
[resolve %0%.so]
[prepost "-rlp=" "" [search_list]] /* remove leading path */
-slp [arch] "'[arch]'" /* substitute leading path */
-o [target];
}
man-dep-files =
[fromto %0% %0%.d
[match_mask lib/%3/man%1/%2.%1 [source_files]]
]
[fromto %0% %0%.d
[match_mask %0%.so [source_files]]
];
cascade lib/en/man1/cook.1 = [arch]/etc/libdir.so;
cascade lib/en/user-guide/main.mm = [arch]/etc/libdir.so;
#include-cooked-nowarn [man-dep-files]
/*
* user manuals
*/
txt =
[fromto lib/%1/%2/main.ms lib/%1/%2/%2.pdf
[match_mask lib/%1/%2/main.ms [source_files]]]
[fromto lib/%1/%2/main.mm lib/%1/%2/%2.pdf
[match_mask lib/%1/%2/main.mm [source_files]]]
[fromto lib/%1/%2/main.roff lib/%1/%2/%2.txt
[match_mask lib/%1/%2/main.roff [source_files]]]
[fromto lib/%1/%2/main.man lib/%1/%2/%2.txt
[match_mask lib/%1/%2/main.man [source_files]]]
[fromto lib/%1/%2/main.man lib/%1/%2/%2.pdf
[match_mask lib/%1/%2/main.man [source_files]]]
;
txt =
[stringset
[txt]
-
[fromto lib/%1/refman/main.man lib/%1/refman/refman.txt
[match_mask lib/%1/refman/main.man [source_files]]
]
];
txt: [txt];
lib/%1/%2/%2.pdf: lib/%1/%2/main.ms etc/page-list-awk
{
roffpp
[prepost "-I" "/lib/%1/%2" [search_list]]
[prepost "-I" "/lib/%1/man1" [search_list]] /* for refman */
[prepost "-I" "/lib/%1/man5" [search_list]] /* for refman */
[prepost "-I" "/lib/%1/readme" [search_list]] /* for refman */
[prepost "-I" /[arch]/etc [search_list]]
[prepost "-I" "/etc" [search_list]]
[resolve lib/%1/%2/main.ms]
> lib/%1/%2/main.groff;
groff -p -t -mpic -mpspic -mgs
-rD1 /* headers and footers assuming double sided */
lib/%1/%2/main.groff
> lib/%1/%2/main.ps.tmp set meter;
rm lib/%1/%2/main.groff;
psselect -p`awk -f [resolve etc/page-list.awk] lib/%1/%2/main.ps.tmp`
lib/%1/%2/main.ps.tmp > lib/%1/%2/main.ps;
rm lib/%1/%2/main.ps.tmp;
ps2pdf lib/%1/%2/main.ps [target] set meter;
rm lib/%1/%2/main.ps;
}
lib/%1/%2/%2.pdf: lib/%1/%2/main.mm etc/page-list.awk
{
roffpp
[prepost "-I" "/lib/%1/%2" [search_list]]
[prepost "-I" "/lib/%1/man1" [search_list]] /* for refman */
[prepost "-I" "/lib/%1/man5" [search_list]] /* for refman */
[prepost "-I" "/lib/%1/readme" [search_list]] /* for refman */
[prepost "-I" /[arch]/etc [search_list]]
[prepost "-I" "/etc" [search_list]]
[resolve lib/%1/%2/main.mm]
> lib/%1/%2/%2.groff;
groff -p -t -mpic -mpspic -mm
-rD1 /* headers and footers assuming double sided */
lib/%1/%2/%2.groff
> lib/%1/%2/%2.ps.tmp set meter;
rm lib/%1/%2/%2.groff;
psselect -p`awk -f [resolve etc/page-list.awk] lib/%1/%2/%2.ps.tmp`
lib/%1/%2/%2.ps.tmp > lib/%1/%2/%2.ps;
rm lib/%1/%2/%2.ps.tmp;
ps2pdf lib/%1/%2/%2.ps [target] set meter;
rm lib/%1/%2/%2.ps;
}
lib/%1/%2/%2.pdf: lib/%1/%2/main.man etc/page-list.awk
{
roffpp
[prepost "-I" "/lib/%1/%2" [search_list]]
[prepost "-I" "/lib/%1/man1" [search_list]] /* for refman */
[prepost "-I" "/lib/%1/man5" [search_list]] /* for refman */
[prepost "-I" "/lib/%1/readme" [search_list]] /* for refman */
[prepost "-I" /[arch]/etc [search_list]]
[prepost "-I" "/etc" [search_list]]
[resolve lib/%1/%2/main.man]
> lib/%1/%2/%2.groff;
groff -p -t -mpic -mpspic -man
-rD1 /* headers and footers assuming double sided */
lib/%1/%2/%2.groff
> lib/%1/%2/%2.ps.tmp set meter;
rm lib/%1/%2/%2.groff;
psselect -p`awk -f [resolve etc/page-list.awk] lib/%1/%2/%2.ps.tmp`
lib/%1/%2/%2.ps.tmp > lib/%1/%2/%2.ps;
rm lib/%1/%2/%2.ps.tmp;
ps2pdf lib/%1/%2/%2.ps [target] set meter;
rm lib/%1/%2/%2.ps;
}
lib/%1/%2/%2.txt: lib/%1/%2/main.roff: etc/ssp.awk
{
roffpp
[prepost "-I" "/lib/%1/%2" [search_list]]
[prepost "-I" "/lib/%1/man1" [search_list]] /* for refman */
[prepost "-I" "/lib/%1/man5" [search_list]] /* for refman */
[prepost "-I" "/lib/%1/readme" [search_list]] /* for refman */
[prepost "-I" /[arch]/etc [search_list]]
[prepost "-I" "/etc" [search_list]]
[resolve lib/%1/%2/main.roff]
| GROFF_NO_SGR\=-c
groff -Tascii -t -P-ub
| [awk] -f [resolve etc/ssp.awk]
> [target];
}
lib/%1/%2/%2.txt: lib/%1/%2/main.man: etc/ssp.awk
{
roffpp
[prepost "-I" "/lib/%1/%2" [search_list]]
[prepost "-I" "/lib/%1/man1" [search_list]] /* for refman */
[prepost "-I" "/lib/%1/man5" [search_list]] /* for refman */
[prepost "-I" "/lib/%1/readme" [search_list]] /* for refman */
[prepost "-I" /[arch]/etc [search_list]]
[prepost "-I" "/etc" [search_list]]
[resolve lib/%1/%2/main.man]
| GROFF_NO_SGR\=-c
groff -Tascii -t -P-ub -man
| [awk] -f [resolve etc/ssp.awk]
> [target];
}
/* Sigh. Must be before the next recipe, and before the generic .d's. */
cascade lib/en/user-guide/builtin.so = lib/en/user-guide/function.so;
cascade lib/en/user-guide/system.so = lib/en/user-guide/system.list.so;
lib/%/user-guide/function.so: : etc/system.sh
[match_mask lib/%/user-guide/function/%%.so [source_files]]
{
sh [resolve etc/system.sh]
[fromto lib/%/user-guide/function/%%.so function/%%.so
[match_mask lib/%/user-guide/function/%%.so
[source_files]
]
]
> [target];
}
lib/%/user-guide/system.list.so: : etc/system.sh
[match_mask lib/%/user-guide/system/%%.so [source_files]]
{
sh [resolve etc/system.sh]
[fromto lib/%/user-guide/system/%%.so system/%%.so
[match_mask lib/%/user-guide/system/%%.so
[source_files]
]
]
> [target];
}
lib/%/readme/new.so: : etc/system.sh
[match_mask lib/%/readme/new.%%.so [source_files]]
{
sh [resolve etc/system.sh] -r
[fromto lib/%/readme/new.%%.so new.%%.so
[match_mask lib/%/readme/new.%%.so [source_files]]
]
> [target];
}
/* Sigh. Must be before the next recipe, and before the generic .d's. */
cascade lib/en/refman/main.man =
lib/en/refman/index.so lib/en/refman/parts.so;
lib/%/refman/index.so: [match_mask lib/%/man%%1/%%2.%%1 [source_files]]
etc/ptx1.awk etc/ptx.ignore etc/ptx2.awk
set no-cascade
{
[awk] -f [resolve etc/ptx1.awk]
[resolve [match_mask lib/%/man%%1/%%2.%%1 [source_files]]]
| ptx -O -r -w1000 -i[resolve etc/ptx.ignore]
| sort -t'\'"\'' -f -d +5 -6 +3 -4
| [awk] -F'\'"\'' -f [resolve etc/ptx2.awk]
> [target];
}
lib/%/refman/parts.so: [match_mask lib/%/man%%1/%%2.%%1 [source_files]]
etc/ptx.sh
set no-cascade
{
sh -f [resolve etc/ptx.sh]
[match_mask lib/%/man%%1/%%2.%%1 [source_files]]
> [target];
}
/* Sigh. Must be before the next recipe. */
lib/%/faq/main.roff.d:: lib/%/faq/toc.so;
lib/%1/%2/main.%3.d: lib/%1/%2/main.%3
set no-cascade
{
c_incl -nc -ns -eia -r
-nrec /* no recursion */
[prepost "-I" "/lib/%1/%2" [search_list]]
[prepost "-I" "/lib/%1/man1" [search_list]] /* for refman */
[prepost "-I" "/lib/%1/man5" [search_list]] /* for refman */
[prepost "-I" "/lib/%1/readme" [search_list]] /* for refman */
[prepost "-I" /[arch]/etc [search_list]]
[prepost "-I" "/etc" [search_list]]
-prefix "'cascade lib/%1/%2/main.%3 ='"
-suffix "';'"
[resolve lib/%1/%2/main.%3]
[prepost "-rlp=" "" [search_list]] /* remove leading path */
-slp [arch] "'[arch]'" /* substitute leading path */
-o [target];
}
doc-dep-files =
[addsuffix .d
[match_mask lib/%1/%2/main.%3 [source_files]]
];
#include-cooked-nowarn [doc-dep-files]
/*
* specials
*/
special:
README
BUILDING
;
/*
* building things which require txt2c to build
*
* Build %.h from %.1
*/
man1/%.h: man1/%.1: etc/txt2c.awk
{
[awk] -f [resolve etc/txt2c.awk] < [resolve man1/%.1] > [target];
}
man1/%.h: man1/%.so: etc/txt2c.awk
{
[awk] -f [resolve etc/txt2c.awk] < [resolve man1/%.so] > [target];
}
ranlib = [find_command ranlib];
[arch]/common/lib.a: [lib_obj]
set ingredients-fingerprint
{
ar qc [target] [resolve [lib_obj]];
if [ranlib] then
[ranlib] [target];
}
/*
* need this so that ../man1/???.h includes work properly
*/
if [not [exists [arch]/common]] then
mkdir -p [arch]/common
set clearstat;
LICENSE: lib/en/cat1/cook_lic.1
{
cp [need] [target];
}
/* Sigh */
cascade lib/en/building/main.man = etc/version.so;
cascade lib/en/lsm/main.roff = etc/version.so;
cascade lib/en/man1/copyright.so = etc/version.so;
cascade lib/en/readme/main.man = etc/version.so;
cascade lib/en/refman/main.man = etc/version.so;
cascade lib/en/release/main.man = etc/version.so;
cascade lib/en/user-guide/main.mm = etc/version.so;
all += file_check/.done;
file_check/.done: [arch]/bin/file_check
[project_files] [change_files]
{
[resolve [arch]/bin/file_check] /* -w */
[resolve [change_files] [project_files]]
;
touch [target];
}
/*
* Include the recipes for GNU Autoconf.
*/
#include [resolve etc/autoconf.cook]
/*
* Include the recipes for internationalization.
*/
#include [resolve etc/i18n.cook]
/*
* Include the recipes for the archive directory.
*/
#include [resolve etc/archive.cook]
/*
* Include the recipes for using the cfmt program.
*/
#include [resolve etc/cfmt.cook etc/metrics.cook]
/*
* Include recipes for generating the "tags" amd "TAGS" files.
*/
#include [resolve etc/cfmt.cook etc/tags.cook]
|