Lines 61-67
Link Here
|
61 |
|
61 |
|
62 |
|
62 |
|
63 |
|
63 |
|
64 |
Dmake Version 4.11-cvs 2007-07-05 1 |
64 |
Dmake Version 4.11-cvs 2007-08-06 1 |
65 |
|
65 |
|
66 |
|
66 |
|
67 |
|
67 |
|
Lines 127-133
Link Here
|
127 |
|
127 |
|
128 |
|
128 |
|
129 |
|
129 |
|
130 |
Dmake Version 4.11-cvs 2007-07-05 2 |
130 |
Dmake Version 4.11-cvs 2007-08-06 2 |
131 |
|
131 |
|
132 |
|
132 |
|
133 |
|
133 |
|
Lines 194-200
Link Here
|
194 |
|
194 |
|
195 |
|
195 |
|
196 |
|
196 |
|
197 |
Dmake Version 4.11-cvs 2007-07-05 3 |
197 |
Dmake Version 4.11-cvs 2007-08-06 3 |
198 |
|
198 |
|
199 |
|
199 |
|
200 |
|
200 |
|
Lines 261-267
Link Here
|
261 |
|
261 |
|
262 |
|
262 |
|
263 |
|
263 |
|
264 |
Dmake Version 4.11-cvs 2007-07-05 4 |
264 |
Dmake Version 4.11-cvs 2007-08-06 4 |
265 |
|
265 |
|
266 |
|
266 |
|
267 |
|
267 |
|
Lines 328-334
Link Here
|
328 |
|
328 |
|
329 |
|
329 |
|
330 |
|
330 |
|
331 |
Dmake Version 4.11-cvs 2007-07-05 5 |
331 |
Dmake Version 4.11-cvs 2007-08-06 5 |
332 |
|
332 |
|
333 |
|
333 |
|
334 |
|
334 |
|
Lines 395-401
Link Here
|
395 |
|
395 |
|
396 |
|
396 |
|
397 |
|
397 |
|
398 |
Dmake Version 4.11-cvs 2007-07-05 6 |
398 |
Dmake Version 4.11-cvs 2007-08-06 6 |
399 |
|
399 |
|
400 |
|
400 |
|
401 |
|
401 |
|
Lines 462-468
Link Here
|
462 |
|
462 |
|
463 |
|
463 |
|
464 |
|
464 |
|
465 |
Dmake Version 4.11-cvs 2007-07-05 7 |
465 |
Dmake Version 4.11-cvs 2007-08-06 7 |
466 |
|
466 |
|
467 |
|
467 |
|
468 |
|
468 |
|
Lines 529-535
Link Here
|
529 |
|
529 |
|
530 |
|
530 |
|
531 |
|
531 |
|
532 |
Dmake Version 4.11-cvs 2007-07-05 8 |
532 |
Dmake Version 4.11-cvs 2007-08-06 8 |
533 |
|
533 |
|
534 |
|
534 |
|
535 |
|
535 |
|
Lines 596-602
Link Here
|
596 |
|
596 |
|
597 |
|
597 |
|
598 |
|
598 |
|
599 |
Dmake Version 4.11-cvs 2007-07-05 9 |
599 |
Dmake Version 4.11-cvs 2007-08-06 9 |
600 |
|
600 |
|
601 |
|
601 |
|
602 |
|
602 |
|
Lines 663-669
Link Here
|
663 |
|
663 |
|
664 |
|
664 |
|
665 |
|
665 |
|
666 |
Dmake Version 4.11-cvs 2007-07-05 10 |
666 |
Dmake Version 4.11-cvs 2007-08-06 10 |
667 |
|
667 |
|
668 |
|
668 |
|
669 |
|
669 |
|
Lines 732-738
Link Here
|
732 |
|
732 |
|
733 |
|
733 |
|
734 |
|
734 |
|
735 |
Dmake Version 4.11-cvs 2007-07-05 11 |
735 |
Dmake Version 4.11-cvs 2007-08-06 11 |
736 |
|
736 |
|
737 |
|
737 |
|
738 |
|
738 |
|
Lines 801-807
Link Here
|
801 |
|
801 |
|
802 |
|
802 |
|
803 |
|
803 |
|
804 |
Dmake Version 4.11-cvs 2007-07-05 12 |
804 |
Dmake Version 4.11-cvs 2007-08-06 12 |
805 |
|
805 |
|
806 |
|
806 |
|
807 |
|
807 |
|
Lines 870-876
Link Here
|
870 |
|
870 |
|
871 |
|
871 |
|
872 |
|
872 |
|
873 |
Dmake Version 4.11-cvs 2007-07-05 13 |
873 |
Dmake Version 4.11-cvs 2007-08-06 13 |
874 |
|
874 |
|
875 |
|
875 |
|
876 |
|
876 |
|
Lines 939-945
Link Here
|
939 |
|
939 |
|
940 |
|
940 |
|
941 |
|
941 |
|
942 |
Dmake Version 4.11-cvs 2007-07-05 14 |
942 |
Dmake Version 4.11-cvs 2007-08-06 14 |
943 |
|
943 |
|
944 |
|
944 |
|
945 |
|
945 |
|
Lines 1008-1014
Link Here
|
1008 |
|
1008 |
|
1009 |
|
1009 |
|
1010 |
|
1010 |
|
1011 |
Dmake Version 4.11-cvs 2007-07-05 15 |
1011 |
Dmake Version 4.11-cvs 2007-08-06 15 |
1012 |
|
1012 |
|
1013 |
|
1013 |
|
1014 |
|
1014 |
|
Lines 1077-1083
Link Here
|
1077 |
|
1077 |
|
1078 |
|
1078 |
|
1079 |
|
1079 |
|
1080 |
Dmake Version 4.11-cvs 2007-07-05 16 |
1080 |
Dmake Version 4.11-cvs 2007-08-06 16 |
1081 |
|
1081 |
|
1082 |
|
1082 |
|
1083 |
|
1083 |
|
Lines 1146-1152
Link Here
|
1146 |
|
1146 |
|
1147 |
|
1147 |
|
1148 |
|
1148 |
|
1149 |
Dmake Version 4.11-cvs 2007-07-05 17 |
1149 |
Dmake Version 4.11-cvs 2007-08-06 17 |
1150 |
|
1150 |
|
1151 |
|
1151 |
|
1152 |
|
1152 |
|
Lines 1215-1221
Link Here
|
1215 |
|
1215 |
|
1216 |
|
1216 |
|
1217 |
|
1217 |
|
1218 |
Dmake Version 4.11-cvs 2007-07-05 18 |
1218 |
Dmake Version 4.11-cvs 2007-08-06 18 |
1219 |
|
1219 |
|
1220 |
|
1220 |
|
1221 |
|
1221 |
|
Lines 1284-1290
Link Here
|
1284 |
|
1284 |
|
1285 |
|
1285 |
|
1286 |
|
1286 |
|
1287 |
Dmake Version 4.11-cvs 2007-07-05 19 |
1287 |
Dmake Version 4.11-cvs 2007-08-06 19 |
1288 |
|
1288 |
|
1289 |
|
1289 |
|
1290 |
|
1290 |
|
Lines 1353-1359
Link Here
|
1353 |
|
1353 |
|
1354 |
|
1354 |
|
1355 |
|
1355 |
|
1356 |
Dmake Version 4.11-cvs 2007-07-05 20 |
1356 |
Dmake Version 4.11-cvs 2007-08-06 20 |
1357 |
|
1357 |
|
1358 |
|
1358 |
|
1359 |
|
1359 |
|
Lines 1422-1428
Link Here
|
1422 |
|
1422 |
|
1423 |
|
1423 |
|
1424 |
|
1424 |
|
1425 |
Dmake Version 4.11-cvs 2007-07-05 21 |
1425 |
Dmake Version 4.11-cvs 2007-08-06 21 |
1426 |
|
1426 |
|
1427 |
|
1427 |
|
1428 |
|
1428 |
|
Lines 1491-1497
Link Here
|
1491 |
|
1491 |
|
1492 |
|
1492 |
|
1493 |
|
1493 |
|
1494 |
Dmake Version 4.11-cvs 2007-07-05 22 |
1494 |
Dmake Version 4.11-cvs 2007-08-06 22 |
1495 |
|
1495 |
|
1496 |
|
1496 |
|
1497 |
|
1497 |
|
Lines 1560-1566
Link Here
|
1560 |
|
1560 |
|
1561 |
|
1561 |
|
1562 |
|
1562 |
|
1563 |
Dmake Version 4.11-cvs 2007-07-05 23 |
1563 |
Dmake Version 4.11-cvs 2007-08-06 23 |
1564 |
|
1564 |
|
1565 |
|
1565 |
|
1566 |
|
1566 |
|
Lines 1630-1636
Link Here
|
1630 |
|
1630 |
|
1631 |
|
1631 |
|
1632 |
|
1632 |
|
1633 |
Dmake Version 4.11-cvs 2007-07-05 24 |
1633 |
Dmake Version 4.11-cvs 2007-08-06 24 |
1634 |
|
1634 |
|
1635 |
|
1635 |
|
1636 |
|
1636 |
|
Lines 1700-1706
Link Here
|
1700 |
|
1700 |
|
1701 |
|
1701 |
|
1702 |
|
1702 |
|
1703 |
Dmake Version 4.11-cvs 2007-07-05 25 |
1703 |
Dmake Version 4.11-cvs 2007-08-06 25 |
1704 |
|
1704 |
|
1705 |
|
1705 |
|
1706 |
|
1706 |
|
Lines 1770-1776
Link Here
|
1770 |
|
1770 |
|
1771 |
|
1771 |
|
1772 |
|
1772 |
|
1773 |
Dmake Version 4.11-cvs 2007-07-05 26 |
1773 |
Dmake Version 4.11-cvs 2007-08-06 26 |
1774 |
|
1774 |
|
1775 |
|
1775 |
|
1776 |
|
1776 |
|
Lines 1840-1846
Link Here
|
1840 |
|
1840 |
|
1841 |
|
1841 |
|
1842 |
|
1842 |
|
1843 |
Dmake Version 4.11-cvs 2007-07-05 27 |
1843 |
Dmake Version 4.11-cvs 2007-08-06 27 |
1844 |
|
1844 |
|
1845 |
|
1845 |
|
1846 |
|
1846 |
|
Lines 1911-1917
Link Here
|
1911 |
|
1911 |
|
1912 |
|
1912 |
|
1913 |
|
1913 |
|
1914 |
Dmake Version 4.11-cvs 2007-07-05 28 |
1914 |
Dmake Version 4.11-cvs 2007-08-06 28 |
1915 |
|
1915 |
|
1916 |
|
1916 |
|
1917 |
|
1917 |
|
Lines 1982-1988
Link Here
|
1982 |
|
1982 |
|
1983 |
|
1983 |
|
1984 |
|
1984 |
|
1985 |
Dmake Version 4.11-cvs 2007-07-05 29 |
1985 |
Dmake Version 4.11-cvs 2007-08-06 29 |
1986 |
|
1986 |
|
1987 |
|
1987 |
|
1988 |
|
1988 |
|
Lines 2053-2059
Link Here
|
2053 |
|
2053 |
|
2054 |
|
2054 |
|
2055 |
|
2055 |
|
2056 |
Dmake Version 4.11-cvs 2007-07-05 30 |
2056 |
Dmake Version 4.11-cvs 2007-08-06 30 |
2057 |
|
2057 |
|
2058 |
|
2058 |
|
2059 |
|
2059 |
|
Lines 2124-2130
Link Here
|
2124 |
|
2124 |
|
2125 |
|
2125 |
|
2126 |
|
2126 |
|
2127 |
Dmake Version 4.11-cvs 2007-07-05 31 |
2127 |
Dmake Version 4.11-cvs 2007-08-06 31 |
2128 |
|
2128 |
|
2129 |
|
2129 |
|
2130 |
|
2130 |
|
Lines 2195-2201
Link Here
|
2195 |
|
2195 |
|
2196 |
|
2196 |
|
2197 |
|
2197 |
|
2198 |
Dmake Version 4.11-cvs 2007-07-05 32 |
2198 |
Dmake Version 4.11-cvs 2007-08-06 32 |
2199 |
|
2199 |
|
2200 |
|
2200 |
|
2201 |
|
2201 |
|
Lines 2266-2272
Link Here
|
2266 |
|
2266 |
|
2267 |
|
2267 |
|
2268 |
|
2268 |
|
2269 |
Dmake Version 4.11-cvs 2007-07-05 33 |
2269 |
Dmake Version 4.11-cvs 2007-08-06 33 |
2270 |
|
2270 |
|
2271 |
|
2271 |
|
2272 |
|
2272 |
|
Lines 2337-2343
Link Here
|
2337 |
|
2337 |
|
2338 |
|
2338 |
|
2339 |
|
2339 |
|
2340 |
Dmake Version 4.11-cvs 2007-07-05 34 |
2340 |
Dmake Version 4.11-cvs 2007-08-06 34 |
2341 |
|
2341 |
|
2342 |
|
2342 |
|
2343 |
|
2343 |
|
Lines 2408-2414
Link Here
|
2408 |
|
2408 |
|
2409 |
|
2409 |
|
2410 |
|
2410 |
|
2411 |
Dmake Version 4.11-cvs 2007-07-05 35 |
2411 |
Dmake Version 4.11-cvs 2007-08-06 35 |
2412 |
|
2412 |
|
2413 |
|
2413 |
|
2414 |
|
2414 |
|
Lines 2479-2485
Link Here
|
2479 |
|
2479 |
|
2480 |
|
2480 |
|
2481 |
|
2481 |
|
2482 |
Dmake Version 4.11-cvs 2007-07-05 36 |
2482 |
Dmake Version 4.11-cvs 2007-08-06 36 |
2483 |
|
2483 |
|
2484 |
|
2484 |
|
2485 |
|
2485 |
|
Lines 2551-2557
Link Here
|
2551 |
|
2551 |
|
2552 |
|
2552 |
|
2553 |
|
2553 |
|
2554 |
Dmake Version 4.11-cvs 2007-07-05 37 |
2554 |
Dmake Version 4.11-cvs 2007-08-06 37 |
2555 |
|
2555 |
|
2556 |
|
2556 |
|
2557 |
|
2557 |
|
Lines 2623-2629
Link Here
|
2623 |
|
2623 |
|
2624 |
|
2624 |
|
2625 |
|
2625 |
|
2626 |
Dmake Version 4.11-cvs 2007-07-05 38 |
2626 |
Dmake Version 4.11-cvs 2007-08-06 38 |
2627 |
|
2627 |
|
2628 |
|
2628 |
|
2629 |
|
2629 |
|
Lines 2699-2705
Link Here
|
2699 |
|
2699 |
|
2700 |
|
2700 |
|
2701 |
|
2701 |
|
2702 |
Dmake Version 4.11-cvs 2007-07-05 39 |
2702 |
Dmake Version 4.11-cvs 2007-08-06 39 |
2703 |
|
2703 |
|
2704 |
|
2704 |
|
2705 |
|
2705 |
|
Lines 2713-2721
Link Here
|
2713 |
the %-meta rule when the rule is selected during inference and dmake |
2713 |
the %-meta rule when the rule is selected during inference and dmake |
2714 |
constructs the new dependency. |
2714 |
constructs the new dependency. |
2715 |
|
2715 |
|
2716 |
Please note, that currently only the first, non-indirect, prerequisite |
2716 |
Please note, that only the first, non-indirect, prerequisite of the |
2717 |
of the list is used and all other non-indirect prerequisites are |
2717 |
list is used for the inference mechanism. If more than one non-indirect |
2718 |
ignored. |
2718 |
prerequisite is given a warning is issued and all but the first non- |
|
|
2719 |
indirect prerequisites are ignored. See below for a description of |
2720 |
indirect prerequisites. |
2719 |
|
2721 |
|
2720 |
As an example the following %-meta rules describe the following: |
2722 |
As an example the following %-meta rules describe the following: |
2721 |
|
2723 |
|
Lines 2733-2742
Link Here
|
2733 |
describes how to make a file whose suffix is .a without inferring any |
2735 |
describes how to make a file whose suffix is .a without inferring any |
2734 |
prerequisites. |
2736 |
prerequisites. |
2735 |
|
2737 |
|
2736 |
%.c : %.y yaccsrc/%.y ; recipe... |
2738 |
%.c : %.y 'yaccsrc/%.y' ; recipe... |
2737 |
|
2739 |
|
2738 |
should match the corresponding .y file and another .y file in the yacc- |
2740 |
matches the corresponding .y file as prerequisite and additionally |
2739 |
src subdirectory. (Currently only the first prerequisite is used.) |
2741 |
another .y file in the yaccsrc subdirectory as indirect prerequisite. |
2740 |
Another interesting example is: |
2742 |
Another interesting example is: |
2741 |
|
2743 |
|
2742 |
% : RCS/%,v ; co $< |
2744 |
% : RCS/%,v ; co $< |
Lines 2769-2781
Link Here
|
2769 |
dmake supports dynamic prerequisite generation for prerequisites of |
2771 |
dmake supports dynamic prerequisite generation for prerequisites of |
2770 |
%-meta rules. This is best illustrated by an example. The RCS rule |
2772 |
%-meta rules. This is best illustrated by an example. The RCS rule |
2771 |
shown above can infer how to check out a file from a corresponding RCS |
2773 |
shown above can infer how to check out a file from a corresponding RCS |
2772 |
file only if the target is a simple file name with no directory infor- |
2774 |
file only if the target is a simple file name with no directory |
2773 |
mation. That is, the above rule can infer how to find RCS/fred.c,v |
|
|
2774 |
from the target fred.c, but cannot infer how to find |
2775 |
|
2775 |
|
2776 |
|
2776 |
|
2777 |
|
2777 |
|
2778 |
Dmake Version 4.11-cvs 2007-07-05 40 |
2778 |
Dmake Version 4.11-cvs 2007-08-06 40 |
2779 |
|
2779 |
|
2780 |
|
2780 |
|
2781 |
|
2781 |
|
Lines 2784-2789
Link Here
|
2784 |
DMAKE(1) DMAKE(1) |
2784 |
DMAKE(1) DMAKE(1) |
2785 |
|
2785 |
|
2786 |
|
2786 |
|
|
|
2787 |
information. That is, the above rule can infer how to find |
2788 |
RCS/fred.c,v from the target fred.c, but cannot infer how to find |
2787 |
srcdir/RCS/fred.c,v from srcdir/fred.c because the above rule will |
2789 |
srcdir/RCS/fred.c,v from srcdir/fred.c because the above rule will |
2788 |
cause dmake to look for RCS/srcdir/fred.c,v; which does not exist |
2790 |
cause dmake to look for RCS/srcdir/fred.c,v; which does not exist |
2789 |
(assume that srcdir has its own RCS directory as is the common case). |
2791 |
(assume that srcdir has its own RCS directory as is the common case). |
Lines 2826-2839
Link Here
|
2826 |
get. They do not play an active role in driving the inference algo- |
2828 |
get. They do not play an active role in driving the inference algo- |
2827 |
rithm. The construct: |
2829 |
rithm. The construct: |
2828 |
|
2830 |
|
2829 |
%.o : %.c %.f 'local.h'; recipe |
|
|
2830 |
|
2831 |
is (currently) equivalent to: |
2832 |
|
2833 |
%.o : %.c 'local.h' ; recipe |
2834 |
|
2835 |
because the second prerequisite is ignored, while: |
2836 |
|
2837 |
%.o :| %.c %.f 'local.h'; recipe |
2831 |
%.o :| %.c %.f 'local.h'; recipe |
2838 |
|
2832 |
|
2839 |
is equivalent to: |
2833 |
is equivalent to: |
Lines 2847-2857
Link Here
|
2847 |
then when that rule is bound to a target as the result of an inference, |
2841 |
then when that rule is bound to a target as the result of an inference, |
2848 |
the target's set of attributes is augmented by the attributes from the |
2842 |
the target's set of attributes is augmented by the attributes from the |
2849 |
above set that are specified in the bound %-rule. Other attributes |
2843 |
above set that are specified in the bound %-rule. Other attributes |
2850 |
specified for %-meta rules are not inherited by the target. The |
2844 |
specified for %-meta rules are not inherited by the target. The .SET- |
|
|
2845 |
DIR attribute is treated in a special way. If the target already had a |
2846 |
.SETDIR attribute set then dmake changes to that directory prior to |
2847 |
performing the inference. During inference any .SETDIR attributes for |
2848 |
the inferred prerequisite are honored. The directories must exist for |
2849 |
a %-meta rule to be selected as a possible inference path. If the |
2850 |
directories do not exist no error message is issued, instead the |
2851 |
|
2851 |
|
2852 |
|
2852 |
|
2853 |
|
2853 |
|
2854 |
Dmake Version 4.11-cvs 2007-07-05 41 |
2854 |
Dmake Version 4.11-cvs 2007-08-06 41 |
2855 |
|
2855 |
|
2856 |
|
2856 |
|
2857 |
|
2857 |
|
Lines 2860-2872
Link Here
|
2860 |
DMAKE(1) DMAKE(1) |
2860 |
DMAKE(1) DMAKE(1) |
2861 |
|
2861 |
|
2862 |
|
2862 |
|
2863 |
.SETDIR attribute is treated in a special way. If the target already |
2863 |
corresponding path in the inference graph is rejected. |
2864 |
had a .SETDIR attribute set then dmake changes to that directory prior |
|
|
2865 |
to performing the inference. During inference any .SETDIR attributes |
2866 |
for the inferred prerequisite are honored. The directories must exist |
2867 |
for a %-meta rule to be selected as a possible inference path. If the |
2868 |
directories do not exist no error message is issued, instead the corre- |
2869 |
sponding path in the inference graph is rejected. |
2870 |
|
2864 |
|
2871 |
dmake bases all of its inferences on the inference graph constructed |
2865 |
dmake bases all of its inferences on the inference graph constructed |
2872 |
from the %-rules defined in the makefile. It knows exactly which tar- |
2866 |
from the %-rules defined in the makefile. It knows exactly which tar- |
Lines 2924-2933
Link Here
|
2924 |
not given on the command line, and if the inferred intermediate did not |
2918 |
not given on the command line, and if the inferred intermediate did not |
2925 |
previously exist. Intermediate targets that existed prior to being |
2919 |
previously exist. Intermediate targets that existed prior to being |
2926 |
made are never removed. This is in keeping with the philosophy that |
2920 |
made are never removed. This is in keeping with the philosophy that |
|
|
2921 |
dmake should never remove things from the file system that it did not |
2922 |
add. If the special target .REMOVE is defined and has a recipe then |
2923 |
dmake constructs a list of the intermediate files to be removed and |
2924 |
makes them prerequisites of .REMOVE. It then makes .REMOVE thereby |
2925 |
removing the prerequisites if the recipe of .REMOVE says to. Typically |
2926 |
.REMOVE is defined in the startup file as: |
2927 |
|
2927 |
|
2928 |
|
2928 |
|
2929 |
|
2929 |
|
2930 |
Dmake Version 4.11-cvs 2007-07-05 42 |
2930 |
Dmake Version 4.11-cvs 2007-08-06 42 |
2931 |
|
2931 |
|
2932 |
|
2932 |
|
2933 |
|
2933 |
|
Lines 2936-2948
Link Here
|
2936 |
DMAKE(1) DMAKE(1) |
2936 |
DMAKE(1) DMAKE(1) |
2937 |
|
2937 |
|
2938 |
|
2938 |
|
2939 |
dmake should never remove things from the file system that it did not |
|
|
2940 |
add. If the special target .REMOVE is defined and has a recipe then |
2941 |
dmake constructs a list of the intermediate files to be removed and |
2942 |
makes them prerequisites of .REMOVE. It then makes .REMOVE thereby |
2943 |
removing the prerequisites if the recipe of .REMOVE says to. Typically |
2944 |
.REMOVE is defined in the startup file as: |
2945 |
|
2946 |
.REMOVE :; $(RM) $< |
2939 |
.REMOVE :; $(RM) $< |
2947 |
|
2940 |
|
2948 |
AUGMAKE META RULES |
2941 |
AUGMAKE META RULES |
Lines 3000-3009
Link Here
|
3000 |
was in before the command was executed. |
2993 |
was in before the command was executed. |
3001 |
|
2994 |
|
3002 |
The decision on whether a shell is required to execute a command is |
2995 |
The decision on whether a shell is required to execute a command is |
|
|
2996 |
based on the value of the macro SHELLMETAS or on the specification of |
2997 |
'+' or .USESHELL for the current recipe or target respectively. If any |
2998 |
character in the value of SHELLMETAS is found in the expanded recipe |
2999 |
text-line or the use of a shell is requested explicitly via '+' or |
3000 |
.USESHELL then the command is executed using a shell, otherwise the |
3001 |
command is executed directly. The shell that is used for execution is |
3002 |
given by the value of the macro SHELL. The flags that are passed to |
3003 |
|
3003 |
|
3004 |
|
3004 |
|
3005 |
|
3005 |
|
3006 |
Dmake Version 4.11-cvs 2007-07-05 43 |
3006 |
Dmake Version 4.11-cvs 2007-08-06 43 |
3007 |
|
3007 |
|
3008 |
|
3008 |
|
3009 |
|
3009 |
|
Lines 3012-3024
Link Here
|
3012 |
DMAKE(1) DMAKE(1) |
3012 |
DMAKE(1) DMAKE(1) |
3013 |
|
3013 |
|
3014 |
|
3014 |
|
3015 |
based on the value of the macro SHELLMETAS or on the specification of |
|
|
3016 |
'+' or .USESHELL for the current recipe or target respectively. If any |
3017 |
character in the value of SHELLMETAS is found in the expanded recipe |
3018 |
text-line or the use of a shell is requested explicitly via '+' or |
3019 |
.USESHELL then the command is executed using a shell, otherwise the |
3020 |
command is executed directly. The shell that is used for execution is |
3021 |
given by the value of the macro SHELL. The flags that are passed to |
3022 |
the shell are given by the value of SHELLFLAGS. Thus dmake constructs |
3015 |
the shell are given by the value of SHELLFLAGS. Thus dmake constructs |
3023 |
the command line: |
3016 |
the command line: |
3024 |
|
3017 |
|
Lines 3076-3085
Link Here
|
3076 |
which has a much shorter argument list. It is now up to the command to |
3069 |
which has a much shorter argument list. It is now up to the command to |
3077 |
use the supplied argument as the source for all other arguments. As an |
3070 |
use the supplied argument as the source for all other arguments. As an |
3078 |
optimization, if COMMAND is not defined dmake does not perform the |
3071 |
optimization, if COMMAND is not defined dmake does not perform the |
|
|
3072 |
above expansion. On systems, such as UNIX, that handle long command |
3073 |
lines this provides a slight saving in processing the makefiles. |
3074 |
|
3075 |
MAKING LIBRARIES |
3076 |
Libraries are easy to maintain using dmake. A library is a file con- |
3077 |
taining a collection of object files. Thus to make a library you sim- |
3078 |
ply specify it as a target with the .LIBRARY attribute set and specify |
3079 |
|
3079 |
|
3080 |
|
3080 |
|
3081 |
|
3081 |
|
3082 |
Dmake Version 4.11-cvs 2007-07-05 44 |
3082 |
Dmake Version 4.11-cvs 2007-08-06 44 |
3083 |
|
3083 |
|
3084 |
|
3084 |
|
3085 |
|
3085 |
|
Lines 3088-3100
Link Here
|
3088 |
DMAKE(1) DMAKE(1) |
3088 |
DMAKE(1) DMAKE(1) |
3089 |
|
3089 |
|
3090 |
|
3090 |
|
3091 |
above expansion. On systems, such as UNIX, that handle long command |
|
|
3092 |
lines this provides a slight saving in processing the makefiles. |
3093 |
|
3094 |
MAKING LIBRARIES |
3095 |
Libraries are easy to maintain using dmake. A library is a file con- |
3096 |
taining a collection of object files. Thus to make a library you sim- |
3097 |
ply specify it as a target with the .LIBRARY attribute set and specify |
3098 |
its list of prerequisites. The prerequisites should be the object mem- |
3091 |
its list of prerequisites. The prerequisites should be the object mem- |
3099 |
bers that are to go into the library. When dmake makes the library |
3092 |
bers that are to go into the library. When dmake makes the library |
3100 |
target it uses the .LIBRARY attribute to pass to the prerequisites the |
3093 |
target it uses the .LIBRARY attribute to pass to the prerequisites the |
Lines 3152-3161
Link Here
|
3152 |
|
3145 |
|
3153 |
NOTE: If the notion of entry points is supported by the archive and by |
3146 |
NOTE: If the notion of entry points is supported by the archive and by |
3154 |
dmake (currently not the case) then dmake will search the archive for |
3147 |
dmake (currently not the case) then dmake will search the archive for |
|
|
3148 |
the entry point and return not only the modification time of the member |
3149 |
which defines the entry but also the name of the member file. This |
3150 |
name will then replace entry and will be used for making the member |
3151 |
file. Once bound to an archive member the .SYMBOL attribute is removed |
3152 |
from the target. This feature is presently disabled as there is little |
3153 |
standardization among archive formats, and we have yet to find a make- |
3154 |
file utilizing this feature (possibly due to the fact that it is |
3155 |
|
3155 |
|
3156 |
|
3156 |
|
3157 |
|
3157 |
|
3158 |
Dmake Version 4.11-cvs 2007-07-05 45 |
3158 |
Dmake Version 4.11-cvs 2007-08-06 45 |
3159 |
|
3159 |
|
3160 |
|
3160 |
|
3161 |
|
3161 |
|
Lines 3164-3177
Link Here
|
3164 |
DMAKE(1) DMAKE(1) |
3164 |
DMAKE(1) DMAKE(1) |
3165 |
|
3165 |
|
3166 |
|
3166 |
|
3167 |
the entry point and return not only the modification time of the member |
3167 |
unimplemented in most versions of UNIX Make). |
3168 |
which defines the entry but also the name of the member file. This |
|
|
3169 |
name will then replace entry and will be used for making the member |
3170 |
file. Once bound to an archive member the .SYMBOL attribute is removed |
3171 |
from the target. This feature is presently disabled as there is little |
3172 |
standardization among archive formats, and we have yet to find a make- |
3173 |
file utilizing this feature (possibly due to the fact that it is unim- |
3174 |
plemented in most versions of UNIX Make). |
3175 |
|
3168 |
|
3176 |
Finally, when dmake looks for a library member it must first locate the |
3169 |
Finally, when dmake looks for a library member it must first locate the |
3177 |
library file. It does so by first looking for the library relative to |
3170 |
library file. It does so by first looking for the library relative to |
Lines 3229-3252
Link Here
|
3229 |
be removed. If a parallel make is being performed then the following |
3222 |
be removed. If a parallel make is being performed then the following |
3230 |
restrictions on parallelism are enforced. |
3223 |
restrictions on parallelism are enforced. |
3231 |
|
3224 |
|
|
|
3225 |
1. Individual recipe lines in a non-group recipe are per- |
3226 |
formed sequentially in the order in which they are speci- |
3227 |
fied within the makefile and in parallel with the recipes |
3228 |
of other targets. |
3232 |
|
3229 |
|
|
|
3230 |
2. If a target contains multiple recipe definitions (cf. :: |
3231 |
rules) then these are performed sequentially in the order |
3233 |
|
3232 |
|
3234 |
Dmake Version 4.11-cvs 2007-07-05 46 |
|
|
3235 |
|
3233 |
|
3236 |
|
3234 |
|
|
|
3235 |
Dmake Version 4.11-cvs 2007-08-06 46 |
3237 |
|
3236 |
|
3238 |
|
3237 |
|
3239 |
|
3238 |
|
3240 |
DMAKE(1) DMAKE(1) |
|
|
3241 |
|
3239 |
|
3242 |
|
3240 |
|
3243 |
1. Individual recipe lines in a non-group recipe are per- |
3241 |
DMAKE(1) DMAKE(1) |
3244 |
formed sequentially in the order in which they are speci- |
3242 |
|
3245 |
fied within the makefile and in parallel with the recipes |
|
|
3246 |
of other targets. |
3247 |
|
3243 |
|
3248 |
2. If a target contains multiple recipe definitions (cf. :: |
|
|
3249 |
rules) then these are performed sequentially in the order |
3250 |
in which the :: rules are specified within the makefile |
3244 |
in which the :: rules are specified within the makefile |
3251 |
and in parallel with the recipes of other targets. |
3245 |
and in parallel with the recipes of other targets. |
3252 |
|
3246 |
|
Lines 3304-3313
Link Here
|
3304 |
numerical part is found this results to 0 (zero). The string "12ab" for |
3298 |
numerical part is found this results to 0 (zero). The string "12ab" for |
3305 |
example evaluates to the number 12. Expressions can be nested with () |
3299 |
example evaluates to the number 12. Expressions can be nested with () |
3306 |
and the use of || or &&. White space at the start and end of the text |
3300 |
and the use of || or &&. White space at the start and end of the text |
|
|
3301 |
portion is discarded before the comparison. This means that a macro |
3302 |
that evaluates to nothing but white space is considered a NULL value |
3303 |
for the purpose of the comparison. In the first case the expression |
3304 |
evaluates TRUE if the text is not NULL otherwise it evaluates FALSE. |
3305 |
The remaining two cases both evaluate the expression on the basis of a |
3306 |
string comparison. If a macro expression needs to be equated to a NULL |
3307 |
string then compare it to the value of the macro $(NULL). You can use |
3308 |
the $(shell ...) macro to construct more complex test expressions. |
3307 |
|
3309 |
|
3308 |
|
3310 |
|
3309 |
|
3311 |
|
3310 |
Dmake Version 4.11-cvs 2007-07-05 47 |
3312 |
Dmake Version 4.11-cvs 2007-08-06 47 |
3311 |
|
3313 |
|
3312 |
|
3314 |
|
3313 |
|
3315 |
|
Lines 3316-3330
Link Here
|
3316 |
DMAKE(1) DMAKE(1) |
3318 |
DMAKE(1) DMAKE(1) |
3317 |
|
3319 |
|
3318 |
|
3320 |
|
3319 |
portion is discarded before the comparison. This means that a macro |
|
|
3320 |
that evaluates to nothing but white space is considered a NULL value |
3321 |
for the purpose of the comparison. In the first case the expression |
3322 |
evaluates TRUE if the text is not NULL otherwise it evaluates FALSE. |
3323 |
The remaining two cases both evaluate the expression on the basis of a |
3324 |
string comparison. If a macro expression needs to be equated to a NULL |
3325 |
string then compare it to the value of the macro $(NULL). You can use |
3326 |
the $(shell ...) macro to construct more complex test expressions. |
3327 |
|
3328 |
EXAMPLES |
3321 |
EXAMPLES |
3329 |
# A simple example showing how to use make |
3322 |
# A simple example showing how to use make |
3330 |
# |
3323 |
# |
Lines 3381-3406
Link Here
|
3381 |
An example of building library members would go something like this: |
3374 |
An example of building library members would go something like this: |
3382 |
(NOTE: The same rules as above will be used to produce .o's from .c's) |
3375 |
(NOTE: The same rules as above will be used to produce .o's from .c's) |
3383 |
|
3376 |
|
|
|
3377 |
SRC= a b |
3378 |
LIB= lib |
3379 |
LIBm= { $(SRC) }.o |
3380 |
|
3381 |
prgm: $(LIB) |
3382 |
cc -o $@ $(LIB) |
3384 |
|
3383 |
|
|
|
3384 |
$(LIB) .LIBRARY : $(LIBm) |
3385 |
ar rv $@ $< |
3385 |
|
3386 |
|
3386 |
Dmake Version 4.11-cvs 2007-07-05 48 |
|
|
3387 |
|
3387 |
|
3388 |
|
3388 |
|
|
|
3389 |
Dmake Version 4.11-cvs 2007-08-06 48 |
3389 |
|
3390 |
|
3390 |
|
3391 |
|
3391 |
|
3392 |
|
3392 |
DMAKE(1) DMAKE(1) |
|
|
3393 |
|
3393 |
|
3394 |
|
3394 |
|
3395 |
SRC= a b |
3395 |
DMAKE(1) DMAKE(1) |
3396 |
LIB= lib |
|
|
3397 |
LIBm= { $(SRC) }.o |
3398 |
|
3396 |
|
3399 |
prgm: $(LIB) |
|
|
3400 |
cc -o $@ $(LIB) |
3401 |
|
3397 |
|
3402 |
$(LIB) .LIBRARY : $(LIBm) |
|
|
3403 |
ar rv $@ $< |
3404 |
rm $< |
3398 |
rm $< |
3405 |
|
3399 |
|
3406 |
Finally, suppose that each of the source files in the previous example |
3400 |
Finally, suppose that each of the source files in the previous example |
Lines 3456-3482
Link Here
|
3456 |
the restriction that str must match the following regular |
3450 |
the restriction that str must match the following regular |
3457 |
expression: |
3451 |
expression: |
3458 |
|
3452 |
|
|
|
3453 |
str[ |\t][ |\t]* |
3459 |
|
3454 |
|
|
|
3455 |
(ie. str only matches at the end of a token where str is a |
3456 |
suffix and is terminated by a space, a tab, or end of line) |
3457 |
Normally sub is expanded before the substitution is made, if |
3458 |
you specify -A on the command line then sub is not expanded. |
3460 |
|
3459 |
|
|
|
3460 |
3. The macro % is defined to be $@ (ie. $% expands to the same |
3461 |
value as $@). |
3461 |
|
3462 |
|
3462 |
Dmake Version 4.11-cvs 2007-07-05 49 |
|
|
3463 |
|
3463 |
|
3464 |
|
3464 |
|
3465 |
|
3465 |
|
|
|
3466 |
Dmake Version 4.11-cvs 2007-08-06 49 |
3466 |
|
3467 |
|
3467 |
|
3468 |
|
3468 |
DMAKE(1) DMAKE(1) |
|
|
3469 |
|
3469 |
|
3470 |
|
3470 |
|
3471 |
str[ |\t][ |\t]* |
|
|
3472 |
|
3471 |
|
3473 |
(ie. str only matches at the end of a token where str is a |
3472 |
DMAKE(1) DMAKE(1) |
3474 |
suffix and is terminated by a space, a tab, or end of line) |
|
|
3475 |
Normally sub is expanded before the substitution is made, if |
3476 |
you specify -A on the command line then sub is not expanded. |
3477 |
|
3473 |
|
3478 |
3. The macro % is defined to be $@ (ie. $% expands to the same |
|
|
3479 |
value as $@). |
3480 |
|
3474 |
|
3481 |
4. The AUGMAKE notion of libraries is handled correctly. |
3475 |
4. The AUGMAKE notion of libraries is handled correctly. |
3482 |
|
3476 |
|
Lines 3533-3560
Link Here
|
3533 |
AUTHOR |
3527 |
AUTHOR |
3534 |
Dennis Vadura, dvadura@wticorp.com |
3528 |
Dennis Vadura, dvadura@wticorp.com |
3535 |
Many thanks to Carl Seger for his helpful suggestions, and to Trevor |
3529 |
Many thanks to Carl Seger for his helpful suggestions, and to Trevor |
|
|
3530 |
John Thompson for his many excellent ideas and informative bug reports. |
3531 |
Many thanks also go to those on the NET that have helped in making |
3532 |
dmake one of the best Make tools available. |
3536 |
|
3533 |
|
|
|
3534 |
BUGS |
3535 |
Some system commands return non-zero status inappropriately. Use -i |
3536 |
(`-' within the makefile) to overcome the difficulty. |
3537 |
|
3537 |
|
|
|
3538 |
Some systems do not have easily accessible time stamps for library mem- |
3539 |
bers (MSDOS, AMIGA, etc) for these dmake uses the time stamp of the |
3538 |
|
3540 |
|
3539 |
Dmake Version 4.11-cvs 2007-07-05 50 |
|
|
3540 |
|
3541 |
|
3541 |
|
3542 |
|
|
|
3543 |
Dmake Version 4.11-cvs 2007-08-06 50 |
3542 |
|
3544 |
|
3543 |
|
3545 |
|
3544 |
|
3546 |
|
3545 |
DMAKE(1) DMAKE(1) |
|
|
3546 |
|
3547 |
|
3547 |
|
3548 |
|
3548 |
John Thompson for his many excellent ideas and informative bug reports. |
3549 |
DMAKE(1) DMAKE(1) |
3549 |
Many thanks also go to those on the NET that have helped in making |
|
|
3550 |
dmake one of the best Make tools available. |
3551 |
|
3550 |
|
3552 |
BUGS |
|
|
3553 |
Some system commands return non-zero status inappropriately. Use -i |
3554 |
(`-' within the makefile) to overcome the difficulty. |
3555 |
|
3551 |
|
3556 |
Some systems do not have easily accessible time stamps for library mem- |
|
|
3557 |
bers (MSDOS, AMIGA, etc) for these dmake uses the time stamp of the |
3558 |
library instead and prints a warning the first time it does so. This |
3552 |
library instead and prints a warning the first time it does so. This |
3559 |
is almost always ok, except when multiple makefiles update a single |
3553 |
is almost always ok, except when multiple makefiles update a single |
3560 |
library file. In these instances it is possible to miss an update if |
3554 |
library file. In these instances it is possible to miss an update if |
Lines 3613-3618
Link Here
|
3613 |
|
3607 |
|
3614 |
|
3608 |
|
3615 |
|
3609 |
|
3616 |
Dmake Version 4.11-cvs 2007-07-05 51 |
3610 |
|
|
|
3611 |
|
3612 |
|
3613 |
|
3614 |
|
3615 |
|
3616 |
|
3617 |
|
3618 |
|
3619 |
|
3620 |
Dmake Version 4.11-cvs 2007-08-06 51 |
3617 |
|
3621 |
|
3618 |
|
3622 |
|