mirror of
https://github.com/mirror/make.git
synced 2026-08-25 19:33:28 +08:00
Compare commits
480 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2ffc653aa | ||
|
|
4e58a6ca4c | ||
|
|
41dcca8426 | ||
|
|
161a026602 | ||
|
|
e244062995 | ||
|
|
24fec5cb53 | ||
|
|
b903988475 | ||
|
|
6ea87be73b | ||
|
|
f6490d62cf | ||
|
|
480ad62713 | ||
|
|
acd666ce50 | ||
|
|
be3fb0ae6d | ||
|
|
dd0c939e78 | ||
|
|
fff468765c | ||
|
|
63dff1e0bc | ||
|
|
e746a9c951 | ||
|
|
74d4418f1c | ||
|
|
062e5f6aae | ||
|
|
c495345f7c | ||
|
|
f0239bb0af | ||
|
|
2d29a55137 | ||
|
|
806c7aa46c | ||
|
|
47daa6787e | ||
|
|
eb4d510a74 | ||
|
|
c86587fb9b | ||
|
|
fd688f6e9c | ||
|
|
f96ef9a409 | ||
|
|
09616e5837 | ||
|
|
cf9aa5b70b | ||
|
|
9033f1a656 | ||
|
|
ccfe89b829 | ||
|
|
35f1bbbe23 | ||
|
|
9f88582943 | ||
|
|
b38d9d2ae9 | ||
|
|
132e0eda6c | ||
|
|
c297b2fbd5 | ||
|
|
ec08feae97 | ||
|
|
8c7887ac02 | ||
|
|
08cf536bfb | ||
|
|
b48b02c7f4 | ||
|
|
e7a0e14a43 | ||
|
|
6413a1d08e | ||
|
|
8f34c48e3f | ||
|
|
818bb8940c | ||
|
|
cc4d91d751 | ||
|
|
36d804bd51 | ||
|
|
f95d071efc | ||
|
|
c0deecf9ee | ||
|
|
dd63648825 | ||
|
|
229ba33d0e | ||
|
|
ccbe33db90 | ||
|
|
32efbf8dc3 | ||
|
|
6e3b0629f1 | ||
|
|
51659ed000 | ||
|
|
7827f1bde8 | ||
|
|
922730c406 | ||
|
|
5e91041347 | ||
|
|
9f7ba4a505 | ||
|
|
2745ed943b | ||
|
|
0cb72b4a51 | ||
|
|
73fcfdbe24 | ||
|
|
0ada207e2d | ||
|
|
7bb7ba7849 | ||
|
|
2a294c52d1 | ||
|
|
71515366cd | ||
|
|
d78f2db327 | ||
|
|
30c9fcfec3 | ||
|
|
e2b79aacf7 | ||
|
|
e981c049f4 | ||
|
|
9012013552 | ||
|
|
cda4f25fd4 | ||
|
|
b32b9197ab | ||
|
|
b66145d8bc | ||
|
|
d2fe84cab3 | ||
|
|
c2ea8e2486 | ||
|
|
db2384b9ab | ||
|
|
9b0b3a6e70 | ||
|
|
a71d56b4cc | ||
|
|
10011ce289 | ||
|
|
84a9fd68b7 | ||
|
|
262ca66cb7 | ||
|
|
a1eb3e67cd | ||
|
|
78a4848b83 | ||
|
|
b16829dc46 | ||
|
|
c71e4ac269 | ||
|
|
82e6316607 | ||
|
|
a8de4b93e3 | ||
|
|
6e7fa14c65 | ||
|
|
5206d3f2bc | ||
|
|
e2da48ca55 | ||
|
|
bc26243d90 | ||
|
|
b4db97478e | ||
|
|
4e361d0f01 | ||
|
|
d5d49d2e5a | ||
|
|
191dc2b434 | ||
|
|
6fa74367b7 | ||
|
|
4cee1500a4 | ||
|
|
2602fb8e71 | ||
|
|
bfce132399 | ||
|
|
30cf28ef63 | ||
|
|
a7f3831457 | ||
|
|
bcd11d854b | ||
|
|
bb01a1a810 | ||
|
|
c622dd9bdf | ||
|
|
7092951361 | ||
|
|
88d39b2a22 | ||
|
|
3863dbeb03 | ||
|
|
cca242e6e3 | ||
|
|
7082394702 | ||
|
|
1f0bf7b4db | ||
|
|
b18ce15130 | ||
|
|
c41efad63b | ||
|
|
683c716de3 | ||
|
|
29253a9683 | ||
|
|
9cc98648fd | ||
|
|
d3c192e4a6 | ||
|
|
08905cdcbc | ||
|
|
4b72e38789 | ||
|
|
ce17fda12f | ||
|
|
2df6034eb6 | ||
|
|
dd0fe8f1ee | ||
|
|
37fbc32ba4 | ||
|
|
64bdaa521f | ||
|
|
37ce7efdca | ||
|
|
4b92c539d4 | ||
|
|
a22f67aaf7 | ||
|
|
9fc574683d | ||
|
|
c8e016d07a | ||
|
|
c396f06a21 | ||
|
|
fc47a2c83c | ||
|
|
561b384313 | ||
|
|
88942403a6 | ||
|
|
8733fbd646 | ||
|
|
cf2db2cf3c | ||
|
|
f0cea20864 | ||
|
|
fcb18b988b | ||
|
|
8b24ec18b0 | ||
|
|
df5ba0ef96 | ||
|
|
74475bb939 | ||
|
|
22ffba3660 | ||
|
|
9603eb13a0 | ||
|
|
fde68d03f3 | ||
|
|
56162c4968 | ||
|
|
f78bcc2e72 | ||
|
|
0c23819036 | ||
|
|
91a7257252 | ||
|
|
d5f0b88095 | ||
|
|
3024918fcd | ||
|
|
bdc49369eb | ||
|
|
610526fee7 | ||
|
|
3f60c36245 | ||
|
|
bd88059c38 | ||
|
|
63f3cf925b | ||
|
|
8541e3345d | ||
|
|
d86e4a26c8 | ||
|
|
2c973c0b46 | ||
|
|
e0620ee179 | ||
|
|
dac23b2d0b | ||
|
|
783e6680b2 | ||
|
|
2529deb2bf | ||
|
|
3d3252b8de | ||
|
|
b14b16769c | ||
|
|
e7a525c5d5 | ||
|
|
d369e0531a | ||
|
|
6701f24bbb | ||
|
|
e76076e334 | ||
|
|
673e04af3a | ||
|
|
bc8ac28654 | ||
|
|
95744a1491 | ||
|
|
78f280d541 | ||
|
|
44811ac351 | ||
|
|
6cf0e549f7 | ||
|
|
25d9818333 | ||
|
|
2a905c5e5a | ||
|
|
0ddf0df13c | ||
|
|
b4dcc6f6bd | ||
|
|
c8484a6170 | ||
|
|
7431536bed | ||
|
|
678b14fb7e | ||
|
|
efbe1b6411 | ||
|
|
5fb14db85f | ||
|
|
df99d7af1f | ||
|
|
db561cfc3e | ||
|
|
0feb1dd25f | ||
|
|
e2d8bf4aa4 | ||
|
|
dc27ebc311 | ||
|
|
989d9ecaae | ||
|
|
b0098dfd6a | ||
|
|
40a08e8a62 | ||
|
|
5e728dfa57 | ||
|
|
085eac4c74 | ||
|
|
085caaa900 | ||
|
|
cc28a52f40 | ||
|
|
1e38c11f3c | ||
|
|
58af8d9dd1 | ||
|
|
abe5f64440 | ||
|
|
68b9650616 | ||
|
|
5dfa403ec8 | ||
|
|
f7ecda9a35 | ||
|
|
e99a3aca7e | ||
|
|
73c52a3b12 | ||
|
|
4679c702de | ||
|
|
59cb26b58b | ||
|
|
386e27b622 | ||
|
|
68db062e1e | ||
|
|
a67e842fb1 | ||
|
|
712c43dde1 | ||
|
|
c0e8c1012d | ||
|
|
c97502625c | ||
|
|
9e443adaf6 | ||
|
|
dfefc77263 | ||
|
|
ee7af57e3c | ||
|
|
46a1497b8e | ||
|
|
4603f9f8c6 | ||
|
|
b2a22df721 | ||
|
|
89785948f6 | ||
|
|
8b2aca5930 | ||
|
|
b8ea37e31c | ||
|
|
e044fe76f6 | ||
|
|
557392f016 | ||
|
|
eaecc11501 | ||
|
|
b25f811f51 | ||
|
|
34b0c6b3b4 | ||
|
|
2de9513b20 | ||
|
|
8eb20e9d92 | ||
|
|
32979e8122 | ||
|
|
490f35dda4 | ||
|
|
a579af186b | ||
|
|
01d08292bc | ||
|
|
f9c4aae3bf | ||
|
|
74e456e107 | ||
|
|
f8b096b9fd | ||
|
|
527201342c | ||
|
|
5f1e98e59b | ||
|
|
f4020bfba8 | ||
|
|
4792e6f5c0 | ||
|
|
514eda2bda | ||
|
|
310f677b84 | ||
|
|
f323abd6b3 | ||
|
|
b07e961db1 | ||
|
|
5958f28900 | ||
|
|
fd504b4d84 | ||
|
|
1bb24cbbbb | ||
|
|
b255a75bab | ||
|
|
0569ceb303 | ||
|
|
8021c41954 | ||
|
|
edd7981e49 | ||
|
|
715363eb49 | ||
|
|
c36430699e | ||
|
|
5f99dee5b5 | ||
|
|
9521ecc573 | ||
|
|
cb69b06199 | ||
|
|
21fed1fbcc | ||
|
|
17aef36902 | ||
|
|
98f8d6286e | ||
|
|
d96d52d27d | ||
|
|
625b9f6ba2 | ||
|
|
8756e81616 | ||
|
|
3e141c8277 | ||
|
|
aaed50ac3f | ||
|
|
a89eb21084 | ||
|
|
4356ddddbc | ||
|
|
b8db661c24 | ||
|
|
a54c552d39 | ||
|
|
25d48503eb | ||
|
|
5df0d41985 | ||
|
|
737e056a89 | ||
|
|
8c13a20895 | ||
|
|
2a0707e1b8 | ||
|
|
d116acac75 | ||
|
|
6ab25d18b2 | ||
|
|
4061695ef6 | ||
|
|
e3200b9303 | ||
|
|
18a7013e55 | ||
|
|
624552badd | ||
|
|
76d037cb95 | ||
|
|
dfdf1bec21 | ||
|
|
caa2fe5d39 | ||
|
|
2f506a6d52 | ||
|
|
856d83462f | ||
|
|
e9fcf7ea88 | ||
|
|
bfa6ab6a0c | ||
|
|
4e6de57b8f | ||
|
|
41e6704efd | ||
|
|
ffea662953 | ||
|
|
db5cc03f75 | ||
|
|
cd851988e7 | ||
|
|
fb39f49937 | ||
|
|
dccc12dbee | ||
|
|
1305447ace | ||
|
|
5ed1a6399a | ||
|
|
3f614c58ed | ||
|
|
37cf6fdc18 | ||
|
|
808f1c1cd2 | ||
|
|
06021f945f | ||
|
|
ad61285598 | ||
|
|
10d6808977 | ||
|
|
21fbad8602 | ||
|
|
fa6d6f9150 | ||
|
|
ed02723506 | ||
|
|
692858922f | ||
|
|
9da3bccd89 | ||
|
|
16a5d4cf48 | ||
|
|
b1e6353edd | ||
|
|
e1c593016b | ||
|
|
10124ce95b | ||
|
|
6e19c6febb | ||
|
|
4314e2f987 | ||
|
|
0eab889a28 | ||
|
|
c51dd24814 | ||
|
|
41ea0f1556 | ||
|
|
ee6b27b728 | ||
|
|
af72fc38fe | ||
|
|
294c429f93 | ||
|
|
9409f5c54a | ||
|
|
78ac5bd9c7 | ||
|
|
030d31ba93 | ||
|
|
70465ffcfb | ||
|
|
ee2b67af6d | ||
|
|
0afe62e255 | ||
|
|
ee14af651f | ||
|
|
9fd3c2453b | ||
|
|
a4e66c61c0 | ||
|
|
8cfdca3e72 | ||
|
|
2c27d8dbdc | ||
|
|
d02b26a4b8 | ||
|
|
8b3f13f6ec | ||
|
|
e74b6ae5c2 | ||
|
|
f21ec15ffa | ||
|
|
3f49392b9c | ||
|
|
f9a914c035 | ||
|
|
b2fc502c55 | ||
|
|
d091a08961 | ||
|
|
eb3b7904f0 | ||
|
|
bbfb270092 | ||
|
|
c18253b59b | ||
|
|
41177916df | ||
|
|
7acd99c5e6 | ||
|
|
d6c62b351f | ||
|
|
c9c43b0871 | ||
|
|
13e8568f03 | ||
|
|
cebdba9dfa | ||
|
|
4ea152e71b | ||
|
|
443f39f4f7 | ||
|
|
675981bc4f | ||
|
|
11af972f87 | ||
|
|
d9c126da40 | ||
|
|
7170467928 | ||
|
|
81699266d3 | ||
|
|
cbdb3653da | ||
|
|
5d82479d89 | ||
|
|
ed0d607279 | ||
|
|
855bd6896d | ||
|
|
179ef370e8 | ||
|
|
01dc9a22f9 | ||
|
|
bc15ada5ed | ||
|
|
fce5e4a9b9 | ||
|
|
07a45cd0af | ||
|
|
226a132e31 | ||
|
|
b59f5f30b9 | ||
|
|
acdd73ea34 | ||
|
|
38b5b27eb5 | ||
|
|
e8325b9be2 | ||
|
|
f8eb0fc41b | ||
|
|
ea38e1fe78 | ||
|
|
ed276c008d | ||
|
|
910d25619e | ||
|
|
2ae5430550 | ||
|
|
e53ac8a6fc | ||
|
|
cb51d55ab2 | ||
|
|
0b4723a689 | ||
|
|
3f9ce84b4a | ||
|
|
bdbe8501c6 | ||
|
|
3a12be3a73 | ||
|
|
2346f99368 | ||
|
|
d855846472 | ||
|
|
b9f7d21e42 | ||
|
|
db089ad3e3 | ||
|
|
1331cca1fa | ||
|
|
fe05aaf7f2 | ||
|
|
cc35ff7381 | ||
|
|
a146085382 | ||
|
|
79fcb77ad1 | ||
|
|
3608635ec6 | ||
|
|
ca53696814 | ||
|
|
61dac07200 | ||
|
|
9e42026e08 | ||
|
|
b52ea79ee6 | ||
|
|
e483431569 | ||
|
|
28b622b8a1 | ||
|
|
cbfc50cb51 | ||
|
|
deb7cced6e | ||
|
|
f9af56ac67 | ||
|
|
3ba2e947ac | ||
|
|
13d0eeb8e5 | ||
|
|
d9f063656b | ||
|
|
aceefb74da | ||
|
|
f38d98e988 | ||
|
|
ff8ff73e65 | ||
|
|
8478b0c10a | ||
|
|
1adf3a07dc | ||
|
|
a5a27a893d | ||
|
|
595f7598ae | ||
|
|
8bc1a424e2 | ||
|
|
5e69859273 | ||
|
|
3a0f9ce0cb | ||
|
|
3aabdf96a1 | ||
|
|
55b99d4151 | ||
|
|
f3699ad75f | ||
|
|
0af0c8dba0 | ||
|
|
1280ee49bb | ||
|
|
8fc1187283 | ||
|
|
e8dcf11ae0 | ||
|
|
ce40d6af9f | ||
|
|
636435e5c2 | ||
|
|
0733d6947d | ||
|
|
b91d62feb3 | ||
|
|
f6d5cdba19 | ||
|
|
fcb29e5e96 | ||
|
|
d7a043b46c | ||
|
|
d85ab5953a | ||
|
|
93dd485ab6 | ||
|
|
5c350f4fd5 | ||
|
|
514c4bac33 | ||
|
|
8f24715a10 | ||
|
|
4c7f18cd09 | ||
|
|
c5af4810ff | ||
|
|
551c4322cb | ||
|
|
e33c50b1e2 | ||
|
|
bc1e6b66f1 | ||
|
|
bbd5e695f5 | ||
|
|
f3cfccf0b8 | ||
|
|
016e1beef5 | ||
|
|
21a8ec0d72 | ||
|
|
fecd9e661a | ||
|
|
2914c705e5 | ||
|
|
3f506aaf90 | ||
|
|
75ea6c3ce2 | ||
|
|
3fb9ebf83f | ||
|
|
b4890bdb1c | ||
|
|
2cbfa1024a | ||
|
|
258dad0f9a | ||
|
|
37358a9a82 | ||
|
|
e167e0a3c2 | ||
|
|
7879457545 | ||
|
|
d525f4dd72 | ||
|
|
bd19554ea7 | ||
|
|
fffc384bfc | ||
|
|
afd1d69e7d | ||
|
|
c1305a1a18 | ||
|
|
43d5fbfc88 | ||
|
|
a4642a6a57 | ||
|
|
11ca7f1ead | ||
|
|
4aa992616f | ||
|
|
ab0fb2fa6f | ||
|
|
e1dd3bfa4a | ||
|
|
86238ec9d3 | ||
|
|
2e9779fdb4 | ||
|
|
b61a13463d | ||
|
|
d3b9c35c8f | ||
|
|
c50b75b439 | ||
|
|
7376280c33 | ||
|
|
3c767901f6 | ||
|
|
c6dfff5f1b | ||
|
|
74540a1e91 | ||
|
|
5159db0aa4 | ||
|
|
e495d2380d | ||
|
|
1ed34a0118 | ||
|
|
e8f64b2c88 | ||
|
|
4867409da2 | ||
|
|
f801fc3521 | ||
|
|
b2c0446e71 | ||
|
|
8f98ceb724 | ||
|
|
dea9990bc8 | ||
|
|
e4c43aab3e | ||
|
|
e55ed78080 | ||
|
|
ca54a0b991 | ||
|
|
e25e2fb7f5 | ||
|
|
1a886b6359 | ||
|
|
b511712f25 |
17
.cvsignore
Normal file
17
.cvsignore
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
*.gz *.Z *.tar *.tgz
|
||||||
|
=*
|
||||||
|
TODO COPYING*
|
||||||
|
make-3* make-test*
|
||||||
|
*.info *.info-*
|
||||||
|
stamp-*
|
||||||
|
makebook*
|
||||||
|
|
||||||
|
.*gdbinit
|
||||||
|
|
||||||
|
*.dep *.dvi *.toc *.aux *.log
|
||||||
|
*.cp *.cps *.fn *.fns *.vr *.vrs *.tp *.tps *.ky *.kys *.pg *.pgs
|
||||||
|
|
||||||
|
sun4 i386 i386-netbsd hp300-netbsd hp300 rs6000 sun3 news800 amiga
|
||||||
|
hp700 hp834 mips sol2 i486-linux
|
||||||
|
|
||||||
|
customs
|
||||||
50
AUTHORS
Normal file
50
AUTHORS
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
-----------------------------------
|
||||||
|
|
||||||
|
GNU make development up to version 3.75 by:
|
||||||
|
Roland McGrath <roland@gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
|
||||||
|
GNU Make User's Manual written by:
|
||||||
|
Richard M. Stallman <rms@gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
User's Manual edited by:
|
||||||
|
Roland McGrath <roland@gnu.ai.mit.edu>
|
||||||
|
Bob Chassell <bob@gnu.ai.mit.edu>
|
||||||
|
Melissa Weisshaus <melissa@gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
|
||||||
|
Development and maintenance starting with GNU make 3.76 by:
|
||||||
|
Paul D. Smith <psmith@gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------
|
||||||
|
GNU Make porting efforts:
|
||||||
|
|
||||||
|
Port to VMS by:
|
||||||
|
Klaus Kaempf <kkaempf@progis.de>
|
||||||
|
Archive support/Bug fixes by John W. Eaton <jwe@bevo.che.wisc.edu>
|
||||||
|
|
||||||
|
Port to Amiga by:
|
||||||
|
Aaron Digulla <digulla@fh-konstanz.de>
|
||||||
|
|
||||||
|
|
||||||
|
Port to MS-DOS (DJGPP) and MS-Windows 95/NT by:
|
||||||
|
DJ Delorie <dj@delorie.com>
|
||||||
|
Rob Tulloh <rob_tulloh@tivoli.com>
|
||||||
|
Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
|
|
||||||
|
-----------------------------------
|
||||||
|
Other contributors:
|
||||||
|
|
||||||
|
Janet Carson <janet_carson@tivoli.com>
|
||||||
|
Paul Eggert <eggert@twinsun.com>
|
||||||
|
Klaus Heinz <kamar@ease.rhein-main.de>
|
||||||
|
Michael Joosten
|
||||||
|
Jim Kelton <jim_kelton@tivoli.com>
|
||||||
|
David Lubbren <uhay@rz.uni-karlsruhe.de>
|
||||||
|
Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||||
|
Carl Staelin (Princeton University)
|
||||||
|
Ian Stewartson (Data Logic Limited)
|
||||||
|
|
||||||
|
With suggestions/comments/bug reports from a cast of ... well ...
|
||||||
|
hundreds, anyway :)
|
||||||
340
COPYING
Normal file
340
COPYING
Normal file
@@ -0,0 +1,340 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 2, June 1991
|
||||||
|
|
||||||
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||||
|
59 Temple Place - Suite 330, Boston, MA
|
||||||
|
02111-1307, USA.
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The licenses for most software are designed to take away your
|
||||||
|
freedom to share and change it. By contrast, the GNU General Public
|
||||||
|
License is intended to guarantee your freedom to share and change free
|
||||||
|
software--to make sure the software is free for all its users. This
|
||||||
|
General Public License applies to most of the Free Software
|
||||||
|
Foundation's software and to any other program whose authors commit to
|
||||||
|
using it. (Some other Free Software Foundation software is covered by
|
||||||
|
the GNU Library General Public License instead.) You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
this service if you wish), that you receive source code or can get it
|
||||||
|
if you want it, that you can change the software or use pieces of it
|
||||||
|
in new free programs; and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to make restrictions that forbid
|
||||||
|
anyone to deny you these rights or to ask you to surrender the rights.
|
||||||
|
These restrictions translate to certain responsibilities for you if you
|
||||||
|
distribute copies of the software, or if you modify it.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must give the recipients all the rights that
|
||||||
|
you have. You must make sure that they, too, receive or can get the
|
||||||
|
source code. And you must show them these terms so they know their
|
||||||
|
rights.
|
||||||
|
|
||||||
|
We protect your rights with two steps: (1) copyright the software, and
|
||||||
|
(2) offer you this license which gives you legal permission to copy,
|
||||||
|
distribute and/or modify the software.
|
||||||
|
|
||||||
|
Also, for each author's protection and ours, we want to make certain
|
||||||
|
that everyone understands that there is no warranty for this free
|
||||||
|
software. If the software is modified by someone else and passed on, we
|
||||||
|
want its recipients to know that what they have is not the original, so
|
||||||
|
that any problems introduced by others will not reflect on the original
|
||||||
|
authors' reputations.
|
||||||
|
|
||||||
|
Finally, any free program is threatened constantly by software
|
||||||
|
patents. We wish to avoid the danger that redistributors of a free
|
||||||
|
program will individually obtain patent licenses, in effect making the
|
||||||
|
program proprietary. To prevent this, we have made it clear that any
|
||||||
|
patent must be licensed for everyone's free use or not licensed at all.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. This License applies to any program or other work which contains
|
||||||
|
a notice placed by the copyright holder saying it may be distributed
|
||||||
|
under the terms of this General Public License. The "Program", below,
|
||||||
|
refers to any such program or work, and a "work based on the Program"
|
||||||
|
means either the Program or any derivative work under copyright law:
|
||||||
|
that is to say, a work containing the Program or a portion of it,
|
||||||
|
either verbatim or with modifications and/or translated into another
|
||||||
|
language. (Hereinafter, translation is included without limitation in
|
||||||
|
the term "modification".) Each licensee is addressed as "you".
|
||||||
|
|
||||||
|
Activities other than copying, distribution and modification are not
|
||||||
|
covered by this License; they are outside its scope. The act of
|
||||||
|
running the Program is not restricted, and the output from the Program
|
||||||
|
is covered only if its contents constitute a work based on the
|
||||||
|
Program (independent of having been made by running the Program).
|
||||||
|
Whether that is true depends on what the Program does.
|
||||||
|
|
||||||
|
1. You may copy and distribute verbatim copies of the Program's
|
||||||
|
source code as you receive it, in any medium, provided that you
|
||||||
|
conspicuously and appropriately publish on each copy an appropriate
|
||||||
|
copyright notice and disclaimer of warranty; keep intact all the
|
||||||
|
notices that refer to this License and to the absence of any warranty;
|
||||||
|
and give any other recipients of the Program a copy of this License
|
||||||
|
along with the Program.
|
||||||
|
|
||||||
|
You may charge a fee for the physical act of transferring a copy, and
|
||||||
|
you may at your option offer warranty protection in exchange for a fee.
|
||||||
|
|
||||||
|
2. You may modify your copy or copies of the Program or any portion
|
||||||
|
of it, thus forming a work based on the Program, and copy and
|
||||||
|
distribute such modifications or work under the terms of Section 1
|
||||||
|
above, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) You must cause the modified files to carry prominent notices
|
||||||
|
stating that you changed the files and the date of any change.
|
||||||
|
|
||||||
|
b) You must cause any work that you distribute or publish, that in
|
||||||
|
whole or in part contains or is derived from the Program or any
|
||||||
|
part thereof, to be licensed as a whole at no charge to all third
|
||||||
|
parties under the terms of this License.
|
||||||
|
|
||||||
|
c) If the modified program normally reads commands interactively
|
||||||
|
when run, you must cause it, when started running for such
|
||||||
|
interactive use in the most ordinary way, to print or display an
|
||||||
|
announcement including an appropriate copyright notice and a
|
||||||
|
notice that there is no warranty (or else, saying that you provide
|
||||||
|
a warranty) and that users may redistribute the program under
|
||||||
|
these conditions, and telling the user how to view a copy of this
|
||||||
|
License. (Exception: if the Program itself is interactive but
|
||||||
|
does not normally print such an announcement, your work based on
|
||||||
|
the Program is not required to print an announcement.)
|
||||||
|
|
||||||
|
These requirements apply to the modified work as a whole. If
|
||||||
|
identifiable sections of that work are not derived from the Program,
|
||||||
|
and can be reasonably considered independent and separate works in
|
||||||
|
themselves, then this License, and its terms, do not apply to those
|
||||||
|
sections when you distribute them as separate works. But when you
|
||||||
|
distribute the same sections as part of a whole which is a work based
|
||||||
|
on the Program, the distribution of the whole must be on the terms of
|
||||||
|
this License, whose permissions for other licensees extend to the
|
||||||
|
entire whole, and thus to each and every part regardless of who wrote it.
|
||||||
|
|
||||||
|
Thus, it is not the intent of this section to claim rights or contest
|
||||||
|
your rights to work written entirely by you; rather, the intent is to
|
||||||
|
exercise the right to control the distribution of derivative or
|
||||||
|
collective works based on the Program.
|
||||||
|
|
||||||
|
In addition, mere aggregation of another work not based on the Program
|
||||||
|
with the Program (or with a work based on the Program) on a volume of
|
||||||
|
a storage or distribution medium does not bring the other work under
|
||||||
|
the scope of this License.
|
||||||
|
|
||||||
|
3. You may copy and distribute the Program (or a work based on it,
|
||||||
|
under Section 2) in object code or executable form under the terms of
|
||||||
|
Sections 1 and 2 above provided that you also do one of the following:
|
||||||
|
|
||||||
|
a) Accompany it with the complete corresponding machine-readable
|
||||||
|
source code, which must be distributed under the terms of Sections
|
||||||
|
1 and 2 above on a medium customarily used for software interchange; or,
|
||||||
|
|
||||||
|
b) Accompany it with a written offer, valid for at least three
|
||||||
|
years, to give any third party, for a charge no more than your
|
||||||
|
cost of physically performing source distribution, a complete
|
||||||
|
machine-readable copy of the corresponding source code, to be
|
||||||
|
distributed under the terms of Sections 1 and 2 above on a medium
|
||||||
|
customarily used for software interchange; or,
|
||||||
|
|
||||||
|
c) Accompany it with the information you received as to the offer
|
||||||
|
to distribute corresponding source code. (This alternative is
|
||||||
|
allowed only for noncommercial distribution and only if you
|
||||||
|
received the program in object code or executable form with such
|
||||||
|
an offer, in accord with Subsection b above.)
|
||||||
|
|
||||||
|
The source code for a work means the preferred form of the work for
|
||||||
|
making modifications to it. For an executable work, complete source
|
||||||
|
code means all the source code for all modules it contains, plus any
|
||||||
|
associated interface definition files, plus the scripts used to
|
||||||
|
control compilation and installation of the executable. However, as a
|
||||||
|
special exception, the source code distributed need not include
|
||||||
|
anything that is normally distributed (in either source or binary
|
||||||
|
form) with the major components (compiler, kernel, and so on) of the
|
||||||
|
operating system on which the executable runs, unless that component
|
||||||
|
itself accompanies the executable.
|
||||||
|
|
||||||
|
If distribution of executable or object code is made by offering
|
||||||
|
access to copy from a designated place, then offering equivalent
|
||||||
|
access to copy the source code from the same place counts as
|
||||||
|
distribution of the source code, even though third parties are not
|
||||||
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
|
4. You may not copy, modify, sublicense, or distribute the Program
|
||||||
|
except as expressly provided under this License. Any attempt
|
||||||
|
otherwise to copy, modify, sublicense or distribute the Program is
|
||||||
|
void, and will automatically terminate your rights under this License.
|
||||||
|
However, parties who have received copies, or rights, from you under
|
||||||
|
this License will not have their licenses terminated so long as such
|
||||||
|
parties remain in full compliance.
|
||||||
|
|
||||||
|
5. You are not required to accept this License, since you have not
|
||||||
|
signed it. However, nothing else grants you permission to modify or
|
||||||
|
distribute the Program or its derivative works. These actions are
|
||||||
|
prohibited by law if you do not accept this License. Therefore, by
|
||||||
|
modifying or distributing the Program (or any work based on the
|
||||||
|
Program), you indicate your acceptance of this License to do so, and
|
||||||
|
all its terms and conditions for copying, distributing or modifying
|
||||||
|
the Program or works based on it.
|
||||||
|
|
||||||
|
6. Each time you redistribute the Program (or any work based on the
|
||||||
|
Program), the recipient automatically receives a license from the
|
||||||
|
original licensor to copy, distribute or modify the Program subject to
|
||||||
|
these terms and conditions. You may not impose any further
|
||||||
|
restrictions on the recipients' exercise of the rights granted herein.
|
||||||
|
You are not responsible for enforcing compliance by third parties to
|
||||||
|
this License.
|
||||||
|
|
||||||
|
7. If, as a consequence of a court judgment or allegation of patent
|
||||||
|
infringement or for any other reason (not limited to patent issues),
|
||||||
|
conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot
|
||||||
|
distribute so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you
|
||||||
|
may not distribute the Program at all. For example, if a patent
|
||||||
|
license would not permit royalty-free redistribution of the Program by
|
||||||
|
all those who receive copies directly or indirectly through you, then
|
||||||
|
the only way you could satisfy both it and this License would be to
|
||||||
|
refrain entirely from distribution of the Program.
|
||||||
|
|
||||||
|
If any portion of this section is held invalid or unenforceable under
|
||||||
|
any particular circumstance, the balance of the section is intended to
|
||||||
|
apply and the section as a whole is intended to apply in other
|
||||||
|
circumstances.
|
||||||
|
|
||||||
|
It is not the purpose of this section to induce you to infringe any
|
||||||
|
patents or other property right claims or to contest validity of any
|
||||||
|
such claims; this section has the sole purpose of protecting the
|
||||||
|
integrity of the free software distribution system, which is
|
||||||
|
implemented by public license practices. Many people have made
|
||||||
|
generous contributions to the wide range of software distributed
|
||||||
|
through that system in reliance on consistent application of that
|
||||||
|
system; it is up to the author/donor to decide if he or she is willing
|
||||||
|
to distribute software through any other system and a licensee cannot
|
||||||
|
impose that choice.
|
||||||
|
|
||||||
|
This section is intended to make thoroughly clear what is believed to
|
||||||
|
be a consequence of the rest of this License.
|
||||||
|
|
||||||
|
8. If the distribution and/or use of the Program is restricted in
|
||||||
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
|
original copyright holder who places the Program under this License
|
||||||
|
may add an explicit geographical distribution limitation excluding
|
||||||
|
those countries, so that distribution is permitted only in or among
|
||||||
|
countries not thus excluded. In such case, this License incorporates
|
||||||
|
the limitation as if written in the body of this License.
|
||||||
|
|
||||||
|
9. The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the Program
|
||||||
|
specifies a version number of this License which applies to it and "any
|
||||||
|
later version", you have the option of following the terms and conditions
|
||||||
|
either of that version or of any later version published by the Free
|
||||||
|
Software Foundation. If the Program does not specify a version number of
|
||||||
|
this License, you may choose any version ever published by the Free Software
|
||||||
|
Foundation.
|
||||||
|
|
||||||
|
10. If you wish to incorporate parts of the Program into other free
|
||||||
|
programs whose distribution conditions are different, write to the author
|
||||||
|
to ask for permission. For software which is copyrighted by the Free
|
||||||
|
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||||
|
make exceptions for this. Our decision will be guided by the two goals
|
||||||
|
of preserving the free status of all derivatives of our free software and
|
||||||
|
of promoting the sharing and reuse of software generally.
|
||||||
|
|
||||||
|
NO WARRANTY
|
||||||
|
|
||||||
|
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||||
|
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||||
|
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||||
|
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||||
|
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||||
|
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||||
|
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||||
|
REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||||
|
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||||
|
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||||
|
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||||
|
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||||
|
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
Appendix: How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
convey the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) 19yy <name of author>
|
||||||
|
|
||||||
|
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 2 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, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program is interactive, make it output a short notice like this
|
||||||
|
when it starts in an interactive mode:
|
||||||
|
|
||||||
|
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||||
|
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, the commands you use may
|
||||||
|
be called something other than `show w' and `show c'; they could even be
|
||||||
|
mouse-clicks or menu items--whatever suits your program.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or your
|
||||||
|
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||||
|
necessary. Here is a sample; alter the names:
|
||||||
|
|
||||||
|
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||||
|
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||||
|
|
||||||
|
<signature of Ty Coon>, 1 April 1989
|
||||||
|
Ty Coon, President of Vice
|
||||||
|
|
||||||
|
This General Public License does not permit incorporating your program into
|
||||||
|
proprietary programs. If your program is a subroutine library, you may
|
||||||
|
consider it more useful to permit linking proprietary applications with the
|
||||||
|
library. If this is what you want to do, use the GNU Library General
|
||||||
|
Public License instead of this License.
|
||||||
4980
ChangeLog.1
Normal file
4980
ChangeLog.1
Normal file
File diff suppressed because it is too large
Load Diff
307
GNUmakefile
307
GNUmakefile
@@ -1,279 +1,54 @@
|
|||||||
# GNU Make-specific makefile for GNU Make.
|
# This is a maintainer's-only makefile
|
||||||
|
|
||||||
# Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
|
|
||||||
# This file is part of GNU Make.
|
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify
|
# It bootstraps a GNU make maintainer's directory
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
#
|
#
|
||||||
# GNU Make is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
.SUFFIXES:
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
NORECURSE = true
|
||||||
|
|
||||||
|
# If the user asked for a specific target, invoke the Mkaefile instead.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
.DEFAULT:
|
||||||
# along with GNU Make; see the file COPYING. If not, write to
|
@[ -f Makefile.in -a -f configure -a -f aclocal.m4 -a -f config.h.in ] \
|
||||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|| $(MAKE) __cfg NORECURSE=
|
||||||
|
@[ -f Makefile ] \
|
||||||
|
|| ./configure
|
||||||
|
$(MAKE) -f Makefile $@
|
||||||
|
|
||||||
.PHONY: default
|
.PHONY: __cfg __cfg_basic TAGS
|
||||||
default:
|
|
||||||
|
|
||||||
# Set `ARCH' to a string for the type of machine.
|
# This is variable since the glob subdirectory doesn't use it.
|
||||||
ifndef ARCH
|
#
|
||||||
ifdef machine
|
ACCONFIG = acconfig.h
|
||||||
ARCH = $(machine)
|
|
||||||
endif # machine
|
|
||||||
endif # not ARCH
|
|
||||||
|
|
||||||
override srcdir := .
|
__cfg: __cfg_basic config.h.in TAGS
|
||||||
override CC := $(CC)
|
cd glob && $(MAKE) -f ../GNUmakefile __cfg_basic ACCONFIG=
|
||||||
|
ifdef NORECURSE
|
||||||
ifeq ($(ARCH),hp300)
|
@echo ""; echo "Now you should run one of:"; echo ""; \
|
||||||
#customs=yes
|
echo " make all"; \
|
||||||
endif
|
echo " make dist"; \
|
||||||
ifdef customs
|
echo " make distdir"; \
|
||||||
override REMOTE := cstms
|
echo " make distcheck"; echo ""; \
|
||||||
else
|
echo "Or similar to proceed.";\
|
||||||
override REMOTE := stub
|
echo ""
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Get most of the information from the Unix-compatible makefile.
|
__cfg_basic: aclocal.m4 stamp-h.in configure Makefile.in
|
||||||
include compatMakefile
|
|
||||||
|
|
||||||
MAKE = $(MAKE_COMMAND) $(MAKEOVERRIDES)
|
aclocal.m4: configure.in
|
||||||
|
aclocal
|
||||||
|
|
||||||
# Remove autoconf magic.
|
config.h.in: stamp-h.in
|
||||||
extras := $(filter-out getloadavg.o @%@,$(extras)) getloadavg.o
|
stamp-h.in: configure.in aclocal.m4 $(ACCONFIG)
|
||||||
LOADLIBES := $(filter-out @%@,$(LOADLIBES))
|
autoheader
|
||||||
ALLOCA := $(filter-out @%@,$(ALLOCA))
|
echo timestamp > $@
|
||||||
|
|
||||||
ifdef AC_MACRODIR
|
configure: configure.in aclocal.m4
|
||||||
configure config.h.in: $(patsubst %,$(AC_MACRODIR)/%.m4,acspecific acgeneral)
|
autoconf
|
||||||
config.h.in: $(AC_MACRODIR)/acconfig.h
|
|
||||||
endif
|
|
||||||
configure: configure.in; autoconf $(ACFLAGS)
|
|
||||||
config.h.in: configure.in; autoheader $(ACFLAGS)
|
|
||||||
|
|
||||||
ifdef customs
|
Makefile.in: configure.in config.h.in Makefile.am aclocal.m4
|
||||||
defines := $(defines) -Ipmake/customs -Ipmake/lib/include
|
automake --add-missing
|
||||||
LOADLIBES := $(addprefix pmake/customs/,customslib.o rpc.o xlog.o) \
|
|
||||||
pmake/lib/sprite/libsprite.a
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef ARCH
|
TAGS:
|
||||||
|
find . -name '*.[ch]' -print | etags -
|
||||||
ifndef no_libc
|
|
||||||
libc_dir = /home/gd2/gnu/libc/$(ARCH)
|
|
||||||
ifneq ($(wildcard $(libc_dir)),)
|
|
||||||
ifneq ($(wildcard $(libc_dir)/works-for-make),)
|
|
||||||
#CPPFLAGS := -I$(libc_dir)/include
|
|
||||||
#LDFLAGS := -nostdlib $(libc_dir)/lib/start.o
|
|
||||||
#LOADLIBES := $(LOADLIBES) \
|
|
||||||
# $(libc_dir)/lib/mcheck-init.o \
|
|
||||||
# $(libc_dir)/lib/libc.a \
|
|
||||||
# -lgcc \
|
|
||||||
# $(libc_dir)/lib/libc.a
|
|
||||||
CC := $(CC) -b glibc
|
|
||||||
|
|
||||||
# getopt is in libc.
|
|
||||||
GETOPT =
|
|
||||||
#GETOPT_SRC = Don't clear this or dist will break.
|
|
||||||
|
|
||||||
# glob is in libc too.
|
|
||||||
GLOB =
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
CPPFLAGS := $(CPPFLAGS) -Iglob
|
|
||||||
|
|
||||||
endif # works-for-make
|
|
||||||
endif # $(libc_dir)
|
|
||||||
endif # !no_libc
|
|
||||||
|
|
||||||
# We know the type of machine, so put the binaries in subdirectories.
|
|
||||||
$(ARCH)/%.o: %.c
|
|
||||||
$(COMPILE.c) -Iglob $< $(OUTPUT_OPTION)
|
|
||||||
$(ARCH)/glob/libglob.a: FORCE
|
|
||||||
$(MAKE) -C $(@D) $(@F) \
|
|
||||||
CC='$(CC)' CFLAGS='$(CFLAGS) -I..' \
|
|
||||||
CPPFLAGS='$(CPPFLAGS) -DHAVE_CONFIG_H'
|
|
||||||
FORCE:
|
|
||||||
objs := $(addprefix $(ARCH)/,$(objs))
|
|
||||||
prog := $(ARCH)/make
|
|
||||||
|
|
||||||
archpfx = $(ARCH)/
|
|
||||||
|
|
||||||
$(archpfx)load.o: load.c
|
|
||||||
$(COMPILE.c) $(LOAD_AVG) $< -o $@
|
|
||||||
$(archpfx)load.dep: load.c
|
|
||||||
$(mkdep) $(LOAD_AVG) $< | sed 's,$*\.o,& $@,' > $@
|
|
||||||
|
|
||||||
CPPFLAGS := -I$(ARCH) $(CPPFLAGS) -DHAVE_CONFIG_H $(filter-out @%@,$(defines))
|
|
||||||
|
|
||||||
ifneq "$(wildcard $(ARCH)/makefile)" ""
|
|
||||||
include $(ARCH)/makefile
|
|
||||||
endif
|
|
||||||
objs := $(objs) $(addprefix $(ARCH)/,$(ALLOCA) $(extras))
|
|
||||||
|
|
||||||
else # Not ARCH
|
|
||||||
prog := make
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq "$(findstring gcc,$(CC))" ""
|
|
||||||
CFLAGS = -g -W -Wunused -Wpointer-arith -Wreturn-type -Wswitch
|
|
||||||
else
|
|
||||||
CFLAGS = -g
|
|
||||||
endif
|
|
||||||
LDFLAGS = -g
|
|
||||||
|
|
||||||
# Define the command to make dependencies.
|
|
||||||
ifneq "$(findstring gcc,$(CC))" ""
|
|
||||||
# Don't include system directories.
|
|
||||||
mkdep-nolib = $(CC) -MM $(CPPFLAGS)
|
|
||||||
else
|
|
||||||
mkdep-nolib = $(mkdep)
|
|
||||||
endif
|
|
||||||
mkdep = $(CC) -M $(CPPFLAGS)
|
|
||||||
|
|
||||||
depfiles = $(patsubst %.o,%.dep,$(filter %.o,$(objs)))
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: default
|
|
||||||
default: $(prog)
|
|
||||||
|
|
||||||
$(prog): $(objs) $(globdep) #$(addprefix $(ARCH)/,gmalloc.o mcheck.o)
|
|
||||||
$(CC) $(LDFLAGS) $^ $(globlib) $(LOADLIBES) -o $@.new
|
|
||||||
mv -f $@.new $@
|
|
||||||
|
|
||||||
globfiles = $(addprefix glob/,COPYING.LIB Makefile.in \
|
|
||||||
glob.c fnmatch.c glob.h fnmatch.h)
|
|
||||||
$(globfiles): stamp-glob ;
|
|
||||||
stamp-glob: /home/gd/gnu/libc/posix/glob.tar
|
|
||||||
-rm -rf glob
|
|
||||||
tar xvf $< glob
|
|
||||||
touch $@
|
|
||||||
/home/gd/gnu/libc/posix/glob.tar: force
|
|
||||||
$(MAKE) -C $(@D) $(@F) no_deps=t
|
|
||||||
.PHONY: force
|
|
||||||
force:
|
|
||||||
|
|
||||||
# Make the Unix-compatible Makefile to be distributed by appending
|
|
||||||
# the automatically-generated dependencies to compatMakefile.
|
|
||||||
ifeq ($(mkdep),$(mkdep-nolib))
|
|
||||||
nolib-deps = $(depfiles)
|
|
||||||
else
|
|
||||||
%.dep: %.c
|
|
||||||
$(mkdep-nolib) $< | sed -e 's,$*\.o,$(@:.dep=.o) $@,' > $(@:.dep=.dtm)
|
|
||||||
mv -f $(@:.dep=.dtm) $@
|
|
||||||
nolib-deps = $(patsubst $(archpfx)%,%,$(depfiles))
|
|
||||||
endif
|
|
||||||
# The distributed Makefile.in should contain deps for remote-stub only.
|
|
||||||
Makefile.in: compatMakefile $(nolib-deps:remote-%.dep=remote-stub.dep)
|
|
||||||
(sed 's/^MAKE[ ]*=.*$$/@SET_MAKE@/' $<; \
|
|
||||||
echo '# Automatically generated dependencies.'; \
|
|
||||||
sed -e 's/ [^ ]*\.dep//' -e 's=$(archpfx)==' $(filter-out $<,$^) \
|
|
||||||
) > $@
|
|
||||||
|
|
||||||
.SUFFIXES: .dep
|
|
||||||
# Maintain the automatically-generated dependencies.
|
|
||||||
ifndef no_deps
|
|
||||||
include $(depfiles)
|
|
||||||
endif
|
|
||||||
$(archpfx)%.dep: %.c
|
|
||||||
$(mkdep) $< | sed 's,$*\.o,$(@:.dep=.o) $@,' > $@
|
|
||||||
|
|
||||||
ETAGS = etags -T # for v19 etags
|
|
||||||
|
|
||||||
# Run the tests.
|
|
||||||
.PHONY: tests
|
|
||||||
testdir := $(shell ls -d1 make-test-?.? | sort -n +0.10 -0.11 +0.12 | tail -1l)
|
|
||||||
tests:# $(testdir)/run_make_tests.pl $(prog)
|
|
||||||
# cd $(<D); MAKELEVEL=0 perl $(<F)
|
|
||||||
|
|
||||||
build.sh.in: build.template compatMakefile
|
|
||||||
sed -e 's@%objs%@$(filter-out remote-% $(GLOB) $(ALLOCA) $(extras),\
|
|
||||||
$(patsubst $(archpfx)%,%,$(objs)))\
|
|
||||||
$(patsubst %.c,%.o,$(filter %.c,$(globfiles)))@' \
|
|
||||||
$< > $@.new
|
|
||||||
mv -f $@.new $@
|
|
||||||
|
|
||||||
# Make the distribution tar files.
|
|
||||||
|
|
||||||
.PHONY: dist
|
|
||||||
# Figure out the version number from the source of `version.c'.
|
|
||||||
version := \
|
|
||||||
$(strip $(shell sed -e '/=/!d' -e 's/^.*"\(.*\)";$$/\1/' < version.c))
|
|
||||||
tarfiles := make # make-doc
|
|
||||||
tarfiles := $(addsuffix -$(version).tar,$(tarfiles))
|
|
||||||
tarfiles := $(tarfiles:%=%.gz) # no more compress $(tarfiles:%=%.Z)
|
|
||||||
# Depend on default and doc so we don't ship anything that won't compile.
|
|
||||||
dist: rcs-mark default info dvi tests tarfiles
|
|
||||||
.PHONY: tarfiles
|
|
||||||
tarfiles: $(tarfiles)
|
|
||||||
|
|
||||||
ifndef dist-flavor
|
|
||||||
dist-flavor = alpha
|
|
||||||
endif
|
|
||||||
.PHONY: rcs-mark rcs-mark-alpha rcs-mark-beta
|
|
||||||
rcs-mark: rcs-mark-$(dist-flavor)
|
|
||||||
rcs-mark-alpha:;rcs -sAlpha -Nmake-$(version-): RCS/[!=]*,v
|
|
||||||
rcs-mark-beta:;rcs -sBeta -Nmake-$(version-): RCS/[!=]*,v
|
|
||||||
version- = $(subst .,-,$(version))
|
|
||||||
|
|
||||||
dist: local-inst
|
|
||||||
.PHONY: local-inst
|
|
||||||
local-inst: $(prog)
|
|
||||||
install -c -g kmem -o $(USER) -m 2755 $< /usr/local/gnubin/make
|
|
||||||
|
|
||||||
# Put the alpha distribution files in the anonymous FTP directory.
|
|
||||||
alpha-files = $(tarfiles) GNUmakefile compatMakefile $(testdir).tar.Z
|
|
||||||
dist: alpha
|
|
||||||
.PHONY: alpha
|
|
||||||
alpha-dir := ~ftp/gnu
|
|
||||||
alpha-files := $(addprefix $(alpha-dir)/,$(alpha-files))
|
|
||||||
alpha: $(alpha-dir) $(alpha-files)
|
|
||||||
$(alpha-dir)/%: %
|
|
||||||
@rm -f $@
|
|
||||||
cp $< $@
|
|
||||||
|
|
||||||
# Implicit rule to make README and README-doc.
|
|
||||||
%: %.template version.c
|
|
||||||
rm -f $@
|
|
||||||
sed 's/VERSION/$(version)/' < $< > $@
|
|
||||||
# Make sure I don't edit it by accident.
|
|
||||||
chmod a-w $@
|
|
||||||
|
|
||||||
define make-tar
|
|
||||||
@rm -fr make-$(version)
|
|
||||||
ln -s . make-$(version)
|
|
||||||
tar cvhof $@ $(addprefix make-$(version)/,$^)
|
|
||||||
rm -f make-$(version)
|
|
||||||
endef
|
|
||||||
|
|
||||||
%.Z: %; compress -c $< > $@
|
|
||||||
%.gz: %; gzip -9 -c -v $< > $@
|
|
||||||
|
|
||||||
make-doc-$(version).tar: README-doc COPYING make.dvi make.info make.info*
|
|
||||||
$(make-tar)
|
|
||||||
make-$(version).tar: README INSTALL COPYING ChangeLog NEWS \
|
|
||||||
configure Makefile.in configure.in build.sh.in mkinstalldirs \
|
|
||||||
acconfig.h $(srcs) remote-*.c $(globfiles) \
|
|
||||||
make.texinfo make-stds.texi \
|
|
||||||
make.?? make.??s make.toc make.aux make.man texinfo.tex TAGS tags \
|
|
||||||
install.sh \
|
|
||||||
make.info make.info*
|
|
||||||
$(make-tar)
|
|
||||||
|
|
||||||
ifneq (,)
|
|
||||||
tests := $(filter-out %~,$(wildcard tests/*))
|
|
||||||
make-tests-$(version).tar.Z: $(tests)
|
|
||||||
@rm -fr make-tests-$(version)
|
|
||||||
ln -s tests make-tests-$(version)
|
|
||||||
tar cvhf $(@:.Z=) $(patsubst tests/%,make-tests-$(version)/%,$^)
|
|
||||||
rm -f make-tests-$(version)
|
|
||||||
compress -f $(@:.Z=)
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(archpfx)loadtest: $(archpfx)load.o
|
|
||||||
|
|||||||
183
INSTALL
Normal file
183
INSTALL
Normal file
@@ -0,0 +1,183 @@
|
|||||||
|
Basic Installation
|
||||||
|
==================
|
||||||
|
|
||||||
|
These are generic installation instructions.
|
||||||
|
|
||||||
|
The `configure' shell script attempts to guess correct values for
|
||||||
|
various system-dependent variables used during compilation. It uses
|
||||||
|
those values to create a `Makefile' in each directory of the package.
|
||||||
|
It may also create one or more `.h' files containing system-dependent
|
||||||
|
definitions. Finally, it creates a shell script `config.status' that
|
||||||
|
you can run in the future to recreate the current configuration, a file
|
||||||
|
`config.cache' that saves the results of its tests to speed up
|
||||||
|
reconfiguring, and a file `config.log' containing compiler output
|
||||||
|
(useful mainly for debugging `configure').
|
||||||
|
|
||||||
|
If you need to do unusual things to compile the package, please try
|
||||||
|
to figure out how `configure' could check whether to do them, and mail
|
||||||
|
diffs or instructions to the address given in the `README' so they can
|
||||||
|
be considered for the next release. If at some point `config.cache'
|
||||||
|
contains results you don't want to keep, you may remove or edit it.
|
||||||
|
|
||||||
|
The file `configure.in' is used to create `configure' by a program
|
||||||
|
called `autoconf'. You only need `configure.in' if you want to change
|
||||||
|
it or regenerate `configure' using a newer version of `autoconf'.
|
||||||
|
|
||||||
|
The simplest way to compile this package is:
|
||||||
|
|
||||||
|
1. `cd' to the directory containing the package's source code and type
|
||||||
|
`./configure' to configure the package for your system. If you're
|
||||||
|
using `csh' on an old version of System V, you might need to type
|
||||||
|
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||||
|
`configure' itself.
|
||||||
|
|
||||||
|
Running `configure' takes awhile. While running, it prints some
|
||||||
|
messages telling which features it is checking for.
|
||||||
|
|
||||||
|
2. Type `make' to compile the package.
|
||||||
|
|
||||||
|
3. Optionally, type `make check' to run any self-tests that come with
|
||||||
|
the package.
|
||||||
|
|
||||||
|
4. Type `make install' to install the programs and any data files and
|
||||||
|
documentation.
|
||||||
|
|
||||||
|
5. You can remove the program binaries and object files from the
|
||||||
|
source code directory by typing `make clean'. To also remove the
|
||||||
|
files that `configure' created (so you can compile the package for
|
||||||
|
a different kind of computer), type `make distclean'. There is
|
||||||
|
also a `make maintainer-clean' target, but that is intended mainly
|
||||||
|
for the package's developers. If you use it, you may have to get
|
||||||
|
all sorts of other programs in order to regenerate files that came
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
Compilers and Options
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Some systems require unusual options for compilation or linking that
|
||||||
|
the `configure' script does not know about. You can give `configure'
|
||||||
|
initial values for variables by setting them in the environment. Using
|
||||||
|
a Bourne-compatible shell, you can do that on the command line like
|
||||||
|
this:
|
||||||
|
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||||
|
|
||||||
|
Or on systems that have the `env' program, you can do it like this:
|
||||||
|
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||||
|
|
||||||
|
Compiling For Multiple Architectures
|
||||||
|
====================================
|
||||||
|
|
||||||
|
You can compile the package for more than one kind of computer at the
|
||||||
|
same time, by placing the object files for each architecture in their
|
||||||
|
own directory. To do this, you must use a version of `make' that
|
||||||
|
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||||
|
directory where you want the object files and executables to go and run
|
||||||
|
the `configure' script. `configure' automatically checks for the
|
||||||
|
source code in the directory that `configure' is in and in `..'.
|
||||||
|
|
||||||
|
If you have to use a `make' that does not supports the `VPATH'
|
||||||
|
variable, you have to compile the package for one architecture at a time
|
||||||
|
in the source code directory. After you have installed the package for
|
||||||
|
one architecture, use `make distclean' before reconfiguring for another
|
||||||
|
architecture.
|
||||||
|
|
||||||
|
Installation Names
|
||||||
|
==================
|
||||||
|
|
||||||
|
By default, `make install' will install the package's files in
|
||||||
|
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||||
|
installation prefix other than `/usr/local' by giving `configure' the
|
||||||
|
option `--prefix=PATH'.
|
||||||
|
|
||||||
|
You can specify separate installation prefixes for
|
||||||
|
architecture-specific files and architecture-independent files. If you
|
||||||
|
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||||
|
PATH as the prefix for installing programs and libraries.
|
||||||
|
Documentation and other data files will still use the regular prefix.
|
||||||
|
|
||||||
|
In addition, if you use an unusual directory layout you can give
|
||||||
|
options like `--bindir=PATH' to specify different values for particular
|
||||||
|
kinds of files. Run `configure --help' for a list of the directories
|
||||||
|
you can set and what kinds of files go in them.
|
||||||
|
|
||||||
|
If the package supports it, you can cause programs to be installed
|
||||||
|
with an extra prefix or suffix on their names by giving `configure' the
|
||||||
|
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||||
|
|
||||||
|
Optional Features
|
||||||
|
=================
|
||||||
|
|
||||||
|
Some packages pay attention to `--enable-FEATURE' options to
|
||||||
|
`configure', where FEATURE indicates an optional part of the package.
|
||||||
|
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||||
|
is something like `gnu-as' or `x' (for the X Window System). The
|
||||||
|
`README' should mention any `--enable-' and `--with-' options that the
|
||||||
|
package recognizes.
|
||||||
|
|
||||||
|
For packages that use the X Window System, `configure' can usually
|
||||||
|
find the X include and library files automatically, but if it doesn't,
|
||||||
|
you can use the `configure' options `--x-includes=DIR' and
|
||||||
|
`--x-libraries=DIR' to specify their locations.
|
||||||
|
|
||||||
|
Specifying the System Type
|
||||||
|
==========================
|
||||||
|
|
||||||
|
There may be some features `configure' can not figure out
|
||||||
|
automatically, but needs to determine by the type of host the package
|
||||||
|
will run on. Usually `configure' can figure that out, but if it prints
|
||||||
|
a message saying it can not guess the host type, give it the
|
||||||
|
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||||
|
type, such as `sun4', or a canonical name with three fields:
|
||||||
|
CPU-COMPANY-SYSTEM
|
||||||
|
|
||||||
|
See the file `config.sub' for the possible values of each field. If
|
||||||
|
`config.sub' isn't included in this package, then this package doesn't
|
||||||
|
need to know the host type.
|
||||||
|
|
||||||
|
If you are building compiler tools for cross-compiling, you can also
|
||||||
|
use the `--target=TYPE' option to select the type of system they will
|
||||||
|
produce code for and the `--build=TYPE' option to select the type of
|
||||||
|
system on which you are compiling the package.
|
||||||
|
|
||||||
|
Sharing Defaults
|
||||||
|
================
|
||||||
|
|
||||||
|
If you want to set default values for `configure' scripts to share,
|
||||||
|
you can create a site shell script called `config.site' that gives
|
||||||
|
default values for variables like `CC', `cache_file', and `prefix'.
|
||||||
|
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||||
|
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||||
|
`CONFIG_SITE' environment variable to the location of the site script.
|
||||||
|
A warning: not all `configure' scripts look for a site script.
|
||||||
|
|
||||||
|
Operation Controls
|
||||||
|
==================
|
||||||
|
|
||||||
|
`configure' recognizes the following options to control how it
|
||||||
|
operates.
|
||||||
|
|
||||||
|
`--cache-file=FILE'
|
||||||
|
Use and save the results of the tests in FILE instead of
|
||||||
|
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||||
|
debugging `configure'.
|
||||||
|
|
||||||
|
`--help'
|
||||||
|
Print a summary of the options to `configure', and exit.
|
||||||
|
|
||||||
|
`--quiet'
|
||||||
|
`--silent'
|
||||||
|
`-q'
|
||||||
|
Do not print messages saying which checks are being made. To
|
||||||
|
suppress all normal output, redirect it to `/dev/null' (any error
|
||||||
|
messages will still be shown).
|
||||||
|
|
||||||
|
`--srcdir=DIR'
|
||||||
|
Look for the package's source code in directory DIR. Usually
|
||||||
|
`configure' can determine that directory automatically.
|
||||||
|
|
||||||
|
`--version'
|
||||||
|
Print the version of Autoconf used to generate the `configure'
|
||||||
|
script, and exit.
|
||||||
|
|
||||||
|
`configure' also accepts some other, not widely useful, options.
|
||||||
|
|
||||||
483
Makefile.DOS.template
Normal file
483
Makefile.DOS.template
Normal file
@@ -0,0 +1,483 @@
|
|||||||
|
# -*-Makefile-*- template for DJGPP
|
||||||
|
# Makefile.in generated automatically by automake 1.2 from Makefile.am
|
||||||
|
|
||||||
|
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
# This Makefile.DOS is free software; the Free Software Foundation
|
||||||
|
# gives unlimited permission to copy, distribute and modify it.
|
||||||
|
|
||||||
|
# -*-Makefile-*-, or close enough
|
||||||
|
|
||||||
|
|
||||||
|
SHELL = /bin/sh
|
||||||
|
|
||||||
|
srcdir = .
|
||||||
|
VPATH = $(srcdir)
|
||||||
|
# $DJDIR is defined automatically by DJGPP to point
|
||||||
|
# to the root of the DJGPP installation tree.
|
||||||
|
prefix = ${DJDIR}
|
||||||
|
exec_prefix = ${prefix}
|
||||||
|
|
||||||
|
bindir = ${exec_prefix}/bin
|
||||||
|
datadir = ${prefix}/share
|
||||||
|
libdir = ${prefix}/lib
|
||||||
|
infodir = ${prefix}/info
|
||||||
|
# DJGPP doesn't have separate man tree, use info instead.
|
||||||
|
mandir = ${prefix}/info
|
||||||
|
includedir = ${prefix}/include
|
||||||
|
oldincludedir = c:/djgpp/include
|
||||||
|
|
||||||
|
pkgdatadir = $(datadir)/make
|
||||||
|
pkglibdir = $(libdir)/make
|
||||||
|
pkgincludedir = $(includedir)/make
|
||||||
|
|
||||||
|
INSTALL = ${bindir}/ginstall -c
|
||||||
|
INSTALL_PROGRAM = ${bindir}/ginstall -c
|
||||||
|
INSTALL_DATA = ${bindir}/ginstall -c -m 644
|
||||||
|
INSTALL_SCRIPT = ${bindir}/ginstall -c
|
||||||
|
transform = s,x,x,
|
||||||
|
|
||||||
|
# This will fail even if they don't have a Unix-like shell (stock DOS
|
||||||
|
# shell doesn't know about `false'). The only difference is that they
|
||||||
|
# get "Error -1" instead of "Error 1".
|
||||||
|
EXIT_FAIL = false
|
||||||
|
|
||||||
|
NORMAL_INSTALL = true
|
||||||
|
PRE_INSTALL = true
|
||||||
|
POST_INSTALL = true
|
||||||
|
NORMAL_UNINSTALL = true
|
||||||
|
PRE_UNINSTALL = true
|
||||||
|
POST_UNINSTALL = true
|
||||||
|
AR = ar
|
||||||
|
CC = gcc
|
||||||
|
CPP = gcc -E
|
||||||
|
LIBOBJS =
|
||||||
|
MAKEINFO = ${bindir}/makeinfo
|
||||||
|
PACKAGE = make
|
||||||
|
RANLIB = ranlib
|
||||||
|
REMOTE = stub
|
||||||
|
VERSION = %VERSION%
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = 1.2
|
||||||
|
|
||||||
|
bin_PROGRAMS = %PROGRAMS%
|
||||||
|
|
||||||
|
make_SOURCES = %SOURCES%
|
||||||
|
# This should include the glob/ prefix
|
||||||
|
libglob_a_SOURCES = %GLOB_SOURCES%
|
||||||
|
make_LDADD = glob/libglob.a
|
||||||
|
|
||||||
|
info_TEXINFOS = make.texinfo
|
||||||
|
|
||||||
|
INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"c:/djgpp/lib\" -DINCLUDEDIR=\"c:/djgpp/include\"
|
||||||
|
|
||||||
|
BUILT_SOURCES = README build.sh.in
|
||||||
|
|
||||||
|
EXTRA_DIST = make.man $(BUILT_SOURCES) remote-cstms.c make-stds.texi texinfo.tex SCOPTIONS SMakefile Makefile.ami README.Amiga config.ami amiga.c amiga.h NMakefile README.DOS configh.dos configure.bat makefile.com README.W32 build_w32.bat config.h.W32 subproc.bat make.lnk config.h-vms makefile.vms readme.vms vmsdir.h vmsfunctions.c vmsify.c
|
||||||
|
|
||||||
|
SUBDIRS = glob
|
||||||
|
mkinstalldirs = ${bindir}/gmkdir -p
|
||||||
|
CONFIG_HEADER = config.h
|
||||||
|
CONFIG_CLEAN_FILES = build.sh
|
||||||
|
PROGRAMS = $(bin_PROGRAMS)
|
||||||
|
|
||||||
|
|
||||||
|
DEFS = -I. -I$(srcdir) -I.
|
||||||
|
CPPFLAGS = -DHAVE_CONFIG_H
|
||||||
|
LDFLAGS =
|
||||||
|
LIBS =
|
||||||
|
make_OBJECTS = %OBJECTS%
|
||||||
|
make_DEPENDENCIES = glob/libglob.a
|
||||||
|
make_LDFLAGS =
|
||||||
|
libglob_a_LIBADD =
|
||||||
|
libglob_a_OBJECTS = %GLOB_OBJECTS%
|
||||||
|
noinst_LIBRARIES = glob/libglob.a
|
||||||
|
CFLAGS = -O2 -g
|
||||||
|
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||||
|
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||||
|
TEXI2DVI = texi2dvi
|
||||||
|
TEXINFO_TEX = $(srcdir)/texinfo.tex
|
||||||
|
INFO_DEPS = make.info
|
||||||
|
DVIS = make.dvi
|
||||||
|
TEXINFOS = make.texinfo
|
||||||
|
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh.in config.h.in configure configure.in getloadavg.c install-sh missing mkinstalldirs stamp-h.in texinfo.tex
|
||||||
|
|
||||||
|
|
||||||
|
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
|
|
||||||
|
TAR = gtar
|
||||||
|
GZIP = --best
|
||||||
|
SOURCES = $(make_SOURCES)
|
||||||
|
OBJECTS = $(make_OBJECTS)
|
||||||
|
HEADERS = $(wildcard $(srcdir)/*.h)
|
||||||
|
|
||||||
|
default: all
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
.SUFFIXES: .c .dvi .info .o .ps .texi .texinfo
|
||||||
|
|
||||||
|
distclean-hdr:
|
||||||
|
rm -f config.h
|
||||||
|
|
||||||
|
maintainer-clean-hdr:
|
||||||
|
|
||||||
|
mostlyclean-binPROGRAMS:
|
||||||
|
|
||||||
|
clean-binPROGRAMS:
|
||||||
|
test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
||||||
|
|
||||||
|
distclean-binPROGRAMS:
|
||||||
|
|
||||||
|
maintainer-clean-binPROGRAMS:
|
||||||
|
|
||||||
|
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
$(mkinstalldirs) $(bindir)
|
||||||
|
@list='$(bin_PROGRAMS)'; for p in $$list; do if test -f $$p; then echo " $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | sed '$(transform)'`"; $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p | sed '$(transform)'`; else :; fi; done
|
||||||
|
|
||||||
|
uninstall-binPROGRAMS:
|
||||||
|
$(NORMAL_UNINSTALL)
|
||||||
|
list='$(bin_PROGRAMS)'; for p in $$list; do rm -f $(bindir)/`echo $$p|sed '$(transform)'`; done
|
||||||
|
|
||||||
|
.c.o:
|
||||||
|
$(COMPILE) -c $<
|
||||||
|
|
||||||
|
clean-noinstLIBRARIES:
|
||||||
|
test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||||
|
|
||||||
|
mostlyclean-compile:
|
||||||
|
rm -f *.o *.exe make.new core
|
||||||
|
|
||||||
|
clean-compile:
|
||||||
|
|
||||||
|
distclean-compile:
|
||||||
|
rm -f *.tab.c
|
||||||
|
|
||||||
|
maintainer-clean-compile:
|
||||||
|
|
||||||
|
make: $(make_OBJECTS) $(make_DEPENDENCIES)
|
||||||
|
@command.com /c if exist make del make
|
||||||
|
@command.com /c if exist make.exe del make.exe
|
||||||
|
$(LINK) $(make_LDFLAGS) $(make_OBJECTS) $(make_LDADD) $(LIBS)
|
||||||
|
|
||||||
|
make.info: make.texinfo
|
||||||
|
make.dvi: make.texinfo
|
||||||
|
|
||||||
|
|
||||||
|
DVIPS = dvips
|
||||||
|
|
||||||
|
.texi.info:
|
||||||
|
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
||||||
|
|
||||||
|
.texi.dvi:
|
||||||
|
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||||
|
|
||||||
|
.texi:
|
||||||
|
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
||||||
|
|
||||||
|
.texinfo.info:
|
||||||
|
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
||||||
|
|
||||||
|
.texinfo:
|
||||||
|
$(MAKEINFO) $(srcdir)/$< -o ./$@
|
||||||
|
|
||||||
|
.texinfo.dvi:
|
||||||
|
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||||
|
|
||||||
|
.dvi.ps:
|
||||||
|
$(DVIPS) $< -o $@
|
||||||
|
|
||||||
|
install-info-am: $(INFO_DEPS)
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
$(mkinstalldirs) $(infodir)
|
||||||
|
@for file in $(INFO_DEPS) make.i; do d=$(srcdir); for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]`; do if test -f $$d/$$ifile; then echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; else : ; fi; done; done
|
||||||
|
@$(POST_INSTALL)
|
||||||
|
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then for file in $(INFO_DEPS); do echo " install-info --info-dir=$(infodir) $(infodir)/$$file"; install-info --info-dir=$(infodir) $(infodir)/$$file || :; done; else : ; fi
|
||||||
|
|
||||||
|
uninstall-info:
|
||||||
|
$(PRE_UNINSTALL)
|
||||||
|
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then ii=yes; else ii=; fi; for file in $(INFO_DEPS); do test -z $ii || install-info --info-dir=$(infodir) --remove $$file; done
|
||||||
|
$(NORMAL_UNINSTALL)
|
||||||
|
for file in $(INFO_DEPS) make.i; do (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]); done
|
||||||
|
|
||||||
|
dist-info: $(INFO_DEPS)
|
||||||
|
for base in $(INFO_DEPS); do d=$(srcdir); for file in `cd $$d && eval echo $$base*`; do test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; done
|
||||||
|
|
||||||
|
mostlyclean-aminfo:
|
||||||
|
rm -f make.aux make.cp make.cps make.dvi make.fn make.fns make.ky make.log make.pg make.toc make.tp make.tps make.vr make.vrs make.op make.tr make.cv
|
||||||
|
|
||||||
|
clean-aminfo:
|
||||||
|
|
||||||
|
distclean-aminfo:
|
||||||
|
|
||||||
|
maintainer-clean-aminfo:
|
||||||
|
for i in $(INFO_DEPS) make.i; do rm -f `eval echo $$i*`; done
|
||||||
|
|
||||||
|
# Assume that the only thing to do in glob is to build libglob.a,
|
||||||
|
# but do a sanity check: if $SUBDIRS will ever have more than
|
||||||
|
# a single directory, yell bloody murder.
|
||||||
|
all-recursive:
|
||||||
|
ifeq ($(words $(SUBDIRS)), 1)
|
||||||
|
@command.com /c if not exist glob\\nul md glob
|
||||||
|
@echo Making all in $(SUBDIRS)
|
||||||
|
$(MAKE) -C $(SUBDIRS) -f ../Makefile INCLUDES='-I$(srcdir) -I$(srcdir)/glob' DEFS='-I.. -I$(srcdir)' VPATH=$(srcdir)/glob libglob.a
|
||||||
|
else
|
||||||
|
@echo FATAL: There is more than one directory in "($(SUBDIRS))"
|
||||||
|
@$(EXIT_FAIL)
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(SUBDIRS):
|
||||||
|
command.com /c md $@
|
||||||
|
|
||||||
|
libglob.a: $(libglob_a_OBJECTS)
|
||||||
|
command.com /c if exist libglob.a del libglob.a
|
||||||
|
$(AR) cru libglob.a $(libglob_a_OBJECTS) $(libglob_a_LIBADD)
|
||||||
|
$(RANLIB) libglob.a
|
||||||
|
|
||||||
|
mostlyclean-recursive clean-recursive distclean-recursive maintainer-clean-recursive:
|
||||||
|
ifeq ($(words $(SUBDIRS)), 1)
|
||||||
|
@echo Making $(shell echo $@ | sed s/-recursive//) in $(SUBDIRS)
|
||||||
|
$(MAKE) -C $(SUBDIRS) -f ../Makefile $(shell echo $@ | sed s/-recursive//)-am
|
||||||
|
else
|
||||||
|
@echo FATAL: There is more than one directory in "($(SUBDIRS))"
|
||||||
|
@$(EXIT_FAIL)
|
||||||
|
endif
|
||||||
|
|
||||||
|
tags-in-glob: $(libglob_a_SOURCES)
|
||||||
|
etags $(addprefix $(srcdir)/,$^) -o ./glob/TAGS
|
||||||
|
|
||||||
|
tags-recursive:
|
||||||
|
ifeq ($(words $(SUBDIRS)), 1)
|
||||||
|
$(MAKE) tags-in-glob
|
||||||
|
else
|
||||||
|
@echo FATAL: There is more than one directory in "($(SUBDIRS))"
|
||||||
|
@$(EXIT_FAIL)
|
||||||
|
endif
|
||||||
|
|
||||||
|
tags: TAGS
|
||||||
|
|
||||||
|
ID: $(HEADERS) $(SOURCES)
|
||||||
|
mkid $(srcdir)/$(SOURCES) $(srcdir)/$(libglob_a_SOURCES) ./config.h $(HEADERS)
|
||||||
|
|
||||||
|
TAGS: tags-recursive $(HEADERS) $(srcdir)/$(SOURCES) config.h $(TAGS_DEPENDENCIES)
|
||||||
|
etags -i ./glob/TAGS $(ETAGS_ARGS) $(srcdir)/$(SOURCES) ./config.h $(HEADERS)
|
||||||
|
|
||||||
|
mostlyclean-tags:
|
||||||
|
|
||||||
|
clean-tags:
|
||||||
|
|
||||||
|
distclean-tags:
|
||||||
|
rm -f TAGS ID
|
||||||
|
|
||||||
|
maintainer-clean-tags:
|
||||||
|
|
||||||
|
distdir = $(PACKAGE)-$(VERSION)
|
||||||
|
top_distdir = $(distdir)
|
||||||
|
|
||||||
|
# This target untars the dist file and tries a VPATH configuration. Then
|
||||||
|
# it guarantees that the distribution is self-contained by making another
|
||||||
|
# tarfile.
|
||||||
|
distcheck: dist
|
||||||
|
rm -rf $(distdir)
|
||||||
|
GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
|
||||||
|
mkdir $(distdir)/=build
|
||||||
|
mkdir $(distdir)/=inst
|
||||||
|
dc_install_base=`cd $(distdir)/=inst && pwd`; cd $(distdir)/=build && ../configure --srcdir=.. --prefix=$$dc_install_base && $(MAKE) && $(MAKE) dvi && $(MAKE) check && $(MAKE) install && $(MAKE) installcheck && $(MAKE) dist
|
||||||
|
rm -rf $(distdir)
|
||||||
|
@echo "========================"; echo "$(distdir).tar.gz is ready for distribution"; echo "========================"
|
||||||
|
dist: distdir
|
||||||
|
-chmod -R a+r $(distdir)
|
||||||
|
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||||
|
rm -rf $(distdir)
|
||||||
|
dist-all: distdir
|
||||||
|
-chmod -R a+r $(distdir)
|
||||||
|
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||||
|
rm -rf $(distdir)
|
||||||
|
distdir: $(DISTFILES)
|
||||||
|
rm -rf $(distdir)
|
||||||
|
mkdir $(distdir)
|
||||||
|
-chmod 777 $(distdir)
|
||||||
|
@for file in $(DISTFILES); do d=$(srcdir); test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; for subdir in $(SUBDIRS); do test -d $(distdir)/$$subdir || mkdir $(distdir)/$$subdir || exit 1; chmod 777 $(distdir)/$$subdir; (cd $$subdir && $(MAKE) top_distdir=../$(top_distdir)/$$subdir distdir=../$(distdir)/$$subdir distdir) || exit 1; done
|
||||||
|
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
|
||||||
|
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
|
||||||
|
alloca.o alloca.lo: alloca.c config.h
|
||||||
|
ar.o ar.lo: ar.c make.h config.h filedef.h dep.h glob/fnmatch.h
|
||||||
|
arscan.o arscan.lo: arscan.c make.h config.h
|
||||||
|
commands.o commands.lo: commands.c make.h config.h dep.h filedef.h variable.h job.h commands.h
|
||||||
|
default.o default.lo: default.c make.h config.h rule.h dep.h filedef.h job.h commands.h variable.h
|
||||||
|
dir.o dir.lo: dir.c make.h config.h glob/glob.h
|
||||||
|
expand.o expand.lo: expand.c make.h config.h filedef.h job.h commands.h variable.h
|
||||||
|
file.o file.lo: file.c make.h config.h dep.h filedef.h job.h commands.h variable.h
|
||||||
|
function.o function.lo: function.c make.h config.h filedef.h variable.h dep.h job.h commands.h
|
||||||
|
getloadavg.o getloadavg.lo: getloadavg.c config.h
|
||||||
|
getopt.o getopt.lo: getopt.c config.h getopt.h
|
||||||
|
getopt1.o getopt1.lo: getopt1.c config.h getopt.h
|
||||||
|
implicit.o implicit.lo: implicit.c make.h config.h rule.h dep.h filedef.h
|
||||||
|
job.o job.lo: job.c make.h config.h job.h filedef.h commands.h variable.h
|
||||||
|
main.o main.lo: main.c make.h config.h dep.h filedef.h variable.h job.h commands.h getopt.h
|
||||||
|
misc.o misc.lo: misc.c make.h config.h dep.h
|
||||||
|
read.o read.lo: read.c make.h config.h dep.h filedef.h job.h commands.h variable.h glob/glob.h
|
||||||
|
remake.o remake.lo: remake.c make.h config.h filedef.h job.h commands.h dep.h
|
||||||
|
remote-stub.o remote-stub.lo: remote-stub.c make.h config.h filedef.h job.h commands.h
|
||||||
|
rule.o rule.lo: rule.c make.h config.h dep.h filedef.h job.h commands.h variable.h rule.h
|
||||||
|
signame.o signame.lo: signame.c config.h signame.h
|
||||||
|
variable.o variable.lo: variable.c make.h config.h dep.h filedef.h job.h commands.h variable.h
|
||||||
|
version.o version.lo: version.c config.h
|
||||||
|
vpath.o vpath.lo: vpath.c make.h config.h filedef.h variable.h
|
||||||
|
fnmatch.o fnmatch.lo: fnmatch.c fnmatch.h ../config.h
|
||||||
|
glob.o glob.lo: glob.c fnmatch.h glob.h ../config.h
|
||||||
|
|
||||||
|
info: $(INFO_DEPS) info-recursive
|
||||||
|
dvi: $(DVIS) dvi-recursive
|
||||||
|
check: all-am
|
||||||
|
$(MAKE) check-recursive check-local
|
||||||
|
installcheck: installcheck-recursive
|
||||||
|
all-recursive-am: config.h
|
||||||
|
$(MAKE) all-recursive
|
||||||
|
|
||||||
|
all-am: Makefile $(INFO_DEPS) $(PROGRAMS) config.h
|
||||||
|
|
||||||
|
install-exec-am: install-binPROGRAMS
|
||||||
|
|
||||||
|
install-data-am: install-info-am
|
||||||
|
|
||||||
|
uninstall-am: uninstall-binPROGRAMS uninstall-info
|
||||||
|
|
||||||
|
install-exec: install-exec-recursive install-exec-am
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
|
||||||
|
install-data: install-data-recursive install-data-am
|
||||||
|
@$(NORMAL_INSTALL)
|
||||||
|
|
||||||
|
install: install-recursive install-exec-am install-data-am
|
||||||
|
@:
|
||||||
|
|
||||||
|
uninstall: uninstall-recursive uninstall-am
|
||||||
|
|
||||||
|
all: all-recursive-am all-am
|
||||||
|
|
||||||
|
install-strip:
|
||||||
|
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||||
|
installdirs: installdirs-recursive
|
||||||
|
$(mkinstalldirs) $(bindir) $(infodir)
|
||||||
|
|
||||||
|
|
||||||
|
mostlyclean-generic:
|
||||||
|
test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||||
|
|
||||||
|
clean-generic:
|
||||||
|
test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||||
|
|
||||||
|
distclean-generic:
|
||||||
|
rm -f Makefile $(DISTCLEANFILES)
|
||||||
|
rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||||
|
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||||
|
|
||||||
|
maintainer-clean-generic:
|
||||||
|
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||||
|
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||||
|
mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS mostlyclean-compile mostlyclean-aminfo mostlyclean-tags mostlyclean-generic
|
||||||
|
|
||||||
|
clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-aminfo clean-tags clean-generic mostlyclean-am
|
||||||
|
|
||||||
|
distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile distclean-aminfo distclean-tags distclean-generic clean-am
|
||||||
|
|
||||||
|
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS maintainer-clean-compile maintainer-clean-aminfo maintainer-clean-tags maintainer-clean-generic distclean-am
|
||||||
|
|
||||||
|
mostlyclean: mostlyclean-recursive mostlyclean-am
|
||||||
|
|
||||||
|
clean: clean-noinstLIBRARIES clean-recursive clean-am
|
||||||
|
|
||||||
|
distclean: distclean-recursive distclean-am
|
||||||
|
rm -f config.status
|
||||||
|
|
||||||
|
maintainer-clean: maintainer-clean-recursive maintainer-clean-am
|
||||||
|
@echo "This command is intended for maintainers to use;"
|
||||||
|
@echo "it deletes files that may require special tools to rebuild."
|
||||||
|
rm -f config.status
|
||||||
|
|
||||||
|
.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
|
||||||
|
maintainer-clean-hdr mostlyclean-binPROGRAMS distclean-binPROGRAMS \
|
||||||
|
clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
|
||||||
|
install-binPROGRAMS mostlyclean-compile distclean-compile clean-compile \
|
||||||
|
maintainer-clean-compile install-info-am uninstall-info \
|
||||||
|
mostlyclean-aminfo distclean-aminfo clean-aminfo \
|
||||||
|
maintainer-clean-aminfo install-data-recursive uninstall-data-recursive \
|
||||||
|
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
|
||||||
|
uninstalldirs-recursive all-recursive check-recursive \
|
||||||
|
installcheck-recursive info-recursive dvi-recursive \
|
||||||
|
mostlyclean-recursive distclean-recursive clean-recursive \
|
||||||
|
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
|
||||||
|
distclean-tags clean-tags maintainer-clean-tags distdir \
|
||||||
|
mostlyclean-depend distclean-depend clean-depend \
|
||||||
|
maintainer-clean-depend info dvi check-local installcheck \
|
||||||
|
all-recursive-am all-am install-exec-am install-data-am uninstall-am \
|
||||||
|
install-exec install-data install uninstall all installdirs \
|
||||||
|
mostlyclean-generic distclean-generic clean-generic \
|
||||||
|
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||||
|
|
||||||
|
|
||||||
|
# --------------- Local DIST Section
|
||||||
|
|
||||||
|
# Install the w32 subdirectory
|
||||||
|
#
|
||||||
|
dist-hook:
|
||||||
|
(cd $(srcdir); \
|
||||||
|
w32=`find w32 -follow \( -name CVS -prune \) -o -type f -print`; \
|
||||||
|
tar chf - $$w32) \
|
||||||
|
| (cd $(distdir); tar xfBp -)
|
||||||
|
|
||||||
|
# --------------- Local CHECK Section
|
||||||
|
|
||||||
|
check-local: check-loadavg check-regression
|
||||||
|
.PHONY: check-loadavg check-regression
|
||||||
|
|
||||||
|
# > check-loadavg
|
||||||
|
#
|
||||||
|
loadavg: loadavg.c config.h
|
||||||
|
@rm -f loadavg
|
||||||
|
$(LINK) -DTEST $(make_LDFLAGS) loadavg.c $(LIBS)
|
||||||
|
# We copy getloadavg.c into a different file rather than compiling it
|
||||||
|
# directly because some compilers clobber getloadavg.o in the process.
|
||||||
|
loadavg.c: getloadavg.c
|
||||||
|
ln $(srcdir)/getloadavg.c loadavg.c || \
|
||||||
|
cp $(srcdir)/getloadavg.c loadavg.c
|
||||||
|
check-loadavg: loadavg
|
||||||
|
@echo The system uptime program believes the load average to be:
|
||||||
|
-uptime
|
||||||
|
@echo The GNU load average checking code believes:
|
||||||
|
-./loadavg
|
||||||
|
|
||||||
|
# > check-regression
|
||||||
|
#
|
||||||
|
# Look for the make test suite, and run it if found. Look in MAKE_TEST if
|
||||||
|
# specified, or else in the srcdir or the distdir, their parents, and _their_
|
||||||
|
# parents.
|
||||||
|
#
|
||||||
|
check-regression:
|
||||||
|
here=`pwd`; testdir=""; \
|
||||||
|
case "$(MAKE_TEST)" in "") \
|
||||||
|
for d1 in $$here $(srcdir); do \
|
||||||
|
for d2 in ../.. .. .; do \
|
||||||
|
all=`echo $$d1/$$d2/make-test-[0-9]*/run_make_tests`; \
|
||||||
|
case "$$all" in \
|
||||||
|
"$$d1/$$d2/make-test-[0-9]*/run_make_tests") : ;; \
|
||||||
|
*) try=`for x in $$all; do echo $$x; done | sort | tail -1`;\
|
||||||
|
testdir=`dirname $$try` ;; esac; \
|
||||||
|
done; done ;; \
|
||||||
|
*) testdir="$(MAKE_TEST)" ;; \
|
||||||
|
esac; \
|
||||||
|
case "$$testdir" in \
|
||||||
|
"") echo "Couldn't find make-test-* test suite."; exit 0;; \
|
||||||
|
esac; \
|
||||||
|
echo "cd $$testdir && ./run_make_tests -make_path $$here/make"; \
|
||||||
|
cd $$testdir && ./run_make_tests -make_path $$here/make
|
||||||
|
|
||||||
|
# --------------- Maintainer's Section
|
||||||
|
|
||||||
|
# Note this requires GNU make. Not to worry, since it will only be included
|
||||||
|
# in the Makefile if we're in the maintainer's environment.
|
||||||
|
#include $(srcdir)/maintMakefile
|
||||||
|
|
||||||
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
|
.NOEXPORT:
|
||||||
95
Makefile.am
Normal file
95
Makefile.am
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
# -*-Makefile-*-, or close enough
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = 1.2
|
||||||
|
|
||||||
|
bin_PROGRAMS = make
|
||||||
|
|
||||||
|
make_SOURCES = main.c commands.c job.c dir.c file.c misc.c read.c remake.c \
|
||||||
|
rule.c implicit.c default.c variable.c expand.c function.c \
|
||||||
|
vpath.c version.c ar.c arscan.c remote-$(REMOTE).c \
|
||||||
|
commands.h dep.h filedef.h job.h make.h rule.h variable.h \
|
||||||
|
signame.c signame.h \
|
||||||
|
getopt.c getopt1.c getopt.h
|
||||||
|
make_LDADD = @LIBOBJS@ @ALLOCA@ glob/libglob.a
|
||||||
|
|
||||||
|
info_TEXINFOS = make.texinfo
|
||||||
|
|
||||||
|
INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
|
||||||
|
|
||||||
|
BUILT_SOURCES = README build.sh.in
|
||||||
|
|
||||||
|
EXTRA_DIST = make.man $(BUILT_SOURCES) remote-cstms.c\
|
||||||
|
make-stds.texi texinfo.tex SCOPTIONS SMakefile\
|
||||||
|
README.Amiga Makefile.ami config.ami make.lnk amiga.c amiga.h\
|
||||||
|
README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\
|
||||||
|
README.W32 NMakefile config.h.W32 build_w32.bat subproc.bat\
|
||||||
|
readme.vms makefile.vms makefile.com config.h-vms vmsdir.h\
|
||||||
|
vmsfunctions.c vmsify.c
|
||||||
|
|
||||||
|
SUBDIRS = glob
|
||||||
|
|
||||||
|
# --------------- Local DIST Section
|
||||||
|
|
||||||
|
# Install the w32 subdirectory
|
||||||
|
#
|
||||||
|
dist-hook:
|
||||||
|
(cd $(srcdir); \
|
||||||
|
w32=`find w32 -follow \( -name CVS -prune \) -o -type f -print`; \
|
||||||
|
tar chf - $$w32) \
|
||||||
|
| (cd $(distdir); tar xfBp -)
|
||||||
|
|
||||||
|
|
||||||
|
# --------------- Local CHECK Section
|
||||||
|
|
||||||
|
check-local: check-loadavg check-regression
|
||||||
|
.PHONY: check-loadavg check-regression
|
||||||
|
|
||||||
|
# > check-loadavg
|
||||||
|
#
|
||||||
|
loadavg: loadavg.c config.h
|
||||||
|
@rm -f loadavg
|
||||||
|
$(LINK) -I. -I$(srcdir) -DHAVE_CONFIG_H -DTEST $(make_LDFLAGS) loadavg.c $(LIBS)
|
||||||
|
# We copy getloadavg.c into a different file rather than compiling it
|
||||||
|
# directly because some compilers clobber getloadavg.o in the process.
|
||||||
|
loadavg.c: getloadavg.c
|
||||||
|
ln $(srcdir)/getloadavg.c loadavg.c || \
|
||||||
|
cp $(srcdir)/getloadavg.c loadavg.c
|
||||||
|
check-loadavg: loadavg
|
||||||
|
@echo The system uptime program believes the load average to be:
|
||||||
|
-uptime
|
||||||
|
@echo The GNU load average checking code believes:
|
||||||
|
-./loadavg
|
||||||
|
|
||||||
|
# > check-regression
|
||||||
|
#
|
||||||
|
# Look for the make test suite, and run it if found. Look in MAKE_TEST if
|
||||||
|
# specified, or else in the srcdir or the distdir, their parents, and _their_
|
||||||
|
# parents.
|
||||||
|
#
|
||||||
|
check-regression:
|
||||||
|
here=`pwd`; testdir=""; \
|
||||||
|
case "$(MAKE_TEST)" in "") \
|
||||||
|
for d1 in $$here $(srcdir); do \
|
||||||
|
for d2 in ../.. .. .; do \
|
||||||
|
all=`echo $$d1/$$d2/make-test-[0-9]*/run_make_tests`; \
|
||||||
|
case "$$all" in \
|
||||||
|
"$$d1/$$d2/make-test-[0-9]*/run_make_tests") : ;; \
|
||||||
|
*) try=`for x in $$all; do echo $$x; done | sort | tail -1`;\
|
||||||
|
testdir=`dirname $$try` ;; esac; \
|
||||||
|
done; done ;; \
|
||||||
|
*) testdir="$(MAKE_TEST)" ;; \
|
||||||
|
esac; \
|
||||||
|
case "$$testdir" in \
|
||||||
|
"") echo "Couldn't find make-test-* test suite."; exit 0;; \
|
||||||
|
esac; \
|
||||||
|
echo "cd $$testdir && ./run_make_tests -make_path $$here/make"; \
|
||||||
|
cd $$testdir && ./run_make_tests -make_path $$here/make
|
||||||
|
|
||||||
|
|
||||||
|
# --------------- Maintainer's Section
|
||||||
|
|
||||||
|
if MAINT_MAKEFILE
|
||||||
|
# Note this requires GNU make. Not to worry, since it will only be included
|
||||||
|
# in the Makefile if we're in the maintainer's environment.
|
||||||
|
include $(srcdir)/maintMakefile
|
||||||
|
endif
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# NOTE: If you have no `make' program at all to process this makefile, run
|
# NOTE: If you have no `make' program at all to process this makefile, run
|
||||||
# `build.sh' instead.
|
# `build.sh' instead.
|
||||||
#
|
#
|
||||||
# Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
|
# Copyright (C) 1988, 89, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify
|
# GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
#
|
#
|
||||||
# GNU Make is distributed in the hope that it will be useful,
|
# GNU Make is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
@@ -22,18 +22,12 @@
|
|||||||
# Makefile for GNU Make
|
# Makefile for GNU Make
|
||||||
#
|
#
|
||||||
|
|
||||||
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
CC = sc
|
||||||
VPATH = @srcdir@
|
RM = delete
|
||||||
# This must repeat the value, because configure will remove `VPATH = .'.
|
|
||||||
srcdir = @srcdir@
|
|
||||||
|
|
||||||
CC = @CC@
|
CFLAGS =
|
||||||
|
CPPFLAGS =
|
||||||
CFLAGS = @CFLAGS@
|
LDFLAGS =
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
|
|
||||||
# How to invoke ranlib. This is only used by the `glob' subdirectory.
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
|
|
||||||
# Define these for your system as follows:
|
# Define these for your system as follows:
|
||||||
# -DNO_ARCHIVES To disable `ar' archive support.
|
# -DNO_ARCHIVES To disable `ar' archive support.
|
||||||
@@ -44,16 +38,16 @@ RANLIB = @RANLIB@
|
|||||||
# so beware.
|
# so beware.
|
||||||
# NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
|
# NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
|
||||||
# See also `config.h'.
|
# See also `config.h'.
|
||||||
defines = @DEFS@ -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"
|
defines =
|
||||||
|
|
||||||
# Which flavor of remote job execution support to use.
|
# Which flavor of remote job execution support to use.
|
||||||
# The code is found in `remote-$(REMOTE).c'.
|
# The code is found in `remote-$(REMOTE).c'.
|
||||||
REMOTE = @REMOTE@
|
REMOTE = stub
|
||||||
|
|
||||||
# If you are using the GNU C library, or have the GNU getopt functions in
|
# If you are using the GNU C library, or have the GNU getopt functions in
|
||||||
# your C library, you can comment these out.
|
# your C library, you can comment these out.
|
||||||
GETOPT = getopt.o getopt1.o
|
GETOPT = getopt.o getopt1.o
|
||||||
GETOPT_SRC = $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/getopt.h
|
GETOPT_SRC = $(srcdir)getopt.c $(srcdir)getopt1.c $(srcdir)getopt.h
|
||||||
|
|
||||||
# If you are using the GNU C library, or have the GNU glob functions in
|
# If you are using the GNU C library, or have the GNU glob functions in
|
||||||
# your C library, you can comment this out. GNU make uses special hooks
|
# your C library, you can comment this out. GNU make uses special hooks
|
||||||
@@ -61,36 +55,36 @@ GETOPT_SRC = $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/getopt.h
|
|||||||
# cache for globbing), so you must use the GNU functions even if your
|
# cache for globbing), so you must use the GNU functions even if your
|
||||||
# system's C library has the 1003.2 glob functions already. Also, the glob
|
# system's C library has the 1003.2 glob functions already. Also, the glob
|
||||||
# functions in the AIX and HPUX C libraries are said to be buggy.
|
# functions in the AIX and HPUX C libraries are said to be buggy.
|
||||||
GLOB = glob/libglob.a
|
GLOB = glob/glob.lib
|
||||||
|
|
||||||
# If your system doesn't have alloca, or the one provided is bad, define this.
|
# If your system doesn't have alloca, or the one provided is bad, define this.
|
||||||
ALLOCA = @ALLOCA@
|
ALLOCA = alloca.o
|
||||||
ALLOCA_SRC = $(srcdir)/alloca.c
|
ALLOCA_SRC = $(srcdir)alloca.c
|
||||||
|
|
||||||
# If your system needs extra libraries loaded in, define them here.
|
# If your system needs extra libraries loaded in, define them here.
|
||||||
# System V probably need -lPW for alloca. HP-UX 7.0's alloca in
|
# System V probably need -lPW for alloca. HP-UX 7.0's alloca in
|
||||||
# libPW.a is broken on HP9000s300 and HP9000s400 machines. Use
|
# libPW.a is broken on HP9000s300 and HP9000s400 machines. Use
|
||||||
# alloca.c instead on those machines.
|
# alloca.c instead on those machines.
|
||||||
LOADLIBES = @LIBS@
|
LOADLIBES =
|
||||||
|
|
||||||
# Any extra object files your system needs.
|
# Any extra object files your system needs.
|
||||||
extras = @LIBOBJS@
|
extras = amiga.o
|
||||||
|
|
||||||
# Common prefix for machine-independent installed files.
|
# Common prefix for machine-independent installed files.
|
||||||
prefix = /usr/local
|
prefix =
|
||||||
# Common prefix for machine-dependent installed files.
|
# Common prefix for machine-dependent installed files.
|
||||||
exec_prefix = $(prefix)
|
exec_prefix =
|
||||||
|
|
||||||
# Directory to install `make' in.
|
# Directory to install `make' in.
|
||||||
bindir = $(exec_prefix)/bin
|
bindir = sc:c
|
||||||
# Directory to find libraries in for `-lXXX'.
|
# Directory to find libraries in for `-lXXX'.
|
||||||
libdir = $(exec_prefix)/lib
|
libdir = lib:
|
||||||
# Directory to search by default for included makefiles.
|
# Directory to search by default for included makefiles.
|
||||||
includedir = $(prefix)/include
|
includedir = include:
|
||||||
# Directory to install the Info files in.
|
# Directory to install the Info files in.
|
||||||
infodir = $(prefix)/info
|
infodir = doc:
|
||||||
# Directory to install the man page in.
|
# Directory to install the man page in.
|
||||||
mandir = $(prefix)/man/man$(manext)
|
mandir = t:
|
||||||
# Number to put on the man page filename.
|
# Number to put on the man page filename.
|
||||||
manext = 1
|
manext = 1
|
||||||
# Prefix to put on installed `make' binary file name.
|
# Prefix to put on installed `make' binary file name.
|
||||||
@@ -102,16 +96,16 @@ manprefix = $(binprefix)
|
|||||||
# The value should be either `true' or `false'.
|
# The value should be either `true' or `false'.
|
||||||
# On many systems, the getloadavg function (used to implement the `-l'
|
# On many systems, the getloadavg function (used to implement the `-l'
|
||||||
# switch) will not work unless make is installed setgid kmem.
|
# switch) will not work unless make is installed setgid kmem.
|
||||||
install_setgid = @NEED_SETGID@
|
install_setgid = false
|
||||||
# Install make setgid to this group so it can read /dev/kmem.
|
# Install make setgid to this group so it can read /dev/kmem.
|
||||||
group = @KMEM_GROUP@
|
group = sys
|
||||||
|
|
||||||
# Program to install `make'.
|
# Program to install `make'.
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = copy
|
||||||
# Program to install the man page.
|
# Program to install the man page.
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = copy
|
||||||
# Generic install program.
|
# Generic install program.
|
||||||
INSTALL = @INSTALL@
|
INSTALL = copy
|
||||||
|
|
||||||
# Program to format Texinfo source into Info files.
|
# Program to format Texinfo source into Info files.
|
||||||
MAKEINFO = makeinfo
|
MAKEINFO = makeinfo
|
||||||
@@ -119,81 +113,81 @@ MAKEINFO = makeinfo
|
|||||||
TEXI2DVI = texi2dvi
|
TEXI2DVI = texi2dvi
|
||||||
|
|
||||||
# Programs to make tags files.
|
# Programs to make tags files.
|
||||||
ETAGS = etags -tw
|
ETAGS = etags -w
|
||||||
CTAGS = ctags -tw
|
CTAGS = ctags -w
|
||||||
|
|
||||||
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
||||||
rule.o implicit.o default.o variable.o expand.o function.o \
|
rule.o implicit.o default.o variable.o expand.o function.o \
|
||||||
vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \
|
vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \
|
||||||
$(GLOB) $(GETOPT) $(ALLOCA) $(extras)
|
$(GETOPT) $(ALLOCA) $(extras)
|
||||||
srcs = $(srcdir)/commands.c $(srcdir)/job.c $(srcdir)/dir.c \
|
srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \
|
||||||
$(srcdir)/file.c $(srcdir)/getloadavg.c $(srcdir)/misc.c \
|
$(srcdir)file.c $(srcdir)getloadavg.c $(srcdir)misc.c \
|
||||||
$(srcdir)/main.c $(srcdir)/read.c $(srcdir)/remake.c \
|
$(srcdir)main.c $(srcdir)read.c $(srcdir)remake.c \
|
||||||
$(srcdir)/rule.c $(srcdir)/implicit.c $(srcdir)/default.c \
|
$(srcdir)rule.c $(srcdir)implicit.c $(srcdir)default.c \
|
||||||
$(srcdir)/variable.c $(srcdir)/expand.c $(srcdir)/function.c \
|
$(srcdir)variable.c $(srcdir)expand.c $(srcdir)function.c \
|
||||||
$(srcdir)/vpath.c $(srcdir)/version.c \
|
$(srcdir)vpath.c $(srcdir)version.c \
|
||||||
$(srcdir)/remote-$(REMOTE).c \
|
$(srcdir)remote-$(REMOTE).c \
|
||||||
$(srcdir)/ar.c $(srcdir)/arscan.c \
|
$(srcdir)ar.c $(srcdir)arscan.c \
|
||||||
$(srcdir)/signame.c $(srcdir)/signame.h $(GETOPT_SRC) \
|
$(srcdir)signame.c $(srcdir)signame.h $(GETOPT_SRC) \
|
||||||
$(srcdir)/commands.h $(srcdir)/dep.h $(srcdir)/file.h \
|
$(srcdir)commands.h $(srcdir)dep.h $(srcdir)filedep.h \
|
||||||
$(srcdir)/job.h $(srcdir)/make.h $(srcdir)/rule.h \
|
$(srcdir)job.h $(srcdir)make.h $(srcdir)rule.h \
|
||||||
$(srcdir)/variable.h $(ALLOCA_SRC) $(srcdir)/config.h.in
|
$(srcdir)variable.h $(ALLOCA_SRC) $(srcdir)config.h.in
|
||||||
|
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
|
.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
|
||||||
|
|
||||||
all: make
|
all: make
|
||||||
check: # No tests.
|
|
||||||
info: make.info
|
info: make.info
|
||||||
dvi: make.dvi
|
dvi: make.dvi
|
||||||
# Some makes apparently use .PHONY as the default goal is it is before `all'.
|
# Some makes apparently use .PHONY as the default goal if it is before `all'.
|
||||||
.PHONY: all check info dvi
|
.PHONY: all check info dvi
|
||||||
|
|
||||||
make.info: make.texinfo
|
make.info: make.texinfo
|
||||||
$(MAKEINFO) -I$(srcdir) $(srcdir)/make.texinfo -o make.info
|
$(MAKEINFO) -I$(srcdir) $(srcdir)make.texinfo -o make.info
|
||||||
|
|
||||||
make.dvi: make.texinfo
|
make.dvi: make.texinfo
|
||||||
$(TEXI2DVI) $(srcdir)/make.texinfo
|
$(TEXI2DVI) $(srcdir)make.texinfo
|
||||||
|
|
||||||
make.ps: make.dvi
|
make.ps: make.dvi
|
||||||
dvi2ps make.dvi > make.ps
|
dvi2ps make.dvi > make.ps
|
||||||
|
|
||||||
make: $(objs)
|
make: $(objs) $(GLOB)
|
||||||
$(CC) $(LDFLAGS) $(objs) $(LOADLIBES) -o make.new
|
$(CC) Link $(LDFLAGS) $(objs) Lib $(GLOB) $(LOADLIBES) To make.new
|
||||||
mv -f make.new make
|
-delete make
|
||||||
|
rename make.new make
|
||||||
|
|
||||||
|
TMPFILE = t:Make$$
|
||||||
|
|
||||||
|
$(GLOB):
|
||||||
|
cd glob @@\
|
||||||
|
$(MAKE) -$(MAKEFLAGS) -f Makefile
|
||||||
|
|
||||||
# -I. is needed to find config.h in the build directory.
|
# -I. is needed to find config.h in the build directory.
|
||||||
|
OUTPUT_OPTION =
|
||||||
.c.o:
|
.c.o:
|
||||||
$(CC) $(defines) -c -I. -I$(srcdir) -I$(srcdir)/glob \
|
$(CC) $(defines) IDir "" IDir glob \
|
||||||
$(CFLAGS) $< $(OUTPUT_OPTION)
|
$(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
||||||
|
|
||||||
# For some losing Unix makes.
|
# For some losing Unix makes.
|
||||||
SHELL = /bin/sh
|
SHELL = /bin/sh
|
||||||
MAKE = make
|
#@SET_MAKE@
|
||||||
|
|
||||||
glob/libglob.a: FORCE config.h
|
glob/libglob.a: FORCE config.h
|
||||||
cd glob; $(MAKE) CC='$(CC)' CFLAGS='$(CFLAGS) -I..' \
|
cd glob; $(MAKE) libglob.a
|
||||||
CPPFLAGS='$(CPPFLAGS) -DHAVE_CONFIG_H' \
|
|
||||||
RANLIB='$(RANLIB)' \
|
|
||||||
libglob.a
|
|
||||||
FORCE:
|
FORCE:
|
||||||
|
|
||||||
tagsrcs = $(srcs) $(srcdir)/remote-*.c
|
tagsrcs = $(srcs) $(srcdir)remote-*.c
|
||||||
TAGS: $(tagsrcs)
|
|
||||||
$(ETAGS) $(tagsrcs)
|
|
||||||
tags: $(tagsrcs)
|
|
||||||
$(CTAGS) $(tagsrcs)
|
|
||||||
|
|
||||||
.PHONY: install installdirs
|
.PHONY: install installdirs
|
||||||
install: installdirs \
|
install: installdirs \
|
||||||
$(bindir)/$(binprefix)make $(infodir)/make.info \
|
$(bindir)$(binprefix)make $(infodir)make.info \
|
||||||
$(mandir)/$(manprefix)make.$(manext)
|
$(mandir)$(manprefix)make.$(manext)
|
||||||
|
|
||||||
installdirs:
|
installdirs:
|
||||||
$(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(mandir)
|
$(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(mandir)
|
||||||
|
|
||||||
$(bindir)/$(binprefix)make: make
|
$(bindir)$(binprefix)make: make
|
||||||
$(INSTALL_PROGRAM) make $@.new
|
$(INSTALL_PROGRAM) make $@.new
|
||||||
@if $(install_setgid); then \
|
@if $(install_setgid); then \
|
||||||
if chgrp $(group) $@.new && chmod g+s $@.new; then \
|
if chgrp $(group) $@.new && chmod g+s $@.new; then \
|
||||||
@@ -201,15 +195,15 @@ $(bindir)/$(binprefix)make: make
|
|||||||
else \
|
else \
|
||||||
echo "$@ needs to be owned by group $(group) and setgid;"; \
|
echo "$@ needs to be owned by group $(group) and setgid;"; \
|
||||||
echo "otherwise the \`-l' option will probably not work."; \
|
echo "otherwise the \`-l' option will probably not work."; \
|
||||||
echo "You may need special priveleges to install $@."; \
|
echo "You may need special privileges to install $@."; \
|
||||||
fi; \
|
fi; \
|
||||||
else true; fi
|
else true; fi
|
||||||
# Some systems can't deal with renaming onto a running binary.
|
# Some systems can't deal with renaming onto a running binary.
|
||||||
-rm -f $@.old
|
-$(RM) $@.old
|
||||||
-mv $@ $@.old
|
-mv $@ $@.old
|
||||||
mv $@.new $@
|
mv $@.new $@
|
||||||
|
|
||||||
$(infodir)/make.info: make.info
|
$(infodir)make.info: make.info
|
||||||
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
||||||
for file in $${dir}/make.info*; do \
|
for file in $${dir}/make.info*; do \
|
||||||
name="`basename $$file`"; \
|
name="`basename $$file`"; \
|
||||||
@@ -222,11 +216,12 @@ $(infodir)/make.info: make.info
|
|||||||
# We use `$(SHELL) -c' because some shells do not
|
# We use `$(SHELL) -c' because some shells do not
|
||||||
# fail gracefully when there is an unknown command.
|
# fail gracefully when there is an unknown command.
|
||||||
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
|
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
|
||||||
|
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
|
||||||
install-info --infodir=$(infodir) $$dir/make.info; \
|
install-info --infodir=$(infodir) $$dir/make.info; \
|
||||||
else true; fi
|
else true; fi
|
||||||
|
|
||||||
$(mandir)/$(manprefix)make.$(manext): make.man
|
$(mandir)$(manprefix)make.$(manext): make.man
|
||||||
$(INSTALL_DATA) $(srcdir)/make.man $@
|
$(INSTALL_DATA) $(srcdir)make.man $@
|
||||||
|
|
||||||
|
|
||||||
loadavg: loadavg.c config.h
|
loadavg: loadavg.c config.h
|
||||||
@@ -235,8 +230,8 @@ loadavg: loadavg.c config.h
|
|||||||
# We copy getloadavg.c into a different file rather than compiling it
|
# We copy getloadavg.c into a different file rather than compiling it
|
||||||
# directly because some compilers clobber getloadavg.o in the process.
|
# directly because some compilers clobber getloadavg.o in the process.
|
||||||
loadavg.c: getloadavg.c
|
loadavg.c: getloadavg.c
|
||||||
ln $(srcdir)/getloadavg.c loadavg.c || \
|
ln $(srcdir)getloadavg.c loadavg.c || \
|
||||||
cp $(srcdir)/getloadavg.c loadavg.c
|
cp $(srcdir)getloadavg.c loadavg.c
|
||||||
check-loadavg: loadavg
|
check-loadavg: loadavg
|
||||||
@echo The system uptime program believes the load average to be:
|
@echo The system uptime program believes the load average to be:
|
||||||
-uptime
|
-uptime
|
||||||
@@ -247,33 +242,23 @@ check: check-loadavg
|
|||||||
|
|
||||||
.PHONY: clean realclean distclean mostlyclean
|
.PHONY: clean realclean distclean mostlyclean
|
||||||
clean: glob-clean
|
clean: glob-clean
|
||||||
-rm -f make loadavg *.o core make.info* make.dvi
|
-$(RM) make loadavg "#?.o" core make.dvi
|
||||||
|
|
||||||
distclean: clean glob-realclean
|
distclean: clean glob-realclean
|
||||||
-rm -f Makefile config.h config.status build.sh stamp-config
|
-$(RM) Makefile config.h config.status build.sh stamp-config
|
||||||
-rm -f TAGS tags
|
-$(RM) config.log config.cache
|
||||||
-rm -f make.?? make.??s make.log make.toc make.*aux
|
-$(RM) TAGS tags
|
||||||
-rm -f loadavg.c
|
-$(RM) make.?? make.??s make.log make.toc make.*aux
|
||||||
|
-$(RM) loadavg.c
|
||||||
|
|
||||||
realclean: distclean
|
realclean: distclean
|
||||||
|
-$(RM) make.info*
|
||||||
mostlyclean: clean
|
mostlyclean: clean
|
||||||
|
|
||||||
.PHONY: glob-clean glob-realclean
|
.PHONY: glob-clean glob-realclean
|
||||||
glob-clean glob-realclean:
|
glob-clean glob-realclean:
|
||||||
cd glob; $(MAKE) $@
|
cd glob @@\
|
||||||
|
$(MAKE) $@
|
||||||
Makefile: config.status $(srcdir)/Makefile.in
|
|
||||||
$(SHELL) config.status
|
|
||||||
glob/Makefile: config.status $(srcdir)/glob/Makefile.in
|
|
||||||
$(SHELL) config.status
|
|
||||||
config.h: stamp-config ;
|
|
||||||
stamp-config: config.status $(srcdir)/config.h.in
|
|
||||||
$(SHELL) config.status
|
|
||||||
touch stamp-config
|
|
||||||
|
|
||||||
# These rules cause too much trouble.
|
|
||||||
#configure: configure.in
|
|
||||||
# autoconf $(ACFLAGS)
|
|
||||||
#config.h.in: configure.in
|
|
||||||
# autoheader $(ACFLAGS)
|
|
||||||
|
|
||||||
# This tells versions [3.59,3.63) of GNU make not to export all variables.
|
# This tells versions [3.59,3.63) of GNU make not to export all variables.
|
||||||
.NOEXPORT:
|
.NOEXPORT:
|
||||||
@@ -285,3 +270,35 @@ $(objs): config.h
|
|||||||
|
|
||||||
# Automatically generated dependencies will be put at the end of the file.
|
# Automatically generated dependencies will be put at the end of the file.
|
||||||
|
|
||||||
|
# Automatically generated dependencies.
|
||||||
|
commands.o: commands.c make.h dep.h filedef.h variable.h job.h \
|
||||||
|
commands.h
|
||||||
|
job.o: job.c make.h job.h filedef.h commands.h variable.h
|
||||||
|
dir.o: dir.c make.h
|
||||||
|
file.o: file.c make.h dep.h filedef.h job.h commands.h variable.h
|
||||||
|
misc.o: misc.c make.h dep.h
|
||||||
|
main.o: main.c make.h dep.h filedef.h variable.h job.h commands.h \
|
||||||
|
getopt.h
|
||||||
|
read.o: read.c make.h dep.h filedef.h job.h commands.h variable.h \
|
||||||
|
glob/glob.h
|
||||||
|
remake.o: remake.c make.h filedef.h job.h commands.h dep.h
|
||||||
|
rule.o: rule.c make.h dep.h filedef.h job.h commands.h variable.h \
|
||||||
|
rule.h
|
||||||
|
implicit.o: implicit.c make.h rule.h dep.h filedef.h
|
||||||
|
default.o: default.c make.h rule.h dep.h filedef.h job.h commands.h \
|
||||||
|
variable.h
|
||||||
|
variable.o: variable.c make.h dep.h filedef.h job.h commands.h \
|
||||||
|
variable.h
|
||||||
|
expand.o: expand.c make.h filedef.h job.h commands.h variable.h
|
||||||
|
function.o: function.c make.h filedef.h variable.h dep.h job.h \
|
||||||
|
commands.h amiga.h
|
||||||
|
vpath.o: vpath.c make.h filedef.h variable.h
|
||||||
|
version.o: version.c
|
||||||
|
ar.o: ar.c make.h filedef.h dep.h
|
||||||
|
arscan.o: arscan.c make.h
|
||||||
|
signame.o: signame.c signame.h
|
||||||
|
remote-stub.o: remote-stub.c make.h filedef.h job.h commands.h
|
||||||
|
getopt.o: getopt.c
|
||||||
|
getopt1.o : getopt1.c getopt.h
|
||||||
|
getloadavg.o: getloadavg.c
|
||||||
|
amiga.o: amiga.c make.h variable.h amiga.h
|
||||||
626
NEWS
Normal file
626
NEWS
Normal file
@@ -0,0 +1,626 @@
|
|||||||
|
GNU make NEWS -*-indented-text-*-
|
||||||
|
History of user-visible changes.
|
||||||
|
18 Aug 1997
|
||||||
|
|
||||||
|
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
See the end for copying conditions.
|
||||||
|
|
||||||
|
Please send GNU make bug reports to bug-gnu-utils@prep.ai.mit.edu.
|
||||||
|
|
||||||
|
Version 3.76
|
||||||
|
|
||||||
|
* GNU make now uses automake to control Makefile.in generation. This
|
||||||
|
should make it more consistent with the GNU standards.
|
||||||
|
|
||||||
|
* VPATH functionality has been changed to incorporate the VPATH+ patch,
|
||||||
|
previously maintained by Paul Smith <psmith@baynetworks.com>. See the
|
||||||
|
manual.
|
||||||
|
|
||||||
|
* Make defines a new variable, `MAKECMDGOALS', to contain the goals that
|
||||||
|
were specified on the command line, if any. Modifying this variable
|
||||||
|
has no effect on the operation of make.
|
||||||
|
|
||||||
|
* A new function, `$(wordlist S,E,TEXT)', is available: it returns a
|
||||||
|
list of words from number S to number E (inclusive) of TEXT.
|
||||||
|
|
||||||
|
* Instead of an error, detection of future modification times gives a
|
||||||
|
warning and continues. The warning is repeated just before GNU make
|
||||||
|
exits, so it is less likely to be lost.
|
||||||
|
|
||||||
|
* Fix the $(basename) and $(suffix) functions so they only operate on
|
||||||
|
the last filename, not the entire string:
|
||||||
|
|
||||||
|
Command Old Result New Result
|
||||||
|
------- ---------- ----------
|
||||||
|
$(basename a.b) a a
|
||||||
|
$(basename a.b/c) a a.b/c
|
||||||
|
$(suffix a.b) b b
|
||||||
|
$(suffix a.b/c) b/c <empty>
|
||||||
|
|
||||||
|
* The $(strip) function now removes newlines as well as TABs and spaces.
|
||||||
|
|
||||||
|
* The $(shell) function now changes CRLF (\r\n) pairs to a space as well
|
||||||
|
as newlines (\n).
|
||||||
|
|
||||||
|
* Updates to the Windows 95/NT port from Rob Tulloh (see README.W32).
|
||||||
|
|
||||||
|
* Eli Zaretskii has updated the port to 32-bit protected mode on MSDOS
|
||||||
|
and MS-Windows, building with the DJGPP v2 port of GNU C/C++ compiler
|
||||||
|
and utilities. See README.DOS for details, and direct all questions
|
||||||
|
concerning this port to Eli Zaretskii <eliz@is.elta.co.il> or DJ
|
||||||
|
Delorie <dj@delorie.com>.
|
||||||
|
|
||||||
|
* John W. Eaton has updated the VMS port to support libraries and VPATH.
|
||||||
|
|
||||||
|
Version 3.75
|
||||||
|
|
||||||
|
* The directory messages printed by `-w' and implicitly in sub-makes,
|
||||||
|
are now omitted if Make runs no commands and has no other messages to print.
|
||||||
|
|
||||||
|
* Make now detects files that for whatever reason have modification times
|
||||||
|
in the future and gives an error. Files with such impossible timestamps
|
||||||
|
can result from unsynchronized clocks, or archived distributions
|
||||||
|
containing bogus timestamps; they confuse Make's dependency engine
|
||||||
|
thoroughly.
|
||||||
|
|
||||||
|
* The new directive `sinclude' is now recognized as another name for
|
||||||
|
`-include', for compatibility with some other Makes.
|
||||||
|
|
||||||
|
* Aaron Digulla has contributed a port to AmigaDOS. See README.Amiga for
|
||||||
|
details, and direct all Amiga-related questions to <digulla@fh-konstanz.de>.
|
||||||
|
|
||||||
|
* Rob Tulloh of Tivoli Systems has contributed a port to Windows NT or 95.
|
||||||
|
See README.W32 for details, and direct all Windows-related questions to
|
||||||
|
<rob_tulloh@tivoli.com>.
|
||||||
|
|
||||||
|
Version 3.73
|
||||||
|
|
||||||
|
* Converted to use Autoconf version 2, so `configure' has some new options.
|
||||||
|
See INSTALL for details.
|
||||||
|
|
||||||
|
* You can now send a SIGUSR1 signal to Make to toggle printing of debugging
|
||||||
|
output enabled by -d, at any time during the run.
|
||||||
|
|
||||||
|
Version 3.72
|
||||||
|
|
||||||
|
* DJ Delorie has ported Make to MS-DOS using the GO32 extender.
|
||||||
|
He is maintaining the DOS port, not the GNU Make maintainer;
|
||||||
|
please direct bugs and questions for DOS to <djgpp@sun.soe.clarkson.edu>.
|
||||||
|
MS-DOS binaries are available for FTP from ftp.simtel.net in
|
||||||
|
/pub/simtelnet/gnu/djgpp/.
|
||||||
|
|
||||||
|
* The `MAKEFLAGS' variable (in the environment or in a makefile) can now
|
||||||
|
contain variable definitions itself; these are treated just like
|
||||||
|
command-line variable definitions. Make will automatically insert any
|
||||||
|
variable definitions from the environment value of `MAKEFLAGS' or from
|
||||||
|
the command line, into the `MAKEFLAGS' value exported to children. The
|
||||||
|
`MAKEOVERRIDES' variable previously included in the value of `$(MAKE)'
|
||||||
|
for sub-makes is now included in `MAKEFLAGS' instead. As before, you can
|
||||||
|
reset `MAKEOVERRIDES' in your makefile to avoid putting all the variables
|
||||||
|
in the environment when its size is limited.
|
||||||
|
|
||||||
|
* If `.DELETE_ON_ERROR' appears as a target, Make will delete the target of
|
||||||
|
a rule if it has changed when its commands exit with a nonzero status,
|
||||||
|
just as when the commands get a signal.
|
||||||
|
|
||||||
|
* The automatic variable `$+' is new. It lists all the dependencies like
|
||||||
|
`$^', but preserves duplicates listed in the makefile. This is useful
|
||||||
|
for linking rules, where library files sometimes need to be listed twice
|
||||||
|
in the link order.
|
||||||
|
|
||||||
|
* You can now specify the `.IGNORE' and `.SILENT' special targets with
|
||||||
|
dependencies to limit their effects to those files. If a file appears as
|
||||||
|
a dependency of `.IGNORE', then errors will be ignored while running the
|
||||||
|
commands to update that file. Likewise if a file appears as a dependency
|
||||||
|
of `.SILENT', then the commands to update that file will not be printed
|
||||||
|
before they are run. (This change was made to conform to POSIX.2.)
|
||||||
|
|
||||||
|
Version 3.71
|
||||||
|
|
||||||
|
* The automatic variables `$(@D)', `$(%D)', `$(*D)', `$(<D)', `$(?D)', and
|
||||||
|
`$(^D)' now omit the trailing slash from the directory name. (This change
|
||||||
|
was made to comply with POSIX.2.)
|
||||||
|
|
||||||
|
* The source distribution now includes the Info files for the Make manual.
|
||||||
|
There is no longer a separate distribution containing Info and DVI files.
|
||||||
|
|
||||||
|
* You can now set the variables `binprefix' and/or `manprefix' in
|
||||||
|
Makefile.in (or on the command line when installing) to install GNU make
|
||||||
|
under a name other than `make' (i.e., ``make binprefix=g install''
|
||||||
|
installs GNU make as `gmake').
|
||||||
|
|
||||||
|
* The built-in Texinfo rules use the new variables `TEXI2DVI_FLAGS' for
|
||||||
|
flags to the `texi2dvi' script, and `MAKEINFO_FLAGS' for flags to the
|
||||||
|
Makeinfo program.
|
||||||
|
|
||||||
|
* The exit status of Make when it runs into errors is now 2 instead of 1.
|
||||||
|
The exit status is 1 only when using -q and some target is not up to date.
|
||||||
|
(This change was made to comply with POSIX.2.)
|
||||||
|
|
||||||
|
Version 3.70
|
||||||
|
|
||||||
|
* It is no longer a fatal error to have a NUL character in a makefile.
|
||||||
|
You should never put a NUL in a makefile because it can have strange
|
||||||
|
results, but otherwise empty lines full of NULs (such as produced by
|
||||||
|
the `xmkmf' program) will always work fine.
|
||||||
|
|
||||||
|
* The error messages for nonexistent included makefiles now refer to the
|
||||||
|
makefile name and line number where the `include' appeared, so Emacs's
|
||||||
|
C-x ` command takes you there (in case it's a typo you need to fix).
|
||||||
|
|
||||||
|
Version 3.69
|
||||||
|
|
||||||
|
* Implicit rule search for archive member references is now done in the
|
||||||
|
opposite order from previous versions: the whole target name `LIB(MEM)'
|
||||||
|
first, and just the member name and parentheses `(MEM)' second.
|
||||||
|
|
||||||
|
* Make now gives an error for an unterminated variable or function reference.
|
||||||
|
For example, `$(foo' with no matching `)' or `${bar' with no matching `}'.
|
||||||
|
|
||||||
|
* The new default variable `MAKE_VERSION' gives the version number of
|
||||||
|
Make, and a string describing the remote job support compiled in (if any).
|
||||||
|
Thus the value (in this release) is something like `3.69' or `3.69-Customs'.
|
||||||
|
|
||||||
|
* Commands in an invocation of the `shell' function are no longer run with
|
||||||
|
a modified environment like target commands are. As in versions before
|
||||||
|
3.68, they now run with the environment that `make' started with. We
|
||||||
|
have reversed the change made in version 3.68 because it turned out to
|
||||||
|
cause a paradoxical situation in cases like:
|
||||||
|
|
||||||
|
export variable = $(shell echo value)
|
||||||
|
|
||||||
|
When Make attempted to put this variable in the environment for a target
|
||||||
|
command, it would try expand the value by running the shell command
|
||||||
|
`echo value'. In version 3.68, because it constructed an environment
|
||||||
|
for that shell command in the same way, Make would begin to go into an
|
||||||
|
infinite loop and then get a fatal error when it detected the loop.
|
||||||
|
|
||||||
|
* The commands given for `.DEFAULT' are now used for phony targets with no
|
||||||
|
commands.
|
||||||
|
|
||||||
|
Version 3.68
|
||||||
|
|
||||||
|
* You can list several archive member names inside parenthesis:
|
||||||
|
`lib(mem1 mem2 mem3)' is equivalent to `lib(mem1) lib(mem2) lib(mem3)'.
|
||||||
|
|
||||||
|
* You can use wildcards inside archive member references. For example,
|
||||||
|
`lib(*.o)' expands to all existing members of `lib' whose names end in
|
||||||
|
`.o' (e.g. `lib(a.o) lib(b.o)'); `*.a(*.o)' expands to all such members
|
||||||
|
of all existing files whose names end in `.a' (e.g. `foo.a(a.o)
|
||||||
|
foo.a(b.o) bar.a(c.o) bar.a(d.o)'.
|
||||||
|
|
||||||
|
* A suffix rule `.X.a' now produces two pattern rules:
|
||||||
|
(%.o): %.X # Previous versions produced only this.
|
||||||
|
%.a: %.X # Now produces this as well, just like other suffixes.
|
||||||
|
|
||||||
|
* The new flag `--warn-undefined-variables' says to issue a warning message
|
||||||
|
whenever Make expands a reference to an undefined variable.
|
||||||
|
|
||||||
|
* The new `-include' directive is just like `include' except that there is
|
||||||
|
no error (not even a warning) for a nonexistent makefile.
|
||||||
|
|
||||||
|
* Commands in an invocation of the `shell' function are now run with a
|
||||||
|
modified environment like target commands are, so you can use `export' et
|
||||||
|
al to set up variables for them. They used to run with the environment
|
||||||
|
that `make' started with.
|
||||||
|
|
||||||
|
Version 3.66
|
||||||
|
|
||||||
|
* `make --version' (or `make -v') now exits immediately after printing
|
||||||
|
the version number.
|
||||||
|
|
||||||
|
Version 3.65
|
||||||
|
|
||||||
|
* Make now supports long-named members in `ar' archive files.
|
||||||
|
|
||||||
|
Version 3.64
|
||||||
|
|
||||||
|
* Make now supports the `+=' syntax for a variable definition which appends
|
||||||
|
to the variable's previous value. See the section `Appending More Text
|
||||||
|
to Variables' in the manual for full details.
|
||||||
|
|
||||||
|
* The new option `--no-print-directory' inhibits the `-w' or
|
||||||
|
`--print-directory' feature. Make turns on `--print-directory'
|
||||||
|
automatically if you use `-C' or `--directory', and in sub-makes; some
|
||||||
|
users have found this behavior undesirable.
|
||||||
|
|
||||||
|
* The built-in implicit rules now support the alternative extension
|
||||||
|
`.txinfo' for Texinfo files, just like `.texinfo' and `.texi'.
|
||||||
|
|
||||||
|
Version 3.63
|
||||||
|
|
||||||
|
* Make now uses a standard GNU `configure' script. See the new file
|
||||||
|
INSTALL for the new (and much simpler) installation procedure.
|
||||||
|
|
||||||
|
* There is now a shell script to build Make the first time, if you have no
|
||||||
|
other `make' program. `build.sh' is created by `configure'; see README.
|
||||||
|
|
||||||
|
* GNU Make now completely conforms to the POSIX.2 specification for `make'.
|
||||||
|
|
||||||
|
* Elements of the `$^' and `$?' automatic variables that are archive
|
||||||
|
member references now list only the member name, as in Unix and POSIX.2.
|
||||||
|
|
||||||
|
* You should no longer ever need to specify the `-w' switch, which prints
|
||||||
|
the current directory before and after Make runs. The `-C' switch to
|
||||||
|
change directory, and recursive use of Make, now set `-w' automatically.
|
||||||
|
|
||||||
|
* Multiple double-colon rules for the same target will no longer have their
|
||||||
|
commands run simultaneously under -j, as this could result in the two
|
||||||
|
commands trying to change the file at the same time and interfering with
|
||||||
|
one another.
|
||||||
|
|
||||||
|
* The `SHELL' variable is now never taken from the environment.
|
||||||
|
Each makefile that wants a shell other than the default (/bin/sh) must
|
||||||
|
set SHELL itself. SHELL is always exported to child processes.
|
||||||
|
This change was made for compatibility with POSIX.2.
|
||||||
|
|
||||||
|
* Make now accepts long options. There is now an informative usage message
|
||||||
|
that tells you what all the options are and what they do. Try `make --help'.
|
||||||
|
|
||||||
|
* There are two new directives: `export' and `unexport'. All variables are
|
||||||
|
no longer automatically put into the environments of the commands that
|
||||||
|
Make runs. Instead, only variables specified on the command line or in
|
||||||
|
the environment are exported by default. To export others, use:
|
||||||
|
export VARIABLE
|
||||||
|
or you can define variables with:
|
||||||
|
export VARIABLE = VALUE
|
||||||
|
or:
|
||||||
|
export VARIABLE := VALUE
|
||||||
|
You can use just:
|
||||||
|
export
|
||||||
|
or:
|
||||||
|
.EXPORT_ALL_VARIABLES:
|
||||||
|
to get the old behavior. See the node `Variables/Recursion' in the manual
|
||||||
|
for a full description.
|
||||||
|
|
||||||
|
* The commands from the `.DEFAULT' special target are only applied to
|
||||||
|
targets which have no rules at all, not all targets with no commands.
|
||||||
|
This change was made for compatibility with Unix make.
|
||||||
|
|
||||||
|
* All fatal error messages now contain `***', so they are easy to find in
|
||||||
|
compilation logs.
|
||||||
|
|
||||||
|
* Dependency file names like `-lNAME' are now replaced with the actual file
|
||||||
|
name found, as with files found by normal directory search (VPATH).
|
||||||
|
The library file `libNAME.a' may now be found in the current directory,
|
||||||
|
which is checked before VPATH; the standard set of directories (/lib,
|
||||||
|
/usr/lib, /usr/local/lib) is now checked last.
|
||||||
|
See the node `Libraries/Search' in the manual for full details.
|
||||||
|
|
||||||
|
* A single `include' directive can now specify more than one makefile to
|
||||||
|
include, like this:
|
||||||
|
include file1 file2
|
||||||
|
You can also use shell file name patterns in an `include' directive:
|
||||||
|
include *.mk
|
||||||
|
|
||||||
|
* The default directories to search for included makefiles, and for
|
||||||
|
libraries specified with `-lNAME', are now set by configuration.
|
||||||
|
|
||||||
|
* You can now use blanks as well as colons to separate the directories in a
|
||||||
|
search path for the `vpath' directive or the `VPATH' variable.
|
||||||
|
|
||||||
|
* You can now use variables and functions in the left hand side of a
|
||||||
|
variable assignment, as in "$(foo)bar = value".
|
||||||
|
|
||||||
|
* The `MAKE' variable is always defined as `$(MAKE_COMMAND) $(MAKEOVERRIDES)'.
|
||||||
|
The `MAKE_COMMAND' variable is now defined to the name with which make
|
||||||
|
was invoked.
|
||||||
|
|
||||||
|
* The built-in rules for C++ compilation now use the variables `$(CXX)' and
|
||||||
|
`$(CXXFLAGS)' instead of `$(C++)' and `$(C++FLAGS)'. The old names had
|
||||||
|
problems with shells that cannot have `+' in environment variable names.
|
||||||
|
|
||||||
|
* The value of a recursively expanded variable is now expanded when putting
|
||||||
|
it into the environment for child processes. This change was made for
|
||||||
|
compatibility with Unix make.
|
||||||
|
|
||||||
|
* A rule with no targets before the `:' is now accepted and ignored.
|
||||||
|
This change was made for compatibility with SunOS 4 make.
|
||||||
|
We do not recommend that you write your makefiles to take advantage of this.
|
||||||
|
|
||||||
|
* The `-I' switch can now be used in MAKEFLAGS, and are put there
|
||||||
|
automatically just like other switches.
|
||||||
|
|
||||||
|
Version 3.61
|
||||||
|
|
||||||
|
* Built-in rules for C++ source files with the `.C' suffix.
|
||||||
|
We still recommend that you use `.cc' instead.
|
||||||
|
|
||||||
|
* If commands are given too many times for a single target,
|
||||||
|
the last set given is used, and a warning message is printed.
|
||||||
|
|
||||||
|
* Error messages about makefiles are in standard GNU error format,
|
||||||
|
so C-x ` in Emacs works on them.
|
||||||
|
|
||||||
|
* Dependencies of pattern rules which contain no % need not actually exist
|
||||||
|
if they can be created (just like dependencies which do have a %).
|
||||||
|
|
||||||
|
Version 3.60
|
||||||
|
|
||||||
|
* A message is always printed when Make decides there is nothing to be done.
|
||||||
|
It used to be that no message was printed for top-level phony targets
|
||||||
|
(because "`phony' is up to date" isn't quite right). Now a different
|
||||||
|
message "Nothing to be done for `phony'" is printed in that case.
|
||||||
|
|
||||||
|
* Archives on AIX now supposedly work.
|
||||||
|
|
||||||
|
* When the commands specified for .DEFAULT are used to update a target,
|
||||||
|
the $< automatic variable is given the same value as $@ for that target.
|
||||||
|
This is how Unix make behaves, and this behavior is mandated by POSIX.2.
|
||||||
|
|
||||||
|
Version 3.59
|
||||||
|
|
||||||
|
* The -n, -q, and -t options are not put in the `MAKEFLAGS' and `MFLAG'
|
||||||
|
variables while remaking makefiles, so recursive makes done while remaking
|
||||||
|
makefiles will behave properly.
|
||||||
|
|
||||||
|
* If the special target `.NOEXPORT' is specified in a makefile,
|
||||||
|
only variables that came from the environment and variables
|
||||||
|
defined on the command line are exported.
|
||||||
|
|
||||||
|
Version 3.58
|
||||||
|
|
||||||
|
* Suffix rules may have dependencies (which are ignored).
|
||||||
|
|
||||||
|
Version 3.57
|
||||||
|
|
||||||
|
* Dependencies of the form `-lLIB' are searched for as /usr/local/lib/libLIB.a
|
||||||
|
as well as libLIB.a in /usr/lib, /lib, the current directory, and VPATH.
|
||||||
|
|
||||||
|
Version 3.55
|
||||||
|
|
||||||
|
* There is now a Unix man page for GNU Make. It is certainly not a replacement
|
||||||
|
for the Texinfo manual, but it documents the basic functionality and the
|
||||||
|
switches. For full documentation, you should still read the Texinfo manual.
|
||||||
|
Thanks to Dennis Morse of Stanford University for contributing the initial
|
||||||
|
version of this.
|
||||||
|
|
||||||
|
* Variables which are defined by default (e.g., `CC') will no longer be put
|
||||||
|
into the environment for child processes. (If these variables are reset by the
|
||||||
|
environment, makefiles, or the command line, they will still go into the
|
||||||
|
environment.)
|
||||||
|
|
||||||
|
* Makefiles which have commands but no dependencies (and thus are always
|
||||||
|
considered out of date and in need of remaking), will not be remade (if they
|
||||||
|
were being remade only because they were makefiles). This means that GNU
|
||||||
|
Make will no longer go into an infinite loop when fed the makefiles that
|
||||||
|
`imake' (necessary to build X Windows) produces.
|
||||||
|
|
||||||
|
* There is no longer a warning for using the `vpath' directive with an explicit
|
||||||
|
pathname (instead of a `%' pattern).
|
||||||
|
|
||||||
|
Version 3.51
|
||||||
|
|
||||||
|
* When removing intermediate files, only one `rm' command line is printed,
|
||||||
|
listing all file names.
|
||||||
|
|
||||||
|
* There are now automatic variables `$(^D)', `$(^F)', `$(?D)', and `$(?F)'.
|
||||||
|
These are the directory-only and file-only versions of `$^' and `$?'.
|
||||||
|
|
||||||
|
* Library dependencies given as `-lNAME' will use "libNAME.a" in the current
|
||||||
|
directory if it exists.
|
||||||
|
|
||||||
|
* The automatic variable `$($/)' is no longer defined.
|
||||||
|
|
||||||
|
* Leading `+' characters on a command line make that line be executed even
|
||||||
|
under -n, -t, or -q (as if the line contained `$(MAKE)').
|
||||||
|
|
||||||
|
* For command lines containing `$(MAKE)', `${MAKE}', or leading `+' characters,
|
||||||
|
only those lines are executed, not their entire rules.
|
||||||
|
(This is how Unix make behaves for lines containing `$(MAKE)' or `${MAKE}'.)
|
||||||
|
|
||||||
|
Version 3.50
|
||||||
|
|
||||||
|
* Filenames in rules will now have ~ and ~USER expanded.
|
||||||
|
|
||||||
|
* The `-p' output has been changed so it can be used as a makefile.
|
||||||
|
(All information that isn't specified by makefiles is prefaced with comment
|
||||||
|
characters.)
|
||||||
|
|
||||||
|
Version 3.49
|
||||||
|
|
||||||
|
* The % character can be quoted with backslash in implicit pattern rules,
|
||||||
|
static pattern rules, `vpath' directives, and `patsubst', `filter', and
|
||||||
|
`filter-out' functions. A warning is issued if a `vpath' directive's
|
||||||
|
pattern contains no %.
|
||||||
|
|
||||||
|
* The `wildcard' variable expansion function now expands ~ and ~USER.
|
||||||
|
|
||||||
|
* Messages indicating failed commands now contain the target name:
|
||||||
|
make: *** [target] Error 1
|
||||||
|
|
||||||
|
* The `-p' output format has been changed somewhat to look more like
|
||||||
|
makefile rules and to give all information that Make has about files.
|
||||||
|
|
||||||
|
Version 3.48
|
||||||
|
|
||||||
|
Version 3.47
|
||||||
|
|
||||||
|
* The `-l' switch with no argument removes any previous load-average limit.
|
||||||
|
|
||||||
|
* When the `-w' switch is in effect, and Make has updated makefiles,
|
||||||
|
it will write a `Leaving directory' messagfe before re-executing itself.
|
||||||
|
This makes the `directory change tracking' changes to Emacs's compilation
|
||||||
|
commands work properly.
|
||||||
|
|
||||||
|
Version 3.46
|
||||||
|
|
||||||
|
* The automatic variable `$*' is now defined for explicit rules,
|
||||||
|
as it is in Unix make.
|
||||||
|
|
||||||
|
Version 3.45
|
||||||
|
|
||||||
|
* The `-j' switch is now put in the MAKEFLAGS and MFLAGS variables when
|
||||||
|
specified without an argument (indicating infinite jobs).
|
||||||
|
The `-l' switch is not always put in the MAKEFLAGS and MFLAGS variables.
|
||||||
|
|
||||||
|
* Make no longer checks hashed directories after running commands.
|
||||||
|
The behavior implemented in 3.41 caused too much slowdown.
|
||||||
|
|
||||||
|
Version 3.44
|
||||||
|
|
||||||
|
* A dependency is NOT considered newer than its dependent if
|
||||||
|
they have the same modification time. The behavior implemented
|
||||||
|
in 3.43 conflicts with RCS.
|
||||||
|
|
||||||
|
Version 3.43
|
||||||
|
|
||||||
|
* Dependency loops are no longer fatal errors.
|
||||||
|
|
||||||
|
* A dependency is considered newer than its dependent if
|
||||||
|
they have the same modification time.
|
||||||
|
|
||||||
|
Version 3.42
|
||||||
|
|
||||||
|
* The variables F77 and F77FLAGS are now set by default to $(FC) and
|
||||||
|
$(FFLAGS). Makefiles designed for System V make may use these variables in
|
||||||
|
explicit rules and expect them to be set. Unfortunately, there is no way to
|
||||||
|
make setting these affect the Fortran implicit rules unless FC and FFLAGS
|
||||||
|
are not used (and these are used by BSD make).
|
||||||
|
|
||||||
|
Version 3.41
|
||||||
|
|
||||||
|
* Make now checks to see if its hashed directories are changed by commands.
|
||||||
|
Other makes that hash directories (Sun, 4.3 BSD) don't do this.
|
||||||
|
|
||||||
|
Version 3.39
|
||||||
|
|
||||||
|
* The `shell' function no longer captures standard error output.
|
||||||
|
|
||||||
|
Version 3.32
|
||||||
|
|
||||||
|
* A file beginning with a dot can be the default target if it also contains
|
||||||
|
a slash (e.g., `../bin/foo'). (Unix make allows this as well.)
|
||||||
|
|
||||||
|
Version 3.31
|
||||||
|
|
||||||
|
* Archive member names are truncated to 15 characters.
|
||||||
|
|
||||||
|
* Yet more USG stuff.
|
||||||
|
|
||||||
|
* Minimal support for Microport System V (a 16-bit machine and a
|
||||||
|
brain-damaged compiler). This has even lower priority than other USG
|
||||||
|
support, so if it gets beyond trivial, I will take it out completely.
|
||||||
|
|
||||||
|
* Revamped default implicit rules (not much visible change).
|
||||||
|
|
||||||
|
* The -d and -p options can come from the environment.
|
||||||
|
|
||||||
|
Version 3.30
|
||||||
|
|
||||||
|
* Improved support for USG and HPUX (hopefully).
|
||||||
|
|
||||||
|
* A variable reference like `$(foo:a=b)', if `a' contains a `%', is
|
||||||
|
equivalent to `$(patsubst a,b,$(foo))'.
|
||||||
|
|
||||||
|
* Defining .DEFAULT with no deps or commands clears its commands.
|
||||||
|
|
||||||
|
* New default implicit rules for .S (cpp, then as), and .sh (copy and make
|
||||||
|
executable). All default implicit rules that use cpp (even indirectly), use
|
||||||
|
$(CPPFLAGS).
|
||||||
|
|
||||||
|
Version 3.29
|
||||||
|
|
||||||
|
* Giving the -j option with no arguments gives you infinite jobs.
|
||||||
|
|
||||||
|
Version 3.28
|
||||||
|
|
||||||
|
* New option: "-l LOAD" says not to start any new jobs while others are
|
||||||
|
running if the load average is not below LOAD (a floating-point number).
|
||||||
|
|
||||||
|
* There is support in place for implementations of remote command execution
|
||||||
|
in Make. See the file remote.c.
|
||||||
|
|
||||||
|
Version 3.26
|
||||||
|
|
||||||
|
* No more than 10 directories will be kept open at once.
|
||||||
|
(This number can be changed by redefining MAX_OPEN_DIRECTORIES in dir.c.)
|
||||||
|
|
||||||
|
Version 3.25
|
||||||
|
|
||||||
|
* Archive files will have their modification times recorded before doing
|
||||||
|
anything that might change their modification times by updating an archive
|
||||||
|
member.
|
||||||
|
|
||||||
|
Version 3.20
|
||||||
|
|
||||||
|
* The `MAKELEVEL' variable is defined for use by makefiles.
|
||||||
|
|
||||||
|
Version 3.19
|
||||||
|
|
||||||
|
* The recursion level indications in error messages are much shorter than
|
||||||
|
they were in version 3.14.
|
||||||
|
|
||||||
|
Version 3.18
|
||||||
|
|
||||||
|
* Leading spaces before directives are ignored (as documented).
|
||||||
|
|
||||||
|
* Included makefiles can determine the default goal target.
|
||||||
|
(System V Make does it this way, so we are being compatible).
|
||||||
|
|
||||||
|
Version 3.14.
|
||||||
|
|
||||||
|
* Variables that are defaults built into Make will not be put in the
|
||||||
|
environment for children. This just saves some environment space and,
|
||||||
|
except under -e, will be transparent to sub-makes.
|
||||||
|
|
||||||
|
* Error messages from sub-makes will indicate the level of recursion.
|
||||||
|
|
||||||
|
* Hopefully some speed-up for large directories due to a change in the
|
||||||
|
directory hashing scheme.
|
||||||
|
|
||||||
|
* One child will always get a standard input that is usable.
|
||||||
|
|
||||||
|
* Default makefiles that don't exist will be remade and read in.
|
||||||
|
|
||||||
|
Version 3.13.
|
||||||
|
|
||||||
|
* Count parentheses inside expansion function calls so you can
|
||||||
|
have nested calls: `$(sort $(foreach x,a b,$(x)))'.
|
||||||
|
|
||||||
|
Version 3.12.
|
||||||
|
|
||||||
|
* Several bug fixes, including USG and Sun386i support.
|
||||||
|
|
||||||
|
* `shell' function to expand shell commands a la `
|
||||||
|
|
||||||
|
* If the `-d' flag is given, version information will be printed.
|
||||||
|
|
||||||
|
* The `-c' option has been renamed to `-C' for compatibility with tar.
|
||||||
|
|
||||||
|
* The `-p' option no longer inhibits other normal operation.
|
||||||
|
|
||||||
|
* Makefiles will be updated and re-read if necessary.
|
||||||
|
|
||||||
|
* Can now run several commands at once (parallelism), -j option.
|
||||||
|
|
||||||
|
* Error messages will contain the level of Make recursion, if any.
|
||||||
|
|
||||||
|
* The `MAKEFLAGS' and `MFLAGS' variables will be scanned for options after
|
||||||
|
makefiles are read.
|
||||||
|
|
||||||
|
* A double-colon rule with no dependencies will always have its commands run.
|
||||||
|
(This is how both the BSD and System V versions of Make do it.)
|
||||||
|
|
||||||
|
Version 3.05
|
||||||
|
|
||||||
|
(Changes from versions 1 through 3.05 were never recorded. Sorry.)
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
Copyright information:
|
||||||
|
|
||||||
|
Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Permission is granted to anyone to make or distribute verbatim copies
|
||||||
|
of this document as received, in any medium, provided that the
|
||||||
|
copyright notice and this permission notice are preserved,
|
||||||
|
thus giving the recipient permission to redistribute in turn.
|
||||||
|
|
||||||
|
Permission is granted to distribute modified versions
|
||||||
|
of this document, or of portions of it,
|
||||||
|
under the above conditions, provided also that they
|
||||||
|
carry prominent notices stating who last changed them.
|
||||||
|
|
||||||
|
Local variables:
|
||||||
|
version-control: never
|
||||||
|
end:
|
||||||
141
NMakefile.template
Normal file
141
NMakefile.template
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
# NOTE: If you have no `make' program at all to process this makefile, run
|
||||||
|
# `build_w32.bat' instead.
|
||||||
|
#
|
||||||
|
# Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
|
# This file is part of GNU Make.
|
||||||
|
#
|
||||||
|
# GNU Make 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 2, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# GNU Make 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 GNU Make; see the file COPYING. If not, write to
|
||||||
|
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
|
#
|
||||||
|
# NMakefile for GNU Make
|
||||||
|
#
|
||||||
|
|
||||||
|
LINK = link
|
||||||
|
CC = cl
|
||||||
|
|
||||||
|
OUTDIR=.
|
||||||
|
MAKEFILE=NMakefile
|
||||||
|
SUBPROC_MAKEFILE=NMakefile
|
||||||
|
|
||||||
|
CFLAGS_any = /nologo /MT /W3 /GX /Zi /YX /I . /I glob /I w32/include /D WIN32 /D WINDOWS32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES
|
||||||
|
CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug/make.pch /Fo.\WinDebug/ /Fd.\WinDebug/make.pdb
|
||||||
|
CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
|
||||||
|
|
||||||
|
LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
||||||
|
/INCREMENTAL:no /PDB:WinDebug/make.pdb /MACHINE:I386 \
|
||||||
|
/OUT:WinDebug/make.exe /DEBUG
|
||||||
|
LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
||||||
|
/INCREMENTAL:no /MACHINE:I386 /OUT:WinRel/make.exe
|
||||||
|
|
||||||
|
all: config.h subproc Release Debug
|
||||||
|
|
||||||
|
#
|
||||||
|
# Make sure we build the subproc library first. It has it's own
|
||||||
|
# makefile. To be portable to Windows 95, we put the instructions
|
||||||
|
# on how to build the library into a batch file. On NT, we could
|
||||||
|
# simply have done foo && bar && dog, but this doesn't port.
|
||||||
|
#
|
||||||
|
subproc: w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib
|
||||||
|
|
||||||
|
w32/subproc/WinDebug/subproc.lib w32/subproc/WinRel/subproc.lib:
|
||||||
|
subproc.bat $(SUBPROC_MAKEFILE)
|
||||||
|
|
||||||
|
config.h: config.h.W32
|
||||||
|
copy $? $@
|
||||||
|
|
||||||
|
Release:
|
||||||
|
nmake /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_release)" CFLAGS="$(CFLAGS_release)" OUTDIR=WinRel WinRel/make.exe
|
||||||
|
Debug:
|
||||||
|
nmake /f $(MAKEFILE) LDFLAGS="$(LDFLAGS_debug)" CFLAGS="$(CFLAGS_debug)" OUTDIR=WinDebug WinDebug/make.exe
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rmdir /s /q WinDebug WinRel
|
||||||
|
rmdir /s /q w32\subproc\WinDebug w32\subproc\WinRel
|
||||||
|
erase config.h
|
||||||
|
|
||||||
|
$(OUTDIR):
|
||||||
|
if not exist .\$@\nul mkdir .\$@
|
||||||
|
|
||||||
|
LIBS = kernel32.lib user32.lib advapi32.lib
|
||||||
|
|
||||||
|
OBJS = \
|
||||||
|
$(OUTDIR)/ar.obj \
|
||||||
|
$(OUTDIR)/arscan.obj \
|
||||||
|
$(OUTDIR)/commands.obj \
|
||||||
|
$(OUTDIR)/default.obj \
|
||||||
|
$(OUTDIR)/dir.obj \
|
||||||
|
$(OUTDIR)/expand.obj \
|
||||||
|
$(OUTDIR)/file.obj \
|
||||||
|
$(OUTDIR)/function.obj \
|
||||||
|
$(OUTDIR)/getloadavg.obj \
|
||||||
|
$(OUTDIR)/getopt.obj \
|
||||||
|
$(OUTDIR)/getopt1.obj \
|
||||||
|
$(OUTDIR)/implicit.obj \
|
||||||
|
$(OUTDIR)/job.obj \
|
||||||
|
$(OUTDIR)/main.obj \
|
||||||
|
$(OUTDIR)/misc.obj \
|
||||||
|
$(OUTDIR)/read.obj \
|
||||||
|
$(OUTDIR)/remake.obj \
|
||||||
|
$(OUTDIR)/remote-stub.obj \
|
||||||
|
$(OUTDIR)/rule.obj \
|
||||||
|
$(OUTDIR)/signame.obj \
|
||||||
|
$(OUTDIR)/variable.obj \
|
||||||
|
$(OUTDIR)/version.obj \
|
||||||
|
$(OUTDIR)/vpath.obj \
|
||||||
|
$(OUTDIR)/glob.obj \
|
||||||
|
$(OUTDIR)/fnmatch.obj \
|
||||||
|
$(OUTDIR)/dirent.obj \
|
||||||
|
$(OUTDIR)/pathstuff.obj
|
||||||
|
|
||||||
|
$(OUTDIR)/make.exe: $(OUTDIR) $(OBJS)
|
||||||
|
$(LINK) @<<
|
||||||
|
$(LDFLAGS) $(LIBS) $(OBJS)
|
||||||
|
<<
|
||||||
|
|
||||||
|
.c{$(OUTDIR)}.obj:
|
||||||
|
$(CC) $(CFLAGS) /c $<
|
||||||
|
|
||||||
|
$(OUTDIR)/ar.obj : ar.c make.h filedef.h dep.h
|
||||||
|
$(OUTDIR)/arscan.obj : arscan.c make.h
|
||||||
|
$(OUTDIR)/commands.obj : commands.c
|
||||||
|
$(OUTDIR)/default.obj : default.c make.h rule.h dep.h filedef.h job.h commands.h variable.h
|
||||||
|
$(OUTDIR)/dir.obj : dir.c make.h
|
||||||
|
$(OUTDIR)/expand.obj : expand.c make.h filedef.h job.h commands.h variable.h
|
||||||
|
$(OUTDIR)/file.obj : file.c make.h dep.h filedef.h job.h commands.h variable.h
|
||||||
|
$(OUTDIR)/function.obj : function.c make.h filedef.h variable.h dep.h job.h commands.h
|
||||||
|
$(OUTDIR)/getloadavg.obj : getloadavg.c
|
||||||
|
$(OUTDIR)/getopt.obj : getopt.c
|
||||||
|
$(OUTDIR)/getopt1.obj : getopt1.c getopt.h
|
||||||
|
$(OUTDIR)/implicit.obj : implicit.c make.h rule.h dep.h filedef.h
|
||||||
|
$(OUTDIR)/job.obj : job.c make.h job.h filedef.h commands.h variable.h
|
||||||
|
$(OUTDIR)/main.obj : main.c make.h dep.h filedef.h variable.h job.h commands.h getopt.h
|
||||||
|
$(OUTDIR)/misc.obj : misc.c make.h dep.h
|
||||||
|
$(OUTDIR)/read.obj : read.c make.h dep.h filedef.h job.h commands.h variable.h glob/glob.h
|
||||||
|
$(OUTDIR)/remake.obj : remake.c make.h filedef.h job.h commands.h dep.h
|
||||||
|
$(OUTDIR)/remote-stub.obj : remote-stub.c make.h filedef.h job.h commands.h
|
||||||
|
$(OUTDIR)/rule.obj : rule.c make.h dep.h filedef.h job.h commands.h variable.h rule.h
|
||||||
|
$(OUTDIR)/signame.obj : signame.c signame.h
|
||||||
|
$(OUTDIR)/variable.obj : variable.c make.h dep.h filedef.h job.h commands.h variable.h
|
||||||
|
$(OUTDIR)/version.obj : version.c
|
||||||
|
$(OUTDIR)/vpath.obj : vpath.c make.h filedef.h variable.h
|
||||||
|
$(OUTDIR)/glob.obj : glob/glob.c
|
||||||
|
$(CC) $(CFLAGS) /c $?
|
||||||
|
$(OUTDIR)/fnmatch.obj : glob/fnmatch.c
|
||||||
|
$(CC) $(CFLAGS) /c $?
|
||||||
|
$(OUTDIR)/dirent.obj : w32/compat/dirent.c
|
||||||
|
$(CC) $(CFLAGS) /c $?
|
||||||
|
$(OUTDIR)/pathstuff.obj : w32/pathstuff.c
|
||||||
|
$(CC) $(CFLAGS) /c $?
|
||||||
|
|
||||||
61
README.Amiga
Normal file
61
README.Amiga
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
Short: Port of GNU make with SAS/C (no ixemul.library required)
|
||||||
|
Author: GNU, Amiga port by Aaron "Optimizer" Digulla
|
||||||
|
Uploader: Aaron "Optimizer" Digulla (digulla@fh-konstanz.de)
|
||||||
|
Type: dev/c
|
||||||
|
|
||||||
|
This is a pure Amiga port of GNU make. It needs no extra libraries or
|
||||||
|
anything. It has the following features (in addition to any features of
|
||||||
|
GNU make):
|
||||||
|
|
||||||
|
- Runs Amiga-Commands with SystemTags() (Execute)
|
||||||
|
- Can run multi-line statements
|
||||||
|
- Allows to use Device-Names in targets:
|
||||||
|
|
||||||
|
c:make : make.o
|
||||||
|
|
||||||
|
is ok. To distinguish between device-names and target : or ::, MAKE
|
||||||
|
looks for spaces. If there are any around :, it's taken as a target
|
||||||
|
delimiter, if there are none, it's taken as the name of a device. Note
|
||||||
|
that "make:make.o" tries to create "make.o" on the device "make:".
|
||||||
|
- Replaces @@ by a newline in any command line:
|
||||||
|
|
||||||
|
if exists make @@\
|
||||||
|
delete make.bak quiet @@\
|
||||||
|
rename make make.bak @@\
|
||||||
|
endif @@\
|
||||||
|
$(CC) Link Make.o To make
|
||||||
|
|
||||||
|
works. Note that the @@ must stand alone (ie. "make@@\" is illegal).
|
||||||
|
Also be carefull that there is a space after the "\" (ie, at the
|
||||||
|
beginning of the next line).
|
||||||
|
- Can be made resident to save space and time
|
||||||
|
- Amiga specific wildcards can be used in $(wildcard ...)
|
||||||
|
|
||||||
|
BUGS:
|
||||||
|
- The line
|
||||||
|
|
||||||
|
dummy.h : src/*.c
|
||||||
|
|
||||||
|
tries to make dummy.h from "src/*.c" (ie. no wildcard-expansion takes
|
||||||
|
place). You have to use "$(wildcard src/*.c)" instead.
|
||||||
|
|
||||||
|
COMPILING FROM SCRATCH
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
To recompile, you need SAS/C 6.51. make itself is not neccessary, there
|
||||||
|
is an smakefile.
|
||||||
|
|
||||||
|
1. Copy config.ami to config.h
|
||||||
|
2. If you use make to compie, copy Makefile.ami to Makefile and
|
||||||
|
glob/Makefile.ami to glob/Makefile. Copy make into the current
|
||||||
|
directory.
|
||||||
|
|
||||||
|
3. Run smake/make
|
||||||
|
|
||||||
|
INSTALLATION
|
||||||
|
|
||||||
|
Copy make somewhere in your search path (eg. sc:c or sc:bin).
|
||||||
|
If you plan to use recursive makes, install make resident:
|
||||||
|
|
||||||
|
Resident make Add
|
||||||
|
|
||||||
293
README.DOS.template
Normal file
293
README.DOS.template
Normal file
@@ -0,0 +1,293 @@
|
|||||||
|
Port of GNU Make to 32-bit protected mode on MSDOS and MS-Windows.
|
||||||
|
|
||||||
|
Builds with DJGPP v2 port of GNU C/C++ compiler and utilities.
|
||||||
|
|
||||||
|
|
||||||
|
New (since 3.74) DOS-specific features:
|
||||||
|
|
||||||
|
1. Supports long filenames when run from DOS box on Windows 95.
|
||||||
|
|
||||||
|
2. Supports both stock DOS COMMAND.COM and Unix-style shells
|
||||||
|
(details in ``Notes'' below).
|
||||||
|
|
||||||
|
3. Supports DOS drive letters in dependencies and pattern rules.
|
||||||
|
|
||||||
|
4. Better support for DOS-style backslashes in pathnames (but see
|
||||||
|
``Notes'' below).
|
||||||
|
|
||||||
|
5. The $(shell) built-in can run arbitrary complex commands,
|
||||||
|
including pipes and redirection, even when COMMAND.COM is your
|
||||||
|
shell.
|
||||||
|
|
||||||
|
6. Can be built without floating-point code (see below).
|
||||||
|
|
||||||
|
7. Supports signals in child programs and restores the original
|
||||||
|
directory if the child was interrupted.
|
||||||
|
|
||||||
|
8. Can be built without (a previous version of) Make.
|
||||||
|
|
||||||
|
9. The build process requires only standard tools. (Optional
|
||||||
|
targets like "install:" and "clean:" still need additional
|
||||||
|
programs, though, see below.)
|
||||||
|
|
||||||
|
|
||||||
|
To build:
|
||||||
|
|
||||||
|
1. Unzip the archive, preserving the directory structure (-d switch
|
||||||
|
if you use PKUNZIP). If you build Make on Windows 95, use an
|
||||||
|
unzip program that supports long filenames in zip files.
|
||||||
|
|
||||||
|
2. Invoke the `configure.bat' batch file.
|
||||||
|
|
||||||
|
If you are building Make in-place, i.e. in the same directory
|
||||||
|
where its sources are kept, just type "configure.bat" and press
|
||||||
|
[Enter]. Otherwise, you need to supply the path to the source
|
||||||
|
directory as an argument to the batch file, like this:
|
||||||
|
|
||||||
|
configure.bat c:/djgpp/gnu/make-3.76
|
||||||
|
|
||||||
|
Note the forward slashes: you MUST use them here.
|
||||||
|
|
||||||
|
3. If configure.bat doesn't find a working Make, it will suggest to
|
||||||
|
use the `dosbuild.bat' batch file to build Make. Either do as it
|
||||||
|
suggests or install another Make program (a pre-compiled binary
|
||||||
|
should be available from the usual DJGPP sites) and rerun
|
||||||
|
configure.bat.
|
||||||
|
|
||||||
|
4. If you will need to run Make on machines without an FPU, you
|
||||||
|
might consider building a version of Make which doesn't issue
|
||||||
|
floating-point instructions (they don't help much on MSDOS
|
||||||
|
anyway). To this end, edit the Makefile created by
|
||||||
|
configure.bat and add -DNO_FLOAT to the value of CPPFLAGS.
|
||||||
|
|
||||||
|
5. Invoke Make.
|
||||||
|
|
||||||
|
If you are building from outside of the source directory, you
|
||||||
|
need to tell Make where the sources are, like this:
|
||||||
|
|
||||||
|
make srcdir=c:/djgpp/gnu/make-3.76
|
||||||
|
|
||||||
|
(configure.bat will tell you this when it finishes). You MUST
|
||||||
|
use a full, not relative, name of the source directory here, or
|
||||||
|
else Make might fail.
|
||||||
|
|
||||||
|
6. After Make finishes, if you have a Unix-style shell installed,
|
||||||
|
you can use the `install' target to install the package. You
|
||||||
|
will also need GNU Fileutils and GNU Sh-utils for this (they
|
||||||
|
should be available from the DJGPP sites).
|
||||||
|
|
||||||
|
Without a Unix-style shell, you will have to install programs
|
||||||
|
and the docs manually. Copy make.exe to a directory on your
|
||||||
|
PATH, make.i* info files to your Info directory, and update the
|
||||||
|
file `dir' in your Info directory by adding the following item
|
||||||
|
to the main menu:
|
||||||
|
|
||||||
|
* GNU make: (make.info). The GNU make utility.
|
||||||
|
|
||||||
|
If you have the `install-info' program (from the GNU Texinfo
|
||||||
|
package), it will do that for you if you invoke it like this:
|
||||||
|
|
||||||
|
install-info --info-dir=c:/djgpp/info c:/djgpp/info/make.info
|
||||||
|
|
||||||
|
(If your Info directory is other than C:\DJGPP\INFO, change this
|
||||||
|
command accordingly.)
|
||||||
|
|
||||||
|
7. The `clean' targets also require Unix-style shell and `test' and
|
||||||
|
`rm' programs (from Fileutils and Sh-utils, accordingly).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
-----
|
||||||
|
|
||||||
|
1. The shell issue.
|
||||||
|
|
||||||
|
This is probably the most significant improvement, first
|
||||||
|
introduced in the port of GNU Make 3.75.
|
||||||
|
|
||||||
|
The original behavior of GNU Make is to invoke commands
|
||||||
|
directly, as long as they don't include characters special to
|
||||||
|
the shell or internal shell commands, because that is faster.
|
||||||
|
When shell features like redirection or filename wildcards are
|
||||||
|
involved, Make calls the shell.
|
||||||
|
|
||||||
|
This port supports both DOS shells (the stock COMMAND.COM and its
|
||||||
|
4DOS/NDOS replacements), and Unix-style shells (tested with the
|
||||||
|
venerable Stewartson's `ms_sh' 2.3 and the DJGPP port of `bash' by
|
||||||
|
Daisuke Aoyama <jack@st.rim.or.jp>).
|
||||||
|
|
||||||
|
When the $SHELL variable points to a Unix-style shell, Make
|
||||||
|
works just like you'd expect on Unix, calling the shell for any
|
||||||
|
command that involves characters special to the shell or
|
||||||
|
internal shell commands. The only difference is that, since
|
||||||
|
there is no standard way to pass command lines longer than the
|
||||||
|
infamous DOS 126-character limit, this port of Make writes the
|
||||||
|
command line to a temporary disk file and then invokes the shell
|
||||||
|
on that file.
|
||||||
|
|
||||||
|
If $SHELL points to a DOS-style shell, however, Make will not
|
||||||
|
call it automatically, as it does with Unix shells. Stock
|
||||||
|
COMMAND.COM is too dumb and would unnecessarily limit the
|
||||||
|
functionality of Make. For example, you would not be able to
|
||||||
|
use long command lines in commands that use redirection or
|
||||||
|
pipes. Therefore, when presented with a DOS shell, this port of
|
||||||
|
Make will emulate most of the shell functionality, like
|
||||||
|
redirection and pipes, and shall only call the shell when a
|
||||||
|
batch file or a command internal to the shell is invoked. (Even
|
||||||
|
when a command is an internal shell command, Make will first
|
||||||
|
search the $PATH for it, so that if a Makefile calls `mkdir',
|
||||||
|
you can install, say, a port of GNU `mkdir' and have it called
|
||||||
|
in that case.)
|
||||||
|
|
||||||
|
The key to all this is the extended functionality of `spawn' and
|
||||||
|
`system' functions from the DJGPP library; this port just calls
|
||||||
|
`system' where it would invoke the shell on Unix. The most
|
||||||
|
important aspect of these functions is that they use a special
|
||||||
|
mechanism to pass long (up to 16KB) command lines to DJGPP
|
||||||
|
programs. In addition, `system' emulates some internal
|
||||||
|
commands, like `cd' (so that you can now use forward slashes
|
||||||
|
with it, and can also change the drive if the directory is on
|
||||||
|
another drive). Another aspect worth mentioning is that you can
|
||||||
|
call Unix shell scripts directly, provided that the shell whose
|
||||||
|
name is mentioned on the first line of the script is installed
|
||||||
|
anywhere along the $PATH. It is impossible to tell here
|
||||||
|
everything about these functions; refer to the DJGPP library
|
||||||
|
reference for more details.
|
||||||
|
|
||||||
|
The $(shell) built-in is implemented in this port by calling
|
||||||
|
`popen'. Since `popen' calls `system', the above considerations
|
||||||
|
are valid for $(shell) as well. In particular, you can put
|
||||||
|
arbitrary complex commands, including pipes and redirection,
|
||||||
|
inside $(shell), which is in many cases a valid substitute for
|
||||||
|
the Unix-style command substitution (`command`) feature.
|
||||||
|
|
||||||
|
|
||||||
|
2. "SHELL=/bin/sh" -- or is it?
|
||||||
|
|
||||||
|
Many Unix Makefiles include a line which sets the SHELL, for
|
||||||
|
those versions of Make which don't have this as the default.
|
||||||
|
Since many DOS systems don't have `sh' installed (in fact, most
|
||||||
|
of them don't even have a `/bin' directory), this port takes
|
||||||
|
such directives with a grain of salt. It will only honor such a
|
||||||
|
directive if the basename of the shell name (like `sh' in the
|
||||||
|
above example) can indeed be found in the directory that is
|
||||||
|
mentioned in the SHELL= line (`/bin' in the above example), or
|
||||||
|
in the current working directory, or anywhere on the $PATH (in
|
||||||
|
that order). If the basename doesn't include a filename
|
||||||
|
extension, Make will look for any known extension that indicates
|
||||||
|
an executable file (.exe, .com, .bat, .btm, .sh, and even .sed
|
||||||
|
and .pl). If any such file is found, then $SHELL will be
|
||||||
|
defined to the exact pathname of that file, and that shell will
|
||||||
|
hence be used for the rest of processing. But if the named
|
||||||
|
shell is *not* found, the line which sets it will be effectively
|
||||||
|
ignored, leaving the value of $SHELL as it was before. Since a
|
||||||
|
lot of decisions that this port makes depend on the gender of
|
||||||
|
the shell, I feel it doesn't make any sense to tailor Make's
|
||||||
|
behavior to a shell which is nowhere to be found.
|
||||||
|
|
||||||
|
Note that the above special handling of "SHELL=" only happens
|
||||||
|
for Makefiles; if you set $SHELL in the environment or on the
|
||||||
|
Make command line, you are expected to give the complete
|
||||||
|
pathname of the shell, including the filename extension.
|
||||||
|
|
||||||
|
The default value of $SHELL is computed as on Unix (see the Make
|
||||||
|
manual for details), except that if $SHELL is not defined in the
|
||||||
|
environment, $COMSPEC is used. Also, if an environment variable
|
||||||
|
named $MAKESHELL is defined, it takes precedence over both
|
||||||
|
$COMSPEC and $SHELL. Note that, unlike Unix, $SHELL in the
|
||||||
|
environment *is* used to set the shell (since on MSDOS, it's
|
||||||
|
unlikely that the interactive shell will not be suitable for
|
||||||
|
Makefile processing).
|
||||||
|
|
||||||
|
The bottom line is that you can now write Makefiles where some
|
||||||
|
of the targets require a real (i.e. Unix-like) shell, which will
|
||||||
|
nevertheless work when such shell is not available (provided, of
|
||||||
|
course, that the commands which should always work, don't
|
||||||
|
require such a shell). More important, you can convert Unix
|
||||||
|
Makefiles to MSDOS and leave the line which sets the shell
|
||||||
|
intact, so that people who do have Unixy shell could use it for
|
||||||
|
targets which aren't converted to DOS (like `install' and
|
||||||
|
`uninstall', for example).
|
||||||
|
|
||||||
|
|
||||||
|
3. Default directories.
|
||||||
|
|
||||||
|
GNU Make knows about standard directories where it searches for
|
||||||
|
library and include files mentioned in the Makefile. Since
|
||||||
|
MSDOS machines don't have standard places for these, this port
|
||||||
|
will search ${DJDIR}/lib and ${DJDIR}/include respectively.
|
||||||
|
$DJDIR is defined automatically by the DJGPP startup code as the
|
||||||
|
root of the DJGPP installation tree (unless you've tampered with
|
||||||
|
the DJGPP.ENV file). This should provide reasonable default
|
||||||
|
values, unless you moved parts of DJGPP to other directories.
|
||||||
|
|
||||||
|
|
||||||
|
4. Letter-case in filenames.
|
||||||
|
|
||||||
|
If you run Make on Windows 95, you should be aware of the
|
||||||
|
letter-case issue. Make is internally case-sensitive, but all
|
||||||
|
file operations are case-insensitive on Windows 95, so
|
||||||
|
e.g. files `FAQ', `faq' and `Faq' all refer to the same file, as
|
||||||
|
far as Windows is concerned. The underlying DJGPP C library
|
||||||
|
functions honor the letter-case of the filenames they get from
|
||||||
|
the OS, except that by default, they down-case 8+3 DOS filenames
|
||||||
|
which are stored in upper case in the directory and would break
|
||||||
|
many Makefiles otherwise. (The details of which filenames are
|
||||||
|
converted to lower case are explained in the DJGPP libc docs,
|
||||||
|
under the `_preserve_fncase' and `_lfn_gen_short_fname'
|
||||||
|
functions, but as a thumb rule, any filename that is stored in
|
||||||
|
upper case in the directory, is a legal DOS 8+3 filename and
|
||||||
|
doesn't include characters illegal on MSDOS FAT filesystems,
|
||||||
|
will be automatically down-cased.) User reports that I have
|
||||||
|
indicate that this default behavior is generally what you'd
|
||||||
|
expect; however, since support for long filenames in the DJGPP
|
||||||
|
port of GNU Make is relatively new, your input is most welcome.
|
||||||
|
|
||||||
|
In any case, if you hit a situation where you must force Make to
|
||||||
|
get the 8+3 DOS filenames in upper case, set FNCASE=y in the
|
||||||
|
environment or in the Makefile.
|
||||||
|
|
||||||
|
|
||||||
|
5. DOS-style pathnames.
|
||||||
|
|
||||||
|
There are a lot of places throughout the program sources which
|
||||||
|
make implicit assumptions about the pathname syntax. In
|
||||||
|
particular, the directories are assumed to be separated by `/',
|
||||||
|
and any pathname which doesn't begin with a `/' is assumed to be
|
||||||
|
relative to the current directory. This port attempts to
|
||||||
|
support DOS-style pathnames which might include the drive letter
|
||||||
|
and use backslashes instead of forward slashes. However, this
|
||||||
|
support is not complete; I feel that pursuing this support too
|
||||||
|
far might break some more important features, particularly if
|
||||||
|
you use a Unix-style shell (where a backslash is a quote
|
||||||
|
character). I only consider support of backslashes desirable
|
||||||
|
because some Makefiles invoke non-DJGPP programs which don't
|
||||||
|
understand forward slashes. A notable example of such programs
|
||||||
|
is the standard programs which come with MSDOS. Otherwise, you
|
||||||
|
are advised to stay away from backslashes whenever possible. In
|
||||||
|
particular, filename globbing won't work on pathnames with
|
||||||
|
backslashes, because the GNU `glob' library doesn't support them
|
||||||
|
(backslash is special in filename wildcards, and I didn't want
|
||||||
|
to break that).
|
||||||
|
|
||||||
|
One feature which *does* work with backslashes is the filename-
|
||||||
|
related built-in functions such as $(dir), $(notdir), etc.
|
||||||
|
Drive letters in pathnames are also fully supported.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Bug reports:
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Bugs that are clearly related to the MSDOS/DJGPP port should be
|
||||||
|
reported first on the comp.os.msdos.djgpp news group (if you cannot
|
||||||
|
post to Usenet groups, write to the DJGPP mailing list,
|
||||||
|
<djgpp@delorie.com>, which is an email gateway into the above news
|
||||||
|
group). For other bugs, please follow the the procedure explained
|
||||||
|
in the "Bugs" chapter of the Info docs. If you don't have an Info
|
||||||
|
reader, look up that chapter in the `make.i1' file with any text
|
||||||
|
browser/editor.
|
||||||
|
|
||||||
|
|
||||||
|
Enjoy,
|
||||||
|
Eli Zaretskii <eliz@is.elta.co.il>
|
||||||
161
README.W32
Normal file
161
README.W32
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
Port of GNU make to Windows NT and Windows 95
|
||||||
|
Builds natively with MSVC 2.x or MSVC 4.x compilers.
|
||||||
|
|
||||||
|
To build with nmake on Windows NT or Windows 95:
|
||||||
|
|
||||||
|
1. Make sure cl.exe is in your %Path%. Example:
|
||||||
|
|
||||||
|
set Path=%Path%;c:/msdev/bin
|
||||||
|
|
||||||
|
2. Make sure %include% is set to msvc include directory. Example:
|
||||||
|
|
||||||
|
set include=c:/msdev/include
|
||||||
|
|
||||||
|
3. Make sure %lib% is set to msvc lib directory. Example:
|
||||||
|
|
||||||
|
set lib=c:/msdev/lib
|
||||||
|
|
||||||
|
4. nmake /f NMakefile
|
||||||
|
|
||||||
|
|
||||||
|
There is a bat file (build_w32.bat) for folks who have fear of nmake.
|
||||||
|
|
||||||
|
Outputs:
|
||||||
|
|
||||||
|
WinDebug/make.exe
|
||||||
|
WinRel/make.exe
|
||||||
|
|
||||||
|
|
||||||
|
-- Notes/Caveats --
|
||||||
|
|
||||||
|
GNU make and sh.exe:
|
||||||
|
|
||||||
|
This port prefers you have a working sh.exe somewhere on your
|
||||||
|
system. If you don't have sh.exe, port falls back to
|
||||||
|
MSDOS mode for launching programs (via a batch file).
|
||||||
|
The MSDOS mode style execution has not been tested too
|
||||||
|
carefully though (I use GNU bash as sh.exe).
|
||||||
|
|
||||||
|
There are very few true ports of Bourne shell for NT right now.
|
||||||
|
There is a version of GNU bash available from Cygnus gnu-win32
|
||||||
|
porting effort. Other possibilities are to get the MKS version
|
||||||
|
of sh.exe or to build your own with a package like
|
||||||
|
NutCracker (DataFocus) or Portage (Consensys).
|
||||||
|
|
||||||
|
Tivoli uses a homegrown port of GNU bash which is not (yet)
|
||||||
|
freely available. It may be available someday, but I am not in control
|
||||||
|
of this decision nor do I influence it. Sorry!
|
||||||
|
|
||||||
|
GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
|
||||||
|
|
||||||
|
There is a caveat that should be noted with respect to handling
|
||||||
|
single character pathnames on Windows systems. When colon is
|
||||||
|
used in PATH variables, make tries to be smart about knowing when
|
||||||
|
you are using colon as a separator versus colon as a drive
|
||||||
|
letter. Unfortunately, something as simple as the string 'x:/'
|
||||||
|
could be interpreted 2 ways: (x and /) or (x:/).
|
||||||
|
|
||||||
|
Make chooses to interpret a letter plus colon (e.g. x:/) as a
|
||||||
|
drive letter pathname. If it is necessary to use single
|
||||||
|
character directories in paths (VPATH, vpath, Path, PATH), the
|
||||||
|
user must do one of two things:
|
||||||
|
|
||||||
|
a. Use semicolon as the separator to disambiguate colon. For
|
||||||
|
example use 'x;/' if you want to say 'x' and '/' are
|
||||||
|
separate components.
|
||||||
|
|
||||||
|
b. Qualify the directory name so that there is more than
|
||||||
|
one character in the path(s) used. For example, none
|
||||||
|
of these settings are ambiguous:
|
||||||
|
|
||||||
|
./x:./y
|
||||||
|
/some/path/x:/some/path/y
|
||||||
|
x:/some/path/x:x:/some/path/y
|
||||||
|
|
||||||
|
These caveats affect Windows systems only (Windows NT and
|
||||||
|
Windows 95) and can be ignored for other platforms.
|
||||||
|
|
||||||
|
Please note that you are free to mix colon and semi-colon in the
|
||||||
|
specification of paths. Make is able to figure out the intended
|
||||||
|
result and convert the paths internally to the format needed
|
||||||
|
when interacting with the operating system.
|
||||||
|
|
||||||
|
You are encouraged to use colon as the separator character.
|
||||||
|
This should ease the pain of deciding how to handle various path
|
||||||
|
problems which exist between platforms. If colon is used on
|
||||||
|
both Unix and Windows systems, then no ifdef'ing will be
|
||||||
|
necessary in the makefile source.
|
||||||
|
|
||||||
|
GNU make test suite:
|
||||||
|
|
||||||
|
I verified all functionality with a slightly modified version
|
||||||
|
of make-test-0.4.5 (modifications to get test suite to run
|
||||||
|
on Windows NT). All tests pass in an environment that includes
|
||||||
|
sh.exe. Tested on both Windows NT and Windows 95.
|
||||||
|
|
||||||
|
Building GNU make on Windows NT and Windows 95 with Microsoft Visual C
|
||||||
|
|
||||||
|
I did not provide a Visual C project file with this port as
|
||||||
|
the project file would not be considered freely distributable
|
||||||
|
(or so I think). It is easy enough to create one though if
|
||||||
|
you know how to use Visual C.
|
||||||
|
|
||||||
|
I build the program statically to avoid problems locating DLL's
|
||||||
|
on machines that may not have MSVC runtime installed. If you
|
||||||
|
prefer, you can change make to build with shared libraries by
|
||||||
|
changing /MT to /MD in the NMakefile (or build_w32.bat).
|
||||||
|
|
||||||
|
Program has not been built under non-Intel architectures (yet).
|
||||||
|
|
||||||
|
I have not tried to build with any other compilers than MSVC.
|
||||||
|
|
||||||
|
Pathnames and white space:
|
||||||
|
|
||||||
|
Unlike Unix, Windows 95/NT systems encourage pathnames which
|
||||||
|
contain white space (e.g. C:\Program Files\). These sorts of pathnames
|
||||||
|
are legal under Unix too, but are never encouraged. There is
|
||||||
|
at least one place in make (VPATH/vpath handling) where paths
|
||||||
|
containing white space will simply not work. There may be others
|
||||||
|
too. I chose to not try and port make in such a way so that
|
||||||
|
these sorts of paths could be handled. I offer these suggestions
|
||||||
|
as workarounds:
|
||||||
|
|
||||||
|
1. Use 8.3 notation
|
||||||
|
2. Rename the directory so it does not contain white space.
|
||||||
|
|
||||||
|
If you are unhappy with this choice, this is free software
|
||||||
|
and you are free to take a crack at making this work. The code
|
||||||
|
in w32/pathstuff.c and vpath.c would be the places to start.
|
||||||
|
|
||||||
|
SAMBA/NTFS/VFAT:
|
||||||
|
|
||||||
|
I have not had any success building the debug version of this
|
||||||
|
package using SAMBA as my file server. The reason seems to be
|
||||||
|
related to the way VC++ 4.0 changes the case name of the pdb
|
||||||
|
filename it is passed on the command line. It seems to change
|
||||||
|
the name always to to lower case. I contend that
|
||||||
|
the VC++ compiler should not change the casename of files that
|
||||||
|
are passed as arguments on the command line. I don't think this
|
||||||
|
was a problem in MSVC 2.x, but I know it is a problem in MSVC 4.x.
|
||||||
|
|
||||||
|
The package builds fine on VFAT and NTFS filesystems.
|
||||||
|
|
||||||
|
Most all of the development I have done to date has been using
|
||||||
|
NTFS and long file names. I have not done any considerable work
|
||||||
|
under VFAT. VFAT users may wish to be aware that this port
|
||||||
|
of make does respect case sensitivity.
|
||||||
|
|
||||||
|
Version 3.76 contains some preliminary support for FAT. Make
|
||||||
|
now tries to work around some difficulties with stat'ing of
|
||||||
|
files and caching of filenames and directories internally.
|
||||||
|
There is still a known problem with filenames sometimes being
|
||||||
|
found to have modification dates in the future which cause make
|
||||||
|
to complain about the file and exit (remake.c).
|
||||||
|
|
||||||
|
Bug reports:
|
||||||
|
|
||||||
|
Please submit bugs via the normal bug reporting mechanism
|
||||||
|
which is described in one of the Texinfo files. If you don't
|
||||||
|
have Texinfo for Windows NT or Windows 95, these files are simple
|
||||||
|
text files and can be read with a text editor.
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
This directory contains the VERSION test release of GNU Make.
|
This directory contains the %VERSION% release of GNU Make.
|
||||||
All bugs reported for previous test releases have been fixed.
|
All bugs reported for previous releases have been fixed.
|
||||||
Some bugs surely remain.
|
Some bugs surely remain.
|
||||||
|
|
||||||
For general building and installation instructions, see the file INSTALL.
|
For general building and installation instructions, see the file INSTALL.
|
||||||
@@ -10,6 +10,21 @@ build the program, type `sh build.sh'. This should compile the program
|
|||||||
in the current directory. Then you will have a Make program that you can
|
in the current directory. Then you will have a Make program that you can
|
||||||
use for `make install', or whatever else.
|
use for `make install', or whatever else.
|
||||||
|
|
||||||
|
Some systems' Make programs are broken and cannot process the Makefile for
|
||||||
|
GNU Make. If you get errors from your system's Make when building GNU
|
||||||
|
Make, try using `build.sh' instead.
|
||||||
|
|
||||||
|
- See README.W32 for details about GNU Make on Windows NT or 95.
|
||||||
|
|
||||||
|
- See README.Amiga for details about GNU Make on AmigaDOS.
|
||||||
|
|
||||||
|
- See README.DOS for compilation instructions on MS-DOS and MS-Windows
|
||||||
|
using DJGPP tools.
|
||||||
|
|
||||||
|
A precompiled binary of the MSDOS port of GNU Make is available as part
|
||||||
|
of DJGPP; see the WWW page http://www.delorie.com/djgpp/ for more
|
||||||
|
information.
|
||||||
|
|
||||||
It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such
|
It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such
|
||||||
that if you compile make with `cc -O' on AIX 3.2, it will not work correctly.
|
that if you compile make with `cc -O' on AIX 3.2, it will not work correctly.
|
||||||
It is said that using `cc' without `-O' does work.
|
It is said that using `cc' without `-O' does work.
|
||||||
|
|||||||
13
SCOPTIONS
Normal file
13
SCOPTIONS
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
ERRORREXX
|
||||||
|
OPTIMIZE
|
||||||
|
NOVERSION
|
||||||
|
OPTIMIZERTIME
|
||||||
|
OPTIMIZERALIAS
|
||||||
|
DEFINE INCLUDEDIR="include:"
|
||||||
|
DEFINE LIBDIR="lib:"
|
||||||
|
DEFINE NO_ALLOCA
|
||||||
|
DEFINE NO_FLOAT
|
||||||
|
DEFINE NO_ARCHIVES
|
||||||
|
IGNORE=161
|
||||||
|
IGNORE=100
|
||||||
|
STARTUP=cres
|
||||||
276
SMakefile.template
Normal file
276
SMakefile.template
Normal file
@@ -0,0 +1,276 @@
|
|||||||
|
# NOTE: If you have no `make' program at all to process this makefile, run
|
||||||
|
# `build.sh' instead.
|
||||||
|
#
|
||||||
|
# Copyright (C) 1988, 89, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||||
|
# This file is part of GNU Make.
|
||||||
|
#
|
||||||
|
# GNU Make 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 2, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# GNU Make 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 GNU Make; see the file COPYING. If not, write to
|
||||||
|
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
|
#
|
||||||
|
# Makefile for GNU Make
|
||||||
|
#
|
||||||
|
|
||||||
|
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||||
|
VPATH = /make-3.74/
|
||||||
|
# This must repeat the value, because configure will remove `VPATH = .'.
|
||||||
|
srcdir = /make-3.74/
|
||||||
|
|
||||||
|
CC = sc
|
||||||
|
RM = delete
|
||||||
|
MAKE = smake
|
||||||
|
|
||||||
|
CFLAGS =
|
||||||
|
CPPFLAGS =
|
||||||
|
LDFLAGS =
|
||||||
|
|
||||||
|
# Define these for your system as follows:
|
||||||
|
# -DNO_ARCHIVES To disable `ar' archive support.
|
||||||
|
# -DNO_FLOAT To avoid using floating-point numbers.
|
||||||
|
# -DENUM_BITFIELDS If the compiler isn't GCC but groks enum foo:2.
|
||||||
|
# Some compilers apparently accept this
|
||||||
|
# without complaint but produce losing code,
|
||||||
|
# so beware.
|
||||||
|
# NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
|
||||||
|
# See also `config.h'.
|
||||||
|
defines =
|
||||||
|
|
||||||
|
# Which flavor of remote job execution support to use.
|
||||||
|
# The code is found in `remote-$(REMOTE).c'.
|
||||||
|
REMOTE = stub
|
||||||
|
|
||||||
|
# If you are using the GNU C library, or have the GNU getopt functions in
|
||||||
|
# your C library, you can comment these out.
|
||||||
|
GETOPT = getopt.o getopt1.o
|
||||||
|
GETOPT_SRC = $(srcdir)getopt.c $(srcdir)getopt1.c $(srcdir)getopt.h
|
||||||
|
|
||||||
|
# If you are using the GNU C library, or have the GNU glob functions in
|
||||||
|
# your C library, you can comment this out. GNU make uses special hooks
|
||||||
|
# into the glob functions to be more efficient (by using make's directory
|
||||||
|
# cache for globbing), so you must use the GNU functions even if your
|
||||||
|
# system's C library has the 1003.2 glob functions already. Also, the glob
|
||||||
|
# functions in the AIX and HPUX C libraries are said to be buggy.
|
||||||
|
GLOB = Lib glob/glob.lib
|
||||||
|
|
||||||
|
# If your system doesn't have alloca, or the one provided is bad, define this.
|
||||||
|
ALLOCA = alloca.o
|
||||||
|
ALLOCA_SRC = $(srcdir)alloca.c
|
||||||
|
|
||||||
|
# If your system needs extra libraries loaded in, define them here.
|
||||||
|
# System V probably need -lPW for alloca. HP-UX 7.0's alloca in
|
||||||
|
# libPW.a is broken on HP9000s300 and HP9000s400 machines. Use
|
||||||
|
# alloca.c instead on those machines.
|
||||||
|
LOADLIBES =
|
||||||
|
|
||||||
|
# Any extra object files your system needs.
|
||||||
|
extras = amiga.o
|
||||||
|
|
||||||
|
# Common prefix for machine-independent installed files.
|
||||||
|
prefix =
|
||||||
|
# Common prefix for machine-dependent installed files.
|
||||||
|
exec_prefix =
|
||||||
|
|
||||||
|
# Directory to install `make' in.
|
||||||
|
bindir = sc:c
|
||||||
|
# Directory to find libraries in for `-lXXX'.
|
||||||
|
libdir = lib:
|
||||||
|
# Directory to search by default for included makefiles.
|
||||||
|
includedir = include:
|
||||||
|
# Directory to install the Info files in.
|
||||||
|
infodir = doc:
|
||||||
|
# Directory to install the man page in.
|
||||||
|
mandir = t:
|
||||||
|
# Number to put on the man page filename.
|
||||||
|
manext = 1
|
||||||
|
# Prefix to put on installed `make' binary file name.
|
||||||
|
binprefix =
|
||||||
|
# Prefix to put on installed `make' man page file name.
|
||||||
|
manprefix = $(binprefix)
|
||||||
|
|
||||||
|
# Whether or not make needs to be installed setgid.
|
||||||
|
# The value should be either `true' or `false'.
|
||||||
|
# On many systems, the getloadavg function (used to implement the `-l'
|
||||||
|
# switch) will not work unless make is installed setgid kmem.
|
||||||
|
install_setgid = false
|
||||||
|
# Install make setgid to this group so it can read /dev/kmem.
|
||||||
|
group = sys
|
||||||
|
|
||||||
|
# Program to install `make'.
|
||||||
|
INSTALL_PROGRAM = copy
|
||||||
|
# Program to install the man page.
|
||||||
|
INSTALL_DATA = copy
|
||||||
|
# Generic install program.
|
||||||
|
INSTALL = copy
|
||||||
|
|
||||||
|
# Program to format Texinfo source into Info files.
|
||||||
|
MAKEINFO = makeinfo
|
||||||
|
# Program to format Texinfo source into DVI files.
|
||||||
|
TEXI2DVI = texi2dvi
|
||||||
|
|
||||||
|
# Programs to make tags files.
|
||||||
|
ETAGS = etags -w
|
||||||
|
CTAGS = ctags -w
|
||||||
|
|
||||||
|
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
|
||||||
|
rule.o implicit.o default.o variable.o expand.o function.o \
|
||||||
|
vpath.o version.o ar.o arscan.o signame.o remote-$(REMOTE).o \
|
||||||
|
$(GLOB) $(GETOPT) $(ALLOCA) $(extras)
|
||||||
|
srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \
|
||||||
|
$(srcdir)file.c $(srcdir)getloadavg.c $(srcdir)misc.c \
|
||||||
|
$(srcdir)main.c $(srcdir)read.c $(srcdir)remake.c \
|
||||||
|
$(srcdir)rule.c $(srcdir)implicit.c $(srcdir)default.c \
|
||||||
|
$(srcdir)variable.c $(srcdir)expand.c $(srcdir)function.c \
|
||||||
|
$(srcdir)vpath.c $(srcdir)version.c \
|
||||||
|
$(srcdir)remote-$(REMOTE).c \
|
||||||
|
$(srcdir)ar.c $(srcdir)arscan.c \
|
||||||
|
$(srcdir)signame.c $(srcdir)signame.h $(GETOPT_SRC) \
|
||||||
|
$(srcdir)commands.h $(srcdir)dep.h $(srcdir)file.h \
|
||||||
|
$(srcdir)job.h $(srcdir)make.h $(srcdir)rule.h \
|
||||||
|
$(srcdir)variable.h $(ALLOCA_SRC) $(srcdir)config.h.in
|
||||||
|
|
||||||
|
|
||||||
|
.SUFFIXES:
|
||||||
|
.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
|
||||||
|
|
||||||
|
all: make
|
||||||
|
info: make.info
|
||||||
|
dvi: make.dvi
|
||||||
|
# Some makes apparently use .PHONY as the default goal if it is before `all'.
|
||||||
|
.PHONY: all check info dvi
|
||||||
|
|
||||||
|
make.info: make.texinfo
|
||||||
|
$(MAKEINFO) -I$(srcdir) $(srcdir)make.texinfo -o make.info
|
||||||
|
|
||||||
|
make.dvi: make.texinfo
|
||||||
|
$(TEXI2DVI) $(srcdir)make.texinfo
|
||||||
|
|
||||||
|
make.ps: make.dvi
|
||||||
|
dvi2ps make.dvi > make.ps
|
||||||
|
|
||||||
|
make: $(objs) glob/glob.lib
|
||||||
|
$(CC) Link $(LDFLAGS) $(objs) $(LOADLIBES) To make.new
|
||||||
|
-delete quiet make
|
||||||
|
rename make.new make
|
||||||
|
|
||||||
|
# -I. is needed to find config.h in the build directory.
|
||||||
|
.c.o:
|
||||||
|
$(CC) $(defines) IDir "" IDir $(srcdir)glob \
|
||||||
|
$(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
||||||
|
|
||||||
|
glob/glob.lib:
|
||||||
|
execute <<
|
||||||
|
cd glob
|
||||||
|
smake
|
||||||
|
<
|
||||||
|
|
||||||
|
tagsrcs = $(srcs) $(srcdir)remote-*.c
|
||||||
|
TAGS: $(tagsrcs)
|
||||||
|
$(ETAGS) $(tagsrcs)
|
||||||
|
tags: $(tagsrcs)
|
||||||
|
$(CTAGS) $(tagsrcs)
|
||||||
|
|
||||||
|
.PHONY: install installdirs
|
||||||
|
install:
|
||||||
|
copy make sc:c
|
||||||
|
|
||||||
|
loadavg: loadavg.c config.h
|
||||||
|
$(CC) $(defines) -DTEST -I. -I$(srcdir) $(CFLAGS) $(LDFLAGS) \
|
||||||
|
loadavg.c $(LOADLIBES) -o $@
|
||||||
|
|
||||||
|
clean: glob-clean
|
||||||
|
-$(RM) -f make loadavg *.o core make.dvi
|
||||||
|
|
||||||
|
distclean: clean glob-realclean
|
||||||
|
-$(RM) -f Makefile config.h config.status build.sh stamp-config
|
||||||
|
-$(RM) -f config.log config.cache
|
||||||
|
-$(RM) -f TAGS tags
|
||||||
|
-$(RM) -f make.?? make.??s make.log make.toc make.*aux
|
||||||
|
-$(RM) -f loadavg.c
|
||||||
|
|
||||||
|
realclean: distclean
|
||||||
|
-$(RM) -f make.info*
|
||||||
|
|
||||||
|
mostlyclean: clean
|
||||||
|
|
||||||
|
.PHONY: glob-clean glob-realclean
|
||||||
|
|
||||||
|
glob-clean glob-realclean:
|
||||||
|
execute <<
|
||||||
|
cd glob
|
||||||
|
smake $@
|
||||||
|
<
|
||||||
|
|
||||||
|
# The automatically generated dependencies below may omit config.h
|
||||||
|
# because it is included with ``#include <config.h>'' rather than
|
||||||
|
# ``#include "config.h"''. So we add the explicit dependency to make sure.
|
||||||
|
$(objs): config.h
|
||||||
|
|
||||||
|
# Automatically generated dependencies will be put at the end of the file.
|
||||||
|
|
||||||
|
# Automatically generated dependencies.
|
||||||
|
commands.o: commands.c make.h dep.h filedef.h variable.h job.h \
|
||||||
|
commands.h
|
||||||
|
|
||||||
|
job.o: job.c make.h job.h filedef.h commands.h variable.h
|
||||||
|
|
||||||
|
dir.o: dir.c make.h
|
||||||
|
|
||||||
|
file.o: file.c make.h dep.h filedef.h job.h commands.h variable.h
|
||||||
|
|
||||||
|
misc.o: misc.c make.h dep.h
|
||||||
|
|
||||||
|
main.o: main.c make.h dep.h filedef.h variable.h job.h commands.h \
|
||||||
|
getopt.h
|
||||||
|
|
||||||
|
read.o: read.c make.h dep.h filedef.h job.h commands.h variable.h \
|
||||||
|
glob/glob.h
|
||||||
|
|
||||||
|
remake.o: remake.c make.h filedef.h job.h commands.h dep.h
|
||||||
|
|
||||||
|
rule.o: rule.c make.h dep.h filedef.h job.h commands.h variable.h \
|
||||||
|
rule.h
|
||||||
|
|
||||||
|
implicit.o: implicit.c make.h rule.h dep.h filedef.h
|
||||||
|
|
||||||
|
default.o: default.c make.h rule.h dep.h filedef.h job.h commands.h \
|
||||||
|
variable.h
|
||||||
|
|
||||||
|
variable.o: variable.c make.h dep.h filedef.h job.h commands.h \
|
||||||
|
variable.h
|
||||||
|
|
||||||
|
expand.o: expand.c make.h filedef.h job.h commands.h variable.h
|
||||||
|
|
||||||
|
function.o: function.c make.h filedef.h variable.h dep.h job.h \
|
||||||
|
commands.h amiga.h
|
||||||
|
|
||||||
|
vpath.o: vpath.c make.h filedef.h variable.h
|
||||||
|
|
||||||
|
version.o: version.c
|
||||||
|
|
||||||
|
ar.o: ar.c make.h filedef.h dep.h
|
||||||
|
|
||||||
|
arscan.o: arscan.c make.h
|
||||||
|
|
||||||
|
signame.o: signame.c signame.h
|
||||||
|
|
||||||
|
remote-stub.o: remote-stub.c make.h filedef.h job.h commands.h
|
||||||
|
|
||||||
|
getopt.o: getopt.c
|
||||||
|
|
||||||
|
getopt1.o : getopt1.c getopt.h
|
||||||
|
|
||||||
|
getloadavg.o: getloadavg.c
|
||||||
|
|
||||||
|
amiga.o: amiga.c make.h variable.h amiga.h
|
||||||
|
|
||||||
51
TODO.private
Normal file
51
TODO.private
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
-*-Indented-Text-*-
|
||||||
|
GNU Make TODO List
|
||||||
|
------------------
|
||||||
|
|
||||||
|
This list comes both from the authors and from users of GNU make.
|
||||||
|
|
||||||
|
They are listed in no particular order!
|
||||||
|
|
||||||
|
Also, I don't gaurantee that all of them will be ultimately deemed "good
|
||||||
|
ideas" and implemented. These are just the ones that, at first blush,
|
||||||
|
seem to have some merit (and that I can remember).
|
||||||
|
|
||||||
|
However, if you see something here you really, really want, speak up.
|
||||||
|
All other things being equal, I will tend to implement things that seem
|
||||||
|
to maximize user satisfaction.
|
||||||
|
|
||||||
|
Also, this list doesn't include things which I'm pretty sure would
|
||||||
|
require serious, fundamental change to GNU make; those things belong on
|
||||||
|
the mythical "Make 4.0" list. I admit, that line can be somewhat fuzzy :)
|
||||||
|
|
||||||
|
|
||||||
|
* Per-target variable definitions (a la SunOS make's ":=" feature, but
|
||||||
|
note the syntax here will definitely be different!)
|
||||||
|
|
||||||
|
* Multi-token pattern rule matching (allow %1/%2.c : %1/obj/%2.o, etc.)
|
||||||
|
|
||||||
|
* More robust clock skew detection algorithm.
|
||||||
|
|
||||||
|
* Provide MAKETARGETS and MAKEVARIABLES variables, containing the
|
||||||
|
names of the targets and variables defined in the makefile.
|
||||||
|
|
||||||
|
* If the user asks for parallelization, rebuild any "include"'d files
|
||||||
|
in parallel as well (helps esp. when there are many .d files to be
|
||||||
|
built).
|
||||||
|
|
||||||
|
* Allow variables/functions to expand to other make rules which are
|
||||||
|
then interpreted, with newlines handled correctly.
|
||||||
|
|
||||||
|
* More intelligent submake handling when doing parallel makes:
|
||||||
|
currently each submake gets a "-j 1" option. It would be good if
|
||||||
|
make was smart enough to give some/all its slots to the submake
|
||||||
|
(esp. if there is no other rule that can be run by the parent in
|
||||||
|
parallel, a common situation). Doing this perfectly might be too
|
||||||
|
hard, but something less than perfect is certainly possible.
|
||||||
|
|
||||||
|
* Option to check more than timestamps to determine if targets have
|
||||||
|
changed (MD5 checksumming?)
|
||||||
|
|
||||||
|
* Some sort of operating-system independent way of handling paths
|
||||||
|
would be outstanding, so makefiles can be written for UNIX, VMS,
|
||||||
|
DOS, MS-Windows, Amiga, etc. with a minimum of specialization.
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/* Name of this package (needed by automake) */
|
||||||
|
#undef PACKAGE
|
||||||
|
|
||||||
|
/* Version of this package (needed by automake) */
|
||||||
|
#undef VERSION
|
||||||
|
|
||||||
/* Define to the name of the SCCS `get' command. */
|
/* Define to the name of the SCCS `get' command. */
|
||||||
#undef SCCS_GET
|
#undef SCCS_GET
|
||||||
|
|
||||||
@@ -9,3 +15,6 @@
|
|||||||
|
|
||||||
/* Define this if the C library defines the variable `_sys_siglist'. */
|
/* Define this if the C library defines the variable `_sys_siglist'. */
|
||||||
#undef HAVE__SYS_SIGLIST
|
#undef HAVE__SYS_SIGLIST
|
||||||
|
|
||||||
|
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
||||||
|
#undef HAVE_UNION_WAIT
|
||||||
|
|||||||
16
alloca.c
16
alloca.c
@@ -25,6 +25,13 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_STRING_H
|
||||||
|
#include <string.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_STDLIB_H
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef emacs
|
#ifdef emacs
|
||||||
#include "blockinput.h"
|
#include "blockinput.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -66,7 +73,9 @@ typedef void *pointer;
|
|||||||
typedef char *pointer;
|
typedef char *pointer;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef NULL
|
||||||
#define NULL 0
|
#define NULL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Different portions of Emacs need to call different versions of
|
/* Different portions of Emacs need to call different versions of
|
||||||
malloc. The Emacs executable needs alloca to call xmalloc, because
|
malloc. The Emacs executable needs alloca to call xmalloc, because
|
||||||
@@ -171,7 +180,7 @@ alloca (size)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Reclaim garbage, defined as all alloca'd storage that
|
/* Reclaim garbage, defined as all alloca'd storage that
|
||||||
was allocated from deeper in the stack than currently. */
|
was allocated from deeper in the stack than currently. */
|
||||||
|
|
||||||
{
|
{
|
||||||
register header *hp; /* Traverses linked list. */
|
register header *hp; /* Traverses linked list. */
|
||||||
@@ -209,6 +218,9 @@ alloca (size)
|
|||||||
register pointer new = malloc (sizeof (header) + size);
|
register pointer new = malloc (sizeof (header) + size);
|
||||||
/* Address of header. */
|
/* Address of header. */
|
||||||
|
|
||||||
|
if (new == 0)
|
||||||
|
abort();
|
||||||
|
|
||||||
((header *) new)->h.next = last_alloca_header;
|
((header *) new)->h.next = last_alloca_header;
|
||||||
((header *) new)->h.deep = depth;
|
((header *) new)->h.deep = depth;
|
||||||
|
|
||||||
@@ -338,7 +350,7 @@ struct stk_trailer
|
|||||||
|
|
||||||
#ifdef CRAY2
|
#ifdef CRAY2
|
||||||
/* Determine a "stack measure" for an arbitrary ADDRESS.
|
/* Determine a "stack measure" for an arbitrary ADDRESS.
|
||||||
I doubt that "lint" will like this much. */
|
I doubt that "lint" will like this much. */
|
||||||
|
|
||||||
static long
|
static long
|
||||||
i00afunc (long *address)
|
i00afunc (long *address)
|
||||||
|
|||||||
122
amiga.c
Normal file
122
amiga.c
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
/* Running commands on Amiga
|
||||||
|
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||||
|
This file is part of GNU Make.
|
||||||
|
|
||||||
|
GNU Make 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 2, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
GNU Make 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 GNU Make; see the file COPYING. If not, write to
|
||||||
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
#include "make.h"
|
||||||
|
#include "variable.h"
|
||||||
|
#include "amiga.h"
|
||||||
|
#include <assert.h>
|
||||||
|
#include <exec/memory.h>
|
||||||
|
#include <dos/dostags.h>
|
||||||
|
#include <proto/exec.h>
|
||||||
|
#include <proto/dos.h>
|
||||||
|
|
||||||
|
static const char Amiga_version[] = "$VER: Make 3.74.3 (12.05.96) \n"
|
||||||
|
"Amiga Port by A. Digulla (digulla@home.lake.de)";
|
||||||
|
|
||||||
|
int
|
||||||
|
MyExecute (argv)
|
||||||
|
char ** argv;
|
||||||
|
{
|
||||||
|
char * buffer, * ptr;
|
||||||
|
char ** aptr;
|
||||||
|
int len = 0;
|
||||||
|
int status;
|
||||||
|
|
||||||
|
for (aptr=argv; *aptr; aptr++)
|
||||||
|
{
|
||||||
|
len += strlen (*aptr) + 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer = AllocMem (len, MEMF_ANY);
|
||||||
|
|
||||||
|
if (!buffer)
|
||||||
|
fatal ("MyExecute: Cannot allocate space for calling a command");
|
||||||
|
|
||||||
|
ptr = buffer;
|
||||||
|
|
||||||
|
for (aptr=argv; *aptr; aptr++)
|
||||||
|
{
|
||||||
|
if (((*aptr)[0] == ';' && !(*aptr)[1]))
|
||||||
|
{
|
||||||
|
*ptr ++ = '"';
|
||||||
|
strcpy (ptr, *aptr);
|
||||||
|
ptr += strlen (ptr);
|
||||||
|
*ptr ++ = '"';
|
||||||
|
}
|
||||||
|
else if ((*aptr)[0] == '@' && (*aptr)[1] == '@' && !(*aptr)[2])
|
||||||
|
{
|
||||||
|
*ptr ++ = '\n';
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strcpy (ptr, *aptr);
|
||||||
|
ptr += strlen (ptr);
|
||||||
|
}
|
||||||
|
*ptr ++ = ' ';
|
||||||
|
*ptr = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ptr[-1] = '\n';
|
||||||
|
|
||||||
|
status = SystemTags (buffer,
|
||||||
|
SYS_UserShell, TRUE,
|
||||||
|
TAG_END);
|
||||||
|
|
||||||
|
FreeMem (buffer, len);
|
||||||
|
|
||||||
|
if (SetSignal(0L,0L) & SIGBREAKF_CTRL_C)
|
||||||
|
status = 20;
|
||||||
|
|
||||||
|
/* Warnings don't count */
|
||||||
|
if (status == 5)
|
||||||
|
status = 0;
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
wildcard_expansion (wc, o)
|
||||||
|
char * wc, * o;
|
||||||
|
{
|
||||||
|
# define PATH_SIZE 1024
|
||||||
|
struct AnchorPath * apath;
|
||||||
|
|
||||||
|
if ( (apath = AllocMem (sizeof (struct AnchorPath) + PATH_SIZE,
|
||||||
|
MEMF_CLEAR))
|
||||||
|
)
|
||||||
|
{
|
||||||
|
apath->ap_Strlen = PATH_SIZE;
|
||||||
|
|
||||||
|
if (MatchFirst (wc, apath) == 0)
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
o = variable_buffer_output (o, apath->ap_Buf,
|
||||||
|
strlen (apath->ap_Buf));
|
||||||
|
o = variable_buffer_output (o, " ",1);
|
||||||
|
} while (MatchNext (apath) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
MatchEnd (apath);
|
||||||
|
FreeMem (apath, sizeof (struct AnchorPath) + PATH_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
21
amiga.h
Normal file
21
amiga.h
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/* Definitions for amiga specific things
|
||||||
|
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||||
|
This file is part of GNU Make.
|
||||||
|
|
||||||
|
GNU Make 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 2, or (at your option)
|
||||||
|
any later version.
|
||||||
|
|
||||||
|
GNU Make 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 GNU Make; see the file COPYING. If not, write to
|
||||||
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
extern int MyExecute PARAMS ((char ** argv));
|
||||||
|
extern char * wildcard_expansion PARAMS ((char * wc, char * o));
|
||||||
|
|
||||||
26
ar.c
26
ar.c
@@ -1,5 +1,5 @@
|
|||||||
/* Interface to `ar' archives for GNU Make.
|
/* Interface to `ar' archives for GNU Make.
|
||||||
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -20,15 +20,16 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
|
|
||||||
#include "file.h"
|
#include "filedef.h"
|
||||||
#include "dep.h"
|
#include "dep.h"
|
||||||
#include <fnmatch.h>
|
#include <fnmatch.h>
|
||||||
|
|
||||||
/* Defined in arscan.c. */
|
/* Defined in arscan.c. */
|
||||||
extern long int ar_scan ();
|
extern long int ar_scan PARAMS ((char *archive, long int (*function) (), long int arg));
|
||||||
extern int ar_member_touch ();
|
extern int ar_name_equal PARAMS ((char *name, char *mem, int truncated));
|
||||||
extern int ar_name_equal ();
|
#ifndef VMS
|
||||||
|
extern int ar_member_touch PARAMS ((char *arname, char *memname));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Return nonzero if NAME is an archive-member reference, zero if not.
|
/* Return nonzero if NAME is an archive-member reference, zero if not.
|
||||||
An archive-member reference is a name like `lib(member)'.
|
An archive-member reference is a name like `lib(member)'.
|
||||||
@@ -68,7 +69,8 @@ ar_parse_name (name, arname_p, memname_p)
|
|||||||
*memname_p = savestring (p + 1, end - (p + 1));
|
*memname_p = savestring (p + 1, end - (p + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
static long int ar_member_date_1 ();
|
static long int ar_member_date_1 PARAMS ((int desc, char *mem, int truncated, long int hdrpos,
|
||||||
|
long int datapos, long int size, long int date, int uid, int gid, int mode, char *name));
|
||||||
|
|
||||||
/* Return the modtime of NAME. */
|
/* Return the modtime of NAME. */
|
||||||
|
|
||||||
@@ -130,6 +132,15 @@ ar_member_date_1 (desc, mem, truncated,
|
|||||||
|
|
||||||
/* Set the archive-member NAME's modtime to now. */
|
/* Set the archive-member NAME's modtime to now. */
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
int
|
||||||
|
ar_touch (name)
|
||||||
|
char *name;
|
||||||
|
{
|
||||||
|
error ("touch archive member is not available on VMS");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
#else
|
||||||
int
|
int
|
||||||
ar_touch (name)
|
ar_touch (name)
|
||||||
char *name;
|
char *name;
|
||||||
@@ -182,6 +193,7 @@ ar_touch (name)
|
|||||||
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
#endif /* !VMS */
|
||||||
|
|
||||||
/* State of an `ar_glob' run, passed to `ar_glob_match'. */
|
/* State of an `ar_glob' run, passed to `ar_glob_match'. */
|
||||||
|
|
||||||
|
|||||||
206
arscan.c
206
arscan.c
@@ -1,19 +1,19 @@
|
|||||||
/* Library function for scanning an archive file.
|
/* Library function for scanning an archive file.
|
||||||
Copyright (C) 1987, 89, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1987,89,91,92,93,94,95,97 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
the Free Software Foundation; either version 2, or (at your option)
|
||||||
any later version.
|
any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
|
|
||||||
@@ -25,6 +25,171 @@
|
|||||||
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
#include <lbrdef.h>
|
||||||
|
#include <mhddef.h>
|
||||||
|
#include <credef.h>
|
||||||
|
#include <descrip.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#if __DECC
|
||||||
|
#include <unixlib.h>
|
||||||
|
#include <lbr$routines.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define uppercasify(str) {char *str1; for (str1 = str; *str1; str1++) *str1 = _toupper(*str1);}
|
||||||
|
|
||||||
|
static void *VMS_lib_idx;
|
||||||
|
|
||||||
|
static char *VMS_saved_memname;
|
||||||
|
|
||||||
|
static time_t VMS_member_date;
|
||||||
|
|
||||||
|
static long int (*VMS_function) ();
|
||||||
|
|
||||||
|
static int
|
||||||
|
VMS_get_member_info (module, rfa)
|
||||||
|
struct dsc$descriptor_s *module;
|
||||||
|
unsigned long *rfa;
|
||||||
|
{
|
||||||
|
int status, i;
|
||||||
|
long int fnval;
|
||||||
|
|
||||||
|
time_t val;
|
||||||
|
|
||||||
|
static struct dsc$descriptor_s bufdesc =
|
||||||
|
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, NULL };
|
||||||
|
|
||||||
|
struct mhddef *mhd;
|
||||||
|
char filename[128];
|
||||||
|
|
||||||
|
bufdesc.dsc$a_pointer = filename;
|
||||||
|
bufdesc.dsc$w_length = sizeof (filename);
|
||||||
|
|
||||||
|
status = lbr$set_module (&VMS_lib_idx, rfa, &bufdesc,
|
||||||
|
&bufdesc.dsc$w_length, 0);
|
||||||
|
if (! status)
|
||||||
|
{
|
||||||
|
error ("lbr$set_module failed to extract module info, status = %d",
|
||||||
|
status);
|
||||||
|
|
||||||
|
lbr$close (&VMS_lib_idx);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
mhd = (struct mhddef *) filename;
|
||||||
|
|
||||||
|
val = decc$fix_time (&mhd->mhd$l_datim);
|
||||||
|
|
||||||
|
for (i = 0; i < module->dsc$w_length; i++)
|
||||||
|
filename[i] = _tolower (module->dsc$a_pointer[i]);
|
||||||
|
|
||||||
|
filename[i] = '\0';
|
||||||
|
|
||||||
|
VMS_member_date = (time_t) -1;
|
||||||
|
|
||||||
|
fnval =
|
||||||
|
(*VMS_function) (-1, filename, 0, 0, 0, 0, val, 0, 0, 0,
|
||||||
|
VMS_saved_memname);
|
||||||
|
|
||||||
|
if (fnval)
|
||||||
|
{
|
||||||
|
VMS_member_date = fnval;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Takes three arguments ARCHIVE, FUNCTION and ARG.
|
||||||
|
|
||||||
|
Open the archive named ARCHIVE, find its members one by one,
|
||||||
|
and for each one call FUNCTION with the following arguments:
|
||||||
|
archive file descriptor for reading the data,
|
||||||
|
member name,
|
||||||
|
member name might be truncated flag,
|
||||||
|
member header position in file,
|
||||||
|
member data position in file,
|
||||||
|
member data size,
|
||||||
|
member date,
|
||||||
|
member uid,
|
||||||
|
member gid,
|
||||||
|
member protection mode,
|
||||||
|
ARG.
|
||||||
|
|
||||||
|
NOTE: on VMS systems, only name, date, and arg are meaningful!
|
||||||
|
|
||||||
|
The descriptor is poised to read the data of the member
|
||||||
|
when FUNCTION is called. It does not matter how much
|
||||||
|
data FUNCTION reads.
|
||||||
|
|
||||||
|
If FUNCTION returns nonzero, we immediately return
|
||||||
|
what FUNCTION returned.
|
||||||
|
|
||||||
|
Returns -1 if archive does not exist,
|
||||||
|
Returns -2 if archive has invalid format.
|
||||||
|
Returns 0 if have scanned successfully. */
|
||||||
|
|
||||||
|
long int
|
||||||
|
ar_scan (archive, function, arg)
|
||||||
|
char *archive;
|
||||||
|
long int (*function) ();
|
||||||
|
long int arg;
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
static struct dsc$descriptor_s libdesc =
|
||||||
|
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, NULL };
|
||||||
|
|
||||||
|
unsigned long func = LBR$C_READ;
|
||||||
|
unsigned long type = LBR$C_TYP_UNK;
|
||||||
|
unsigned long index = 1;
|
||||||
|
|
||||||
|
int status;
|
||||||
|
|
||||||
|
status = lbr$ini_control (&VMS_lib_idx, &func, &type, 0);
|
||||||
|
|
||||||
|
if (! status)
|
||||||
|
{
|
||||||
|
error ("lbr$ini_control failed with status = %d",status);
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
|
||||||
|
libdesc.dsc$a_pointer = archive;
|
||||||
|
libdesc.dsc$w_length = strlen (archive);
|
||||||
|
|
||||||
|
status = lbr$open (&VMS_lib_idx, &libdesc, 0, 0, 0, 0, 0);
|
||||||
|
|
||||||
|
if (! status)
|
||||||
|
{
|
||||||
|
error ("unable to open library `%s' to lookup member `%s'",
|
||||||
|
archive, (char *)arg);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
VMS_saved_memname = (char *)arg;
|
||||||
|
|
||||||
|
/* For comparison, delete .obj from arg name. */
|
||||||
|
|
||||||
|
p = rindex (VMS_saved_memname, '.');
|
||||||
|
if (p)
|
||||||
|
*p = '\0';
|
||||||
|
|
||||||
|
VMS_function = function;
|
||||||
|
|
||||||
|
lbr$get_index (&VMS_lib_idx, &index, VMS_get_member_info, 0);
|
||||||
|
|
||||||
|
/* Undo the damage. */
|
||||||
|
if (p)
|
||||||
|
*p = '.';
|
||||||
|
|
||||||
|
lbr$close (&VMS_lib_idx);
|
||||||
|
|
||||||
|
return VMS_member_date > 0 ? VMS_member_date : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else /* !VMS */
|
||||||
|
|
||||||
/* SCO Unix's compiler defines both of these. */
|
/* SCO Unix's compiler defines both of these. */
|
||||||
#ifdef M_UNIX
|
#ifdef M_UNIX
|
||||||
#undef M_XENIX
|
#undef M_XENIX
|
||||||
@@ -144,6 +309,13 @@ ar_scan (archive, function, arg)
|
|||||||
|
|
||||||
sscanf (fl_header.fl_fstmoff, "%12ld", &member_offset);
|
sscanf (fl_header.fl_fstmoff, "%12ld", &member_offset);
|
||||||
sscanf (fl_header.fl_lstmoff, "%12ld", &last_member_offset);
|
sscanf (fl_header.fl_lstmoff, "%12ld", &last_member_offset);
|
||||||
|
|
||||||
|
if (member_offset == 0)
|
||||||
|
{
|
||||||
|
/* Empty archive. */
|
||||||
|
close (desc);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
#ifndef M_XENIX
|
#ifndef M_XENIX
|
||||||
register long int member_offset = sizeof (int);
|
register long int member_offset = sizeof (int);
|
||||||
@@ -372,6 +544,7 @@ ar_scan (archive, function, arg)
|
|||||||
close (desc);
|
close (desc);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif /* !VMS */
|
||||||
|
|
||||||
/* Return nonzero iff NAME matches MEM.
|
/* Return nonzero iff NAME matches MEM.
|
||||||
If TRUNCATED is nonzero, MEM may be truncated to
|
If TRUNCATED is nonzero, MEM may be truncated to
|
||||||
@@ -419,7 +592,7 @@ ar_name_equal (name, mem, truncated)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#else /* AIX or APOLLO. */
|
#else /* AIX or APOLLO. */
|
||||||
|
#ifndef VMS
|
||||||
if (truncated)
|
if (truncated)
|
||||||
{
|
{
|
||||||
#ifdef AIAMAG
|
#ifdef AIAMAG
|
||||||
@@ -429,20 +602,22 @@ ar_name_equal (name, mem, truncated)
|
|||||||
struct ar_hdr hdr;
|
struct ar_hdr hdr;
|
||||||
return !strncmp (name, mem,
|
return !strncmp (name, mem,
|
||||||
sizeof (hdr.ar_name) -
|
sizeof (hdr.ar_name) -
|
||||||
#ifndef __hpux
|
#if !defined (__hpux) && !defined (cray)
|
||||||
1
|
1
|
||||||
#else
|
#else
|
||||||
2
|
2
|
||||||
#endif /* __hpux */
|
#endif /* !__hpux && !cray */
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif /* !VMS */
|
||||||
|
|
||||||
return !strcmp (name, mem);
|
return !strcmp (name, mem);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef VMS
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static long int
|
static long int
|
||||||
ar_member_pos (desc, mem, truncated,
|
ar_member_pos (desc, mem, truncated,
|
||||||
@@ -525,6 +700,7 @@ ar_member_touch (arname, memname)
|
|||||||
errno = i;
|
errno = i;
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Shell script to build GNU Make in the absence of any `make' program.
|
# Shell script to build GNU Make in the absence of any `make' program.
|
||||||
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1993 Free Software Foundation, Inc.
|
# Copyright (C) 1993, 1994, 1997 Free Software Foundation, Inc.
|
||||||
# This file is part of GNU Make.
|
# This file is part of GNU Make.
|
||||||
#
|
#
|
||||||
# GNU Make is free software; you can redistribute it and/or modify
|
# GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -24,6 +24,7 @@
|
|||||||
srcdir='@srcdir@'
|
srcdir='@srcdir@'
|
||||||
CC='@CC@'
|
CC='@CC@'
|
||||||
CFLAGS='@CFLAGS@'
|
CFLAGS='@CFLAGS@'
|
||||||
|
CPPFLAGS='@CPPFLAGS@'
|
||||||
LDFLAGS='@LDFLAGS@'
|
LDFLAGS='@LDFLAGS@'
|
||||||
defines='@DEFS@ -DLIBDIR="${libdir}" -DINCLUDEDIR="${includedir}"'
|
defines='@DEFS@ -DLIBDIR="${libdir}" -DINCLUDEDIR="${includedir}"'
|
||||||
ALLOCA='@ALLOCA@'
|
ALLOCA='@ALLOCA@'
|
||||||
@@ -32,9 +33,9 @@ extras='@LIBOBJS@'
|
|||||||
REMOTE='@REMOTE@'
|
REMOTE='@REMOTE@'
|
||||||
|
|
||||||
# Common prefix for machine-independent installed files.
|
# Common prefix for machine-independent installed files.
|
||||||
prefix=/usr/local
|
prefix='@prefix@'
|
||||||
# Common prefix for machine-dependent installed files.
|
# Common prefix for machine-dependent installed files.
|
||||||
exec_prefix=/usr/local
|
exec_prefix='@exec_prefix@'
|
||||||
# Directory to find libraries in for `-lXXX'.
|
# Directory to find libraries in for `-lXXX'.
|
||||||
libdir=${exec_prefix}/lib
|
libdir=${exec_prefix}/lib
|
||||||
# Directory to search by default for included makefiles.
|
# Directory to search by default for included makefiles.
|
||||||
@@ -49,7 +50,8 @@ objs="%objs% remote-${REMOTE}.o ${extras} ${ALLOCA}"
|
|||||||
# Compile the source files into those objects.
|
# Compile the source files into those objects.
|
||||||
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
|
for file in `echo ${objs} | sed 's/\.o/.c/g'`; do
|
||||||
echo compiling ${file}...
|
echo compiling ${file}...
|
||||||
$CC $CFLAGS $defines -c -I. -I${srcdir} -I${srcdir}/glob ${srcdir}/$file
|
$CC $defines $CPPFLAGS $CFLAGS \
|
||||||
|
-c -I. -I${srcdir} -I${srcdir}/glob ${srcdir}/$file
|
||||||
done
|
done
|
||||||
|
|
||||||
# The object files were actually all put in the current directory.
|
# The object files were actually all put in the current directory.
|
||||||
|
|||||||
137
build_w32.bat
Normal file
137
build_w32.bat
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
set make=gnumake
|
||||||
|
cd w32\subproc
|
||||||
|
echo "Creating the subproc library"
|
||||||
|
%ComSpec% /c build.bat
|
||||||
|
cd ..\..
|
||||||
|
del link.dbg link.rel
|
||||||
|
del config.h
|
||||||
|
copy config.h.W32 config.h
|
||||||
|
echo off
|
||||||
|
echo "Creating GNU make for Windows 95/NT"
|
||||||
|
echo on
|
||||||
|
if not exist .\WinDebug\nul mkdir .\WinDebug
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D TIVOLI /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c variable.c
|
||||||
|
echo WinDebug\variable.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c rule.c
|
||||||
|
echo WinDebug\rule.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remote-stub.c
|
||||||
|
echo WinDebug\remote-stub.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c commands.c
|
||||||
|
echo WinDebug\commands.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c file.c
|
||||||
|
echo WinDebug\file.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getloadavg.c
|
||||||
|
echo WinDebug\getloadavg.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c default.c
|
||||||
|
echo WinDebug\default.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c signame.c
|
||||||
|
echo WinDebug\signame.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c expand.c
|
||||||
|
echo WinDebug\expand.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c dir.c
|
||||||
|
echo WinDebug\dir.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c main.c
|
||||||
|
echo WinDebug\main.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt1.c
|
||||||
|
echo WinDebug\getopt1.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c job.c
|
||||||
|
echo WinDebug\job.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c read.c
|
||||||
|
echo WinDebug\read.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c version.c
|
||||||
|
echo WinDebug\version.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt.c
|
||||||
|
echo WinDebug\getopt.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c arscan.c
|
||||||
|
echo WinDebug\arscan.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c remake.c
|
||||||
|
echo WinDebug\remake.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c misc.c
|
||||||
|
echo WinDebug\misc.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c ar.c
|
||||||
|
echo WinDebug\ar.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c function.c
|
||||||
|
echo WinDebug\function.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c vpath.c
|
||||||
|
echo WinDebug\vpath.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c implicit.c
|
||||||
|
echo WinDebug\implicit.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\compat\dirent.c
|
||||||
|
echo WinDebug\dirent.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\glob.c
|
||||||
|
echo WinDebug\glob.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\glob\fnmatch.c
|
||||||
|
echo WinDebug\fnmatch.obj >>link.dbg
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\pathstuff.c
|
||||||
|
echo WinDebug\pathstuff.obj >>link.dbg
|
||||||
|
echo off
|
||||||
|
echo "Linking WinDebug/%make%.exe"
|
||||||
|
rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/%make%.exe .\WinDebug/variable.obj .\WinDebug/rule.obj .\WinDebug/remote-stub.obj .\WinDebug/commands.obj .\WinDebug/file.obj .\WinDebug/getloadavg.obj .\WinDebug/default.obj .\WinDebug/signame.obj .\WinDebug/expand.obj .\WinDebug/dir.obj .\WinDebug/main.obj .\WinDebug/getopt1.obj .\WinDebug/job.obj .\WinDebug/read.obj .\WinDebug/version.obj .\WinDebug/getopt.obj .\WinDebug/arscan.obj .\WinDebug/remake.obj .\WinDebug/misc.obj .\WinDebug/ar.obj .\WinDebug/function.obj .\WinDebug/vpath.obj .\WinDebug/implicit.obj .\WinDebug/dirent.obj .\WinDebug/glob.obj .\WinDebug/fnmatch.obj .\WinDebug/pathstuff.obj
|
||||||
|
echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib >>link.dbg
|
||||||
|
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/%make%.exe @link.dbg
|
||||||
|
if not exist .\WinDebug/%make%.exe echo "WinDebug build failed"
|
||||||
|
if exist .\WinDebug/%make%.exe echo "WinDebug build succeeded!"
|
||||||
|
if not exist .\WinRel\nul mkdir .\WinRel
|
||||||
|
echo on
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /D TIVOLI /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c variable.c
|
||||||
|
echo WinRel\variable.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c rule.c
|
||||||
|
echo WinRel\rule.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remote-stub.c
|
||||||
|
echo WinRel\remote-stub.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c commands.c
|
||||||
|
echo WinRel\commands.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c file.c
|
||||||
|
echo WinRel\file.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getloadavg.c
|
||||||
|
echo WinRel\getloadavg.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c default.c
|
||||||
|
echo WinRel\default.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c signame.c
|
||||||
|
echo WinRel\signame.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c expand.c
|
||||||
|
echo WinRel\expand.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c dir.c
|
||||||
|
echo WinRel\dir.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c main.c
|
||||||
|
echo WinRel\main.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt1.c
|
||||||
|
echo WinRel\getopt1.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c job.c
|
||||||
|
echo WinRel\job.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c read.c
|
||||||
|
echo WinRel\read.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c version.c
|
||||||
|
echo WinRel\version.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt.c
|
||||||
|
echo WinRel\getopt.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c arscan.c
|
||||||
|
echo WinRel\arscan.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c remake.c
|
||||||
|
echo WinRel\remake.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c misc.c
|
||||||
|
echo WinRel\misc.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c ar.c
|
||||||
|
echo WinRel\ar.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c function.c
|
||||||
|
echo WinRel\function.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c vpath.c
|
||||||
|
echo WinRel\vpath.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c implicit.c
|
||||||
|
echo WinRel\implicit.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\compat\dirent.c
|
||||||
|
echo WinRel\dirent.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\glob.c
|
||||||
|
echo WinRel\glob.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\glob\fnmatch.c
|
||||||
|
echo WinRel\fnmatch.obj >>link.rel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /D NO_ARCHIVES /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\pathstuff.c
|
||||||
|
echo WinRel\pathstuff.obj >>link.rel
|
||||||
|
echo off
|
||||||
|
echo "Linking WinRel/%make%.exe"
|
||||||
|
rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /MACHINE:I386 /OUT:.\WinRel/%make%.exe .\WinRel/variable.obj .\WinRel/rule.obj .\WinRel/remote-stub.obj .\WinRel/commands.obj .\WinRel/file.obj .\WinRel/getloadavg.obj .\WinRel/default.obj .\WinRel/signame.obj .\WinRel/expand.obj .\WinRel/dir.obj .\WinRel/main.obj .\WinRel/getopt1.obj .\WinRel/job.obj .\WinRel/read.obj .\WinRel/version.obj .\WinRel/getopt.obj .\WinRel/arscan.obj .\WinRel/remake.obj .\WinRel/misc.obj .\WinRel/ar.obj .\WinRel/function.obj .\WinRel/vpath.obj .\WinRel/implicit.obj .\WinRel/dirent.obj .\WinRel/glob.obj .\WinRel/fnmatch.obj .\WinRel/pathstuff.obj
|
||||||
|
echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib >>link.rel
|
||||||
|
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /MACHINE:I386 /OUT:.\WinRel/%make%.exe @link.rel
|
||||||
|
if not exist .\WinRel/%make%.exe echo "WinRel build failed"
|
||||||
|
if exist .\WinRel/%make%.exe echo "WinRel build succeeded!"
|
||||||
|
echo on
|
||||||
62
commands.c
62
commands.c
@@ -1,5 +1,5 @@
|
|||||||
/* Command processing for GNU Make.
|
/* Command processing for GNU Make.
|
||||||
Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -18,12 +18,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
|
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
#include "dep.h"
|
#include "dep.h"
|
||||||
#include "commands.h"
|
#include "filedef.h"
|
||||||
#include "file.h"
|
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
|
#include "commands.h"
|
||||||
|
|
||||||
extern int remote_kill ();
|
extern int remote_kill PARAMS ((int id, int sig));
|
||||||
|
|
||||||
#ifndef HAVE_UNISTD_H
|
#ifndef HAVE_UNISTD_H
|
||||||
extern int getpid ();
|
extern int getpid ();
|
||||||
@@ -154,8 +154,11 @@ set_file_variables (file)
|
|||||||
|
|
||||||
bcopy (c, cp, len);
|
bcopy (c, cp, len);
|
||||||
cp += len;
|
cp += len;
|
||||||
|
#if VMS
|
||||||
|
*cp++ = ',';
|
||||||
|
#else
|
||||||
*cp++ = ' ';
|
*cp++ = ' ';
|
||||||
|
#endif
|
||||||
if (! d->changed)
|
if (! d->changed)
|
||||||
qmark_len -= len + 1; /* Don't space in $? for this one. */
|
qmark_len -= len + 1; /* Don't space in $? for this one. */
|
||||||
}
|
}
|
||||||
@@ -193,13 +196,20 @@ set_file_variables (file)
|
|||||||
|
|
||||||
bcopy (c, cp, len);
|
bcopy (c, cp, len);
|
||||||
cp += len;
|
cp += len;
|
||||||
|
#if VMS
|
||||||
|
*cp++ = ',';
|
||||||
|
#else
|
||||||
*cp++ = ' ';
|
*cp++ = ' ';
|
||||||
|
#endif
|
||||||
if (d->changed)
|
if (d->changed)
|
||||||
{
|
{
|
||||||
bcopy (c, qp, len);
|
bcopy (c, qp, len);
|
||||||
qp += len;
|
qp += len;
|
||||||
|
#if VMS
|
||||||
|
*qp++ = ',';
|
||||||
|
#else
|
||||||
*qp++ = ' ';
|
*qp++ = ' ';
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,10 +369,25 @@ RETSIGTYPE
|
|||||||
fatal_error_signal (sig)
|
fatal_error_signal (sig)
|
||||||
int sig;
|
int sig;
|
||||||
{
|
{
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
|
extern int dos_status, dos_command_running;
|
||||||
|
|
||||||
|
if (dos_command_running)
|
||||||
|
{
|
||||||
|
/* That was the child who got the signal, not us. */
|
||||||
|
dos_status |= (sig << 8);
|
||||||
|
return;
|
||||||
|
}
|
||||||
remove_intermediates (1);
|
remove_intermediates (1);
|
||||||
exit (1);
|
exit (1);
|
||||||
#else /* Not MSDOS. */
|
#else /* not __MSDOS__ */
|
||||||
|
#ifdef _AMIGA
|
||||||
|
remove_intermediates (1);
|
||||||
|
if (sig == SIGINT)
|
||||||
|
fputs ("*** Break.\n", stderr);
|
||||||
|
|
||||||
|
exit (10);
|
||||||
|
#else /* not Amiga */
|
||||||
handling_fatal_signal = 1;
|
handling_fatal_signal = 1;
|
||||||
|
|
||||||
/* Set the handling for this signal to the default.
|
/* Set the handling for this signal to the default.
|
||||||
@@ -383,7 +408,14 @@ fatal_error_signal (sig)
|
|||||||
/* If we got a signal that means the user
|
/* If we got a signal that means the user
|
||||||
wanted to kill make, remove pending targets. */
|
wanted to kill make, remove pending targets. */
|
||||||
|
|
||||||
if (sig == SIGTERM || sig == SIGINT || sig == SIGHUP || sig == SIGQUIT)
|
if (sig == SIGTERM || sig == SIGINT
|
||||||
|
#ifdef SIGHUP
|
||||||
|
|| sig == SIGHUP
|
||||||
|
#endif
|
||||||
|
#ifdef SIGQUIT
|
||||||
|
|| sig == SIGQUIT
|
||||||
|
#endif
|
||||||
|
)
|
||||||
{
|
{
|
||||||
register struct child *c;
|
register struct child *c;
|
||||||
|
|
||||||
@@ -410,16 +442,19 @@ fatal_error_signal (sig)
|
|||||||
|
|
||||||
remove_intermediates (1);
|
remove_intermediates (1);
|
||||||
|
|
||||||
|
#ifdef SIGQUIT
|
||||||
if (sig == SIGQUIT)
|
if (sig == SIGQUIT)
|
||||||
/* We don't want to send ourselves SIGQUIT, because it will
|
/* We don't want to send ourselves SIGQUIT, because it will
|
||||||
cause a core dump. Just exit instead. */
|
cause a core dump. Just exit instead. */
|
||||||
exit (1);
|
exit (EXIT_FAILURE);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Signal the same code; this time it will really be fatal. The signal
|
/* Signal the same code; this time it will really be fatal. The signal
|
||||||
will be unblocked when we return and arrive then to kill us. */
|
will be unblocked when we return and arrive then to kill us. */
|
||||||
if (kill (getpid (), sig) < 0)
|
if (kill (getpid (), sig) < 0)
|
||||||
pfatal_with_name ("kill");
|
pfatal_with_name ("kill");
|
||||||
#endif /* MSDOS. */
|
#endif /* not Amiga */
|
||||||
|
#endif /* not __MSDOS__ */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Delete FILE unless it's precious or not actually a file (phony),
|
/* Delete FILE unless it's precious or not actually a file (phony),
|
||||||
@@ -451,7 +486,7 @@ delete_target (file, on_behalf_of)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (safe_stat (file->name, &st) == 0
|
if (stat (file->name, &st) == 0
|
||||||
&& S_ISREG (st.st_mode)
|
&& S_ISREG (st.st_mode)
|
||||||
&& (time_t) st.st_mtime != file->last_mtime)
|
&& (time_t) st.st_mtime != file->last_mtime)
|
||||||
{
|
{
|
||||||
@@ -459,7 +494,8 @@ delete_target (file, on_behalf_of)
|
|||||||
error ("*** [%s] Deleting file `%s'", on_behalf_of, file->name);
|
error ("*** [%s] Deleting file `%s'", on_behalf_of, file->name);
|
||||||
else
|
else
|
||||||
error ("*** Deleting file `%s'", file->name);
|
error ("*** Deleting file `%s'", file->name);
|
||||||
if (unlink (file->name) < 0)
|
if (unlink (file->name) < 0
|
||||||
|
&& errno != ENOENT) /* It disappeared; so what. */
|
||||||
perror_with_name ("unlink: ", file->name);
|
perror_with_name ("unlink: ", file->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ struct commands
|
|||||||
#define COMMANDS_SILENT 2 /* Silent: @. */
|
#define COMMANDS_SILENT 2 /* Silent: @. */
|
||||||
#define COMMANDS_NOERROR 4 /* No errors: -. */
|
#define COMMANDS_NOERROR 4 /* No errors: -. */
|
||||||
|
|
||||||
extern void execute_file_commands ();
|
extern void execute_file_commands PARAMS ((struct file *file));
|
||||||
extern void print_commands ();
|
extern void print_commands PARAMS ((struct commands *cmds));
|
||||||
extern void delete_child_targets ();
|
extern void delete_child_targets PARAMS ((struct child *child));
|
||||||
extern void chop_commands ();
|
extern void chop_commands PARAMS ((struct commands *cmds));
|
||||||
|
|||||||
280
config.ami.template
Normal file
280
config.ami.template
Normal file
@@ -0,0 +1,280 @@
|
|||||||
|
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||||
|
|
||||||
|
/* Define if on AIX 3.
|
||||||
|
System headers sometimes define this.
|
||||||
|
We just want to avoid a redefinition error message. */
|
||||||
|
#ifndef _ALL_SOURCE
|
||||||
|
#undef _ALL_SOURCE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define if using alloca.c. */
|
||||||
|
#define C_ALLOCA
|
||||||
|
|
||||||
|
/* Define to empty if the keyword does not work. */
|
||||||
|
#undef const
|
||||||
|
|
||||||
|
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||||
|
This function is required for alloca.c support on those systems. */
|
||||||
|
#undef CRAY_STACKSEG_END
|
||||||
|
|
||||||
|
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||||
|
#undef DGUX
|
||||||
|
|
||||||
|
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
||||||
|
#undef GETLOADAVG_PRIVILEGED
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
|
#define gid_t int
|
||||||
|
|
||||||
|
/* Define if you have alloca, as a function or macro. */
|
||||||
|
#undef HAVE_ALLOCA
|
||||||
|
|
||||||
|
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||||
|
#undef HAVE_ALLOCA_H
|
||||||
|
|
||||||
|
/* Define if you have the memmove function. */
|
||||||
|
#define HAVE_MEMMOVE 1
|
||||||
|
|
||||||
|
/* Define if you don't have vprintf but do have _doprnt. */
|
||||||
|
#undef HAVE_DOPRNT
|
||||||
|
|
||||||
|
/* Define if your system has its own `getloadavg' function. */
|
||||||
|
#undef HAVE_GETLOADAVG
|
||||||
|
|
||||||
|
/* Define if you have the getmntent function. */
|
||||||
|
#undef HAVE_GETMNTENT
|
||||||
|
|
||||||
|
/* Define if the `long double' type works. */
|
||||||
|
#undef HAVE_LONG_DOUBLE
|
||||||
|
|
||||||
|
/* Define if you support file names longer than 14 characters. */
|
||||||
|
#define HAVE_LONG_FILE_NAMES
|
||||||
|
|
||||||
|
/* Define if you have a working `mmap' system call. */
|
||||||
|
#undef HAVE_MMAP
|
||||||
|
|
||||||
|
/* Define if system calls automatically restart after interruption
|
||||||
|
by a signal. */
|
||||||
|
#undef HAVE_RESTARTABLE_SYSCALLS
|
||||||
|
|
||||||
|
/* Define if your struct stat has st_blksize. */
|
||||||
|
#undef HAVE_ST_BLKSIZE
|
||||||
|
|
||||||
|
/* Define if your struct stat has st_blocks. */
|
||||||
|
#undef HAVE_ST_BLOCKS
|
||||||
|
|
||||||
|
/* Define if you have the strcoll function and it is properly defined. */
|
||||||
|
#define HAVE_STRCOLL
|
||||||
|
|
||||||
|
/* Define if your struct stat has st_rdev. */
|
||||||
|
#define HAVE_ST_RDEV
|
||||||
|
|
||||||
|
/* Define if you have the strftime function. */
|
||||||
|
#define HAVE_STRFTIME
|
||||||
|
|
||||||
|
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||||
|
#undef HAVE_SYS_WAIT_H
|
||||||
|
|
||||||
|
/* Define if your struct tm has tm_zone. */
|
||||||
|
#undef HAVE_TM_ZONE
|
||||||
|
|
||||||
|
/* Define if you don't have tm_zone but do have the external array
|
||||||
|
tzname. */
|
||||||
|
#define HAVE_TZNAME
|
||||||
|
/* #define tzname __tzname */
|
||||||
|
|
||||||
|
/* Define if you have <unistd.h>. */
|
||||||
|
#define HAVE_UNISTD_H
|
||||||
|
|
||||||
|
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||||
|
#undef HAVE_UTIME_NULL
|
||||||
|
|
||||||
|
/* Define if you have <vfork.h>. */
|
||||||
|
#undef HAVE_VFORK_H
|
||||||
|
|
||||||
|
/* Define if you have the vprintf function. */
|
||||||
|
#define HAVE_VPRINTF
|
||||||
|
|
||||||
|
/* Define if you have the wait3 system call. */
|
||||||
|
#undef HAVE_WAIT3
|
||||||
|
|
||||||
|
/* Define if on MINIX. */
|
||||||
|
#undef _MINIX
|
||||||
|
|
||||||
|
/* Define if your struct nlist has an n_un member. */
|
||||||
|
#undef NLIST_NAME_UNION
|
||||||
|
|
||||||
|
/* Define if you have <nlist.h>. */
|
||||||
|
#undef NLIST_STRUCT
|
||||||
|
|
||||||
|
/* Define if your C compiler doesn't accept -c and -o together. */
|
||||||
|
#undef NO_MINUS_C_MINUS_O
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
|
#define pid_t int
|
||||||
|
|
||||||
|
/* Define if the system does not provide POSIX.1 features except
|
||||||
|
with this defined. */
|
||||||
|
#undef _POSIX_1_SOURCE
|
||||||
|
|
||||||
|
/* Define if you need to in order for stat and other things to work. */
|
||||||
|
#undef _POSIX_SOURCE
|
||||||
|
|
||||||
|
/* Define as the return type of signal handlers (int or void). */
|
||||||
|
#define RETSIGTYPE void
|
||||||
|
|
||||||
|
/* Define if the setvbuf function takes the buffering type as its second
|
||||||
|
argument and the buffer pointer as the third, as on System V
|
||||||
|
before release 3. */
|
||||||
|
#undef SETVBUF_REVERSED
|
||||||
|
|
||||||
|
/* If using the C implementation of alloca, define if you know the
|
||||||
|
direction of stack growth for your system; otherwise it will be
|
||||||
|
automatically deduced at run-time.
|
||||||
|
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||||
|
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||||
|
STACK_DIRECTION = 0 => direction of growth unknown
|
||||||
|
*/
|
||||||
|
#define STACK_DIRECTION -1
|
||||||
|
|
||||||
|
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||||
|
#undef STAT_MACROS_BROKEN
|
||||||
|
|
||||||
|
/* Define if you have the ANSI C header files. */
|
||||||
|
#define STDC_HEADERS
|
||||||
|
|
||||||
|
/* Define on System V Release 4. */
|
||||||
|
#undef SVR4
|
||||||
|
|
||||||
|
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||||
|
#undef SYS_SIGLIST_DECLARED
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
|
#define uid_t int
|
||||||
|
|
||||||
|
/* Define for Encore UMAX. */
|
||||||
|
#undef UMAX
|
||||||
|
|
||||||
|
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||||
|
instead of <sys/cpustats.h>. */
|
||||||
|
#undef UMAX4_3
|
||||||
|
|
||||||
|
/* Define vfork as fork if vfork does not work. */
|
||||||
|
#undef vfork
|
||||||
|
|
||||||
|
/* Name of this package (needed by automake) */
|
||||||
|
#define PACKAGE "%PACKAGE%"
|
||||||
|
|
||||||
|
/* Version of this package (needed by automake) */
|
||||||
|
#define VERSION "%VERSION%"
|
||||||
|
|
||||||
|
/* Define to the name of the SCCS `get' command. */
|
||||||
|
#define SCCS_GET "get"
|
||||||
|
|
||||||
|
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
|
||||||
|
#undef SCCS_GET_MINUS_G
|
||||||
|
|
||||||
|
/* Define this if the C library defines the variable `sys_siglist'. */
|
||||||
|
#undef HAVE_SYS_SIGLIST
|
||||||
|
|
||||||
|
/* Define this if the C library defines the variable `_sys_siglist'. */
|
||||||
|
#undef HAVE__SYS_SIGLIST
|
||||||
|
|
||||||
|
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
||||||
|
#undef HAVE_UNION_WAIT
|
||||||
|
|
||||||
|
/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */
|
||||||
|
#undef HAVE_SYSCONF_OPEN_MAX
|
||||||
|
|
||||||
|
/* Define if you have the dup2 function. */
|
||||||
|
#undef HAVE_DUP2
|
||||||
|
|
||||||
|
/* Define if you have the getcwd function. */
|
||||||
|
#define HAVE_GETCWD
|
||||||
|
|
||||||
|
/* Define if you have the getdtablesize function. */
|
||||||
|
#undef HAVE_GETDTABLESIZE
|
||||||
|
|
||||||
|
/* Define if you have the getgroups function. */
|
||||||
|
#undef HAVE_GETGROUPS
|
||||||
|
|
||||||
|
/* Define if you have the mktemp function. */
|
||||||
|
#define HAVE_MKTEMP
|
||||||
|
|
||||||
|
/* Define if you have the psignal function. */
|
||||||
|
#undef HAVE_PSIGNAL
|
||||||
|
|
||||||
|
/* Define if you have the setegid function. */
|
||||||
|
#undef HAVE_SETEGID
|
||||||
|
|
||||||
|
/* Define if you have the seteuid function. */
|
||||||
|
#undef HAVE_SETEUID
|
||||||
|
|
||||||
|
/* Define if you have the setlinebuf function. */
|
||||||
|
#undef HAVE_SETLINEBUF
|
||||||
|
|
||||||
|
/* Define if you have the setregid function. */
|
||||||
|
#undef HAVE_SETREGID
|
||||||
|
|
||||||
|
/* Define if you have the setreuid function. */
|
||||||
|
#undef HAVE_SETREUID
|
||||||
|
|
||||||
|
/* Define if you have the sigsetmask function. */
|
||||||
|
#undef HAVE_SIGSETMASK
|
||||||
|
|
||||||
|
/* Define if you have the strerror function. */
|
||||||
|
#define HAVE_STRERROR
|
||||||
|
|
||||||
|
/* Define if you have the strsignal function. */
|
||||||
|
#undef HAVE_STRSIGNAL
|
||||||
|
|
||||||
|
/* Define if you have the wait3 function. */
|
||||||
|
#undef HAVE_WAIT3
|
||||||
|
|
||||||
|
/* Define if you have the waitpid function. */
|
||||||
|
#undef HAVE_WAITPID
|
||||||
|
|
||||||
|
/* Define if you have the <dirent.h> header file. */
|
||||||
|
#define HAVE_DIRENT_H
|
||||||
|
|
||||||
|
/* Define if you have the <fcntl.h> header file. */
|
||||||
|
#define HAVE_FCNTL_H
|
||||||
|
|
||||||
|
/* Define if you have the <limits.h> header file. */
|
||||||
|
#define HAVE_LIMITS_H
|
||||||
|
|
||||||
|
/* Define if you have the <mach/mach.h> header file. */
|
||||||
|
#undef HAVE_MACH_MACH_H
|
||||||
|
|
||||||
|
/* Define if you have the <memory.h> header file. */
|
||||||
|
#undef HAVE_MEMORY_H
|
||||||
|
|
||||||
|
/* Define if you have the <ndir.h> header file. */
|
||||||
|
#undef HAVE_NDIR_H
|
||||||
|
|
||||||
|
/* Define if you have the <string.h> header file. */
|
||||||
|
#define HAVE_STRING_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/dir.h> header file. */
|
||||||
|
#define HAVE_SYS_DIR_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/ndir.h> header file. */
|
||||||
|
#undef HAVE_SYS_NDIR_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/param.h> header file. */
|
||||||
|
#undef HAVE_SYS_PARAM_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/timeb.h> header file. */
|
||||||
|
#undef HAVE_SYS_TIMEB_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/wait.h> header file. */
|
||||||
|
#undef HAVE_SYS_WAIT_H
|
||||||
|
|
||||||
|
/* Define if you have the <unistd.h> header file. */
|
||||||
|
#define HAVE_UNISTD_H
|
||||||
|
|
||||||
|
/* Define if you have the dgc library (-ldgc). */
|
||||||
|
#undef HAVE_LIBDGC
|
||||||
|
|
||||||
|
/* Define if you have the sun library (-lsun). */
|
||||||
|
#undef HAVE_LIBSUN
|
||||||
301
config.h-vms.template
Normal file
301
config.h-vms.template
Normal file
@@ -0,0 +1,301 @@
|
|||||||
|
/* config.h-vms. Generated by hand by Klaus Kämpf <kkaempf@progis.de> */
|
||||||
|
/* config.h. Generated automatically by configure. */
|
||||||
|
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||||
|
|
||||||
|
/* Define if on AIX 3.
|
||||||
|
System headers sometimes define this.
|
||||||
|
We just want to avoid a redefinition error message. */
|
||||||
|
#ifndef _ALL_SOURCE
|
||||||
|
/* #undef _ALL_SOURCE */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define if using alloca.c. */
|
||||||
|
/* #undef C_ALLOCA */
|
||||||
|
|
||||||
|
/* Define to empty if the keyword does not work. */
|
||||||
|
/* #undef const */
|
||||||
|
|
||||||
|
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||||
|
This function is required for alloca.c support on those systems. */
|
||||||
|
/* #undef CRAY_STACKSEG_END */
|
||||||
|
|
||||||
|
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||||
|
/* #undef DGUX */
|
||||||
|
|
||||||
|
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
||||||
|
/* #undef GETLOADAVG_PRIVILEGED 1 */
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
|
/* #undef gid_t */
|
||||||
|
|
||||||
|
/* Define if you have alloca, as a function or macro. */
|
||||||
|
#define HAVE_ALLOCA 1
|
||||||
|
|
||||||
|
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||||
|
/* #undef HAVE_ALLOCA_H 1 */
|
||||||
|
|
||||||
|
/* Define if you have the memmove function. */
|
||||||
|
#define HAVE_MEMMOVE 1
|
||||||
|
|
||||||
|
/* Define if you don't have vprintf but do have _doprnt. */
|
||||||
|
/* #undef HAVE_DOPRNT */
|
||||||
|
|
||||||
|
/* Define if your system has its own `getloadavg' function. */
|
||||||
|
/* #undef HAVE_GETLOADAVG */
|
||||||
|
|
||||||
|
/* Define if you have the getmntent function. */
|
||||||
|
/* #undef HAVE_GETMNTENT */
|
||||||
|
|
||||||
|
/* Define if the `long double' type works. */
|
||||||
|
/* #undef HAVE_LONG_DOUBLE */
|
||||||
|
|
||||||
|
/* Define if you support file names longer than 14 characters. */
|
||||||
|
#define HAVE_LONG_FILE_NAMES 1
|
||||||
|
|
||||||
|
/* Define if you have a working `mmap' system call. */
|
||||||
|
/* #undef HAVE_MMAP */
|
||||||
|
|
||||||
|
/* Define if system calls automatically restart after interruption
|
||||||
|
by a signal. */
|
||||||
|
/* #undef HAVE_RESTARTABLE_SYSCALLS */
|
||||||
|
|
||||||
|
/* Define if your struct stat has st_blksize. */
|
||||||
|
/* #undef HAVE_ST_BLKSIZE */
|
||||||
|
|
||||||
|
/* Define if your struct stat has st_blocks. */
|
||||||
|
/* #undef HAVE_ST_BLOCKS */
|
||||||
|
|
||||||
|
/* Define if you have the strcoll function and it is properly defined. */
|
||||||
|
/* #undef HAVE_STRCOLL 1 */
|
||||||
|
|
||||||
|
/* Define if your struct stat has st_rdev. */
|
||||||
|
/* #undef HAVE_ST_RDEV */
|
||||||
|
|
||||||
|
/* Define if you have the strftime function. */
|
||||||
|
/* #undef HAVE_STRFTIME */
|
||||||
|
|
||||||
|
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||||
|
/* #undef HAVE_SYS_WAIT_H 1 */
|
||||||
|
|
||||||
|
/* Define if your struct tm has tm_zone. */
|
||||||
|
/* #undef HAVE_TM_ZONE */
|
||||||
|
|
||||||
|
/* Define if you don't have tm_zone but do have the external array
|
||||||
|
tzname. */
|
||||||
|
/* #undef HAVE_TZNAME */
|
||||||
|
|
||||||
|
/* Define if you have <unistd.h>. */
|
||||||
|
#ifdef __DECC
|
||||||
|
#define HAVE_UNISTD_H 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||||
|
/* #undef HAVE_UTIME_NULL */
|
||||||
|
|
||||||
|
/* Define if you have <vfork.h>. */
|
||||||
|
/* #undef HAVE_VFORK_H 1 */
|
||||||
|
|
||||||
|
/* Define if you have the vprintf function. */
|
||||||
|
#define HAVE_VPRINTF 1
|
||||||
|
|
||||||
|
/* Define if you have the wait3 system call. */
|
||||||
|
/* #undef HAVE_WAIT3 1 */
|
||||||
|
|
||||||
|
/* Define if on MINIX. */
|
||||||
|
/* #undef _MINIX */
|
||||||
|
|
||||||
|
/* Define if your struct nlist has an n_un member. */
|
||||||
|
/* #undef NLIST_NAME_UNION */
|
||||||
|
|
||||||
|
/* Define if you have <nlist.h>. */
|
||||||
|
/* #undef NLIST_STRUCT 1 */
|
||||||
|
|
||||||
|
/* Define if your C compiler doesn't accept -c and -o together. */
|
||||||
|
/* #undef NO_MINUS_C_MINUS_O */
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
|
/* #undef pid_t */
|
||||||
|
|
||||||
|
/* Define if the system does not provide POSIX.1 features except
|
||||||
|
with this defined. */
|
||||||
|
/* #undef _POSIX_1_SOURCE */
|
||||||
|
|
||||||
|
/* Define if you need to in order for stat and other things to work. */
|
||||||
|
/* #undef _POSIX_SOURCE */
|
||||||
|
|
||||||
|
/* Define as the return type of signal handlers (int or void). */
|
||||||
|
#define RETSIGTYPE void
|
||||||
|
|
||||||
|
/* Define if the setvbuf function takes the buffering type as its second
|
||||||
|
argument and the buffer pointer as the third, as on System V
|
||||||
|
before release 3. */
|
||||||
|
/* #undef SETVBUF_REVERSED 1 */
|
||||||
|
|
||||||
|
/* If using the C implementation of alloca, define if you know the
|
||||||
|
direction of stack growth for your system; otherwise it will be
|
||||||
|
automatically deduced at run-time.
|
||||||
|
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||||
|
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||||
|
STACK_DIRECTION = 0 => direction of growth unknown
|
||||||
|
*/
|
||||||
|
/* #undef STACK_DIRECTION */
|
||||||
|
|
||||||
|
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||||
|
/* #undef STAT_MACROS_BROKEN */
|
||||||
|
|
||||||
|
/* Define if you have the ANSI C header files. */
|
||||||
|
/* #undef STDC_HEADERS */
|
||||||
|
|
||||||
|
/* Define on System V Release 4. */
|
||||||
|
/* #undef SVR4 */
|
||||||
|
|
||||||
|
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||||
|
/* #undef SYS_SIGLIST_DECLARED */
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
|
/* #undef uid_t */
|
||||||
|
|
||||||
|
/* Define for Encore UMAX. */
|
||||||
|
/* #undef UMAX */
|
||||||
|
|
||||||
|
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||||
|
instead of <sys/cpustats.h>. */
|
||||||
|
/* #undef UMAX4_3 */
|
||||||
|
|
||||||
|
/* Name of this package (needed by automake) */
|
||||||
|
#define PACKAGE "%PACKAGE%"
|
||||||
|
|
||||||
|
/* Version of this package (needed by automake) */
|
||||||
|
#define VERSION "%VERSION%"
|
||||||
|
|
||||||
|
/* Define vfork as fork if vfork does not work. */
|
||||||
|
/* #undef vfork */
|
||||||
|
|
||||||
|
/* Define to the name of the SCCS `get' command. */
|
||||||
|
/* #undef SCCS_GET "/usr/sccs/get" */
|
||||||
|
|
||||||
|
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
|
||||||
|
/* #undef SCCS_GET_MINUS_G 1 */
|
||||||
|
|
||||||
|
/* Define this if the C library defines the variable `sys_siglist'. */
|
||||||
|
/* #undefine HAVE_SYS_SIGLIST 1 */
|
||||||
|
|
||||||
|
/* Define this if the C library defines the variable `_sys_siglist'. */
|
||||||
|
/* #undef HAVE__SYS_SIGLIST */
|
||||||
|
|
||||||
|
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
||||||
|
/* #undef HAVE_UNION_WAIT */
|
||||||
|
|
||||||
|
/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */
|
||||||
|
/* #undef HAVE_SYSCONF_OPEN_MAX */
|
||||||
|
|
||||||
|
/* Define if you have the dup2 function. */
|
||||||
|
#define HAVE_DUP2 1
|
||||||
|
|
||||||
|
/* Define if you have the getcwd function. */
|
||||||
|
#define HAVE_GETCWD 1
|
||||||
|
|
||||||
|
/* Define if you have the getdtablesize function. */
|
||||||
|
/* #undef HAVE_GETDTABLESIZE 1 */
|
||||||
|
|
||||||
|
/* Define if you have the getgroups function. */
|
||||||
|
/* #undef HAVE_GETGROUPS 1 */
|
||||||
|
|
||||||
|
/* Define if you have the mktemp function. */
|
||||||
|
#define HAVE_MKTEMP 1
|
||||||
|
|
||||||
|
/* Define if you have the psignal function. */
|
||||||
|
/* #undef HAVE_PSIGNAL 1 */
|
||||||
|
|
||||||
|
/* Define if you have the setegid function. */
|
||||||
|
/* #undef HAVE_SETEGID 1 */
|
||||||
|
|
||||||
|
/* Define if you have the seteuid function. */
|
||||||
|
/* #undef HAVE_SETEUID 1 */
|
||||||
|
|
||||||
|
/* Define if you have the setlinebuf function. */
|
||||||
|
/* #undef HAVE_SETLINEBUF 1 */
|
||||||
|
|
||||||
|
/* Define if you have the setregid function. */
|
||||||
|
/* #undefine HAVE_SETREGID 1 */
|
||||||
|
|
||||||
|
/* Define if you have the setreuid function. */
|
||||||
|
/* #define HAVE_SETREUID 1 */
|
||||||
|
|
||||||
|
/* Define if you have the sigsetmask function. */
|
||||||
|
#define HAVE_SIGSETMASK 1
|
||||||
|
|
||||||
|
/* Define if you have the strerror function. */
|
||||||
|
#define HAVE_STRERROR 1
|
||||||
|
|
||||||
|
/* Define if you have the strsignal function. */
|
||||||
|
/* #undef HAVE_STRSIGNAL */
|
||||||
|
|
||||||
|
/* Define if you have the wait3 function. */
|
||||||
|
/* #define HAVE_WAIT3 1 */
|
||||||
|
|
||||||
|
/* Define if you have the waitpid function. */
|
||||||
|
/* #undef HAVE_WAITPID 1 */
|
||||||
|
|
||||||
|
/* Define if you have the <dirent.h> header file. */
|
||||||
|
/* #unddef HAVE_DIRENT_H 1 */
|
||||||
|
|
||||||
|
/* Define if you have the <fcntl.h> header file. */
|
||||||
|
#ifdef __DECC
|
||||||
|
#define HAVE_FCNTL_H 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define if you have the <limits.h> header file. */
|
||||||
|
#define HAVE_LIMITS_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <mach/mach.h> header file. */
|
||||||
|
/* #undef HAVE_MACH_MACH_H */
|
||||||
|
|
||||||
|
/* Define if you have the <memory.h> header file. */
|
||||||
|
/* #undef HAVE_MEMORY_H 1 */
|
||||||
|
|
||||||
|
/* Define if you have the <ndir.h> header file. */
|
||||||
|
/* #undef HAVE_NDIR_H */
|
||||||
|
|
||||||
|
/* Define if you have the <string.h> header file. */
|
||||||
|
#define HAVE_STRING_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <pwd.h> header file. */
|
||||||
|
/* #undef HAVE_PWD_H */
|
||||||
|
|
||||||
|
/* Define if you have the <sys/dir.h> header file. */
|
||||||
|
/* #undef HAVE_SYS_DIR_H */
|
||||||
|
|
||||||
|
/* Define if you have the <sys/ndir.h> header file. */
|
||||||
|
/* #undef HAVE_SYS_NDIR_H */
|
||||||
|
|
||||||
|
/* Define if you have the <sys/param.h> header file. */
|
||||||
|
/* #undef HAVE_SYS_PARAM_H 1 */
|
||||||
|
|
||||||
|
/* Define if you have the <sys/timeb.h> header file. */
|
||||||
|
#define HAVE_SYS_TIMEB_H 1
|
||||||
|
|
||||||
|
/* Define if you have the <sys/wait.h> header file. */
|
||||||
|
/* #undef HAVE_SYS_WAIT_H 1 */
|
||||||
|
|
||||||
|
/* Define if you have the dgc library (-ldgc). */
|
||||||
|
/* #undef HAVE_LIBDGC */
|
||||||
|
|
||||||
|
/* Define if you have the sun library (-lsun). */
|
||||||
|
/* #undef HAVE_LIBSUN */
|
||||||
|
|
||||||
|
/* VMS specific */
|
||||||
|
|
||||||
|
#define HAVE_VMSDIR_H 1
|
||||||
|
#define HAVE_STDLIB_H 1
|
||||||
|
#define INCLUDEDIR "sys$sysroot:[syslib]"
|
||||||
|
#define LIBDIR "sys$sysroot:[syslib]"
|
||||||
|
|
||||||
|
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
||||||
|
#undef PARAMS
|
||||||
|
#define PARAMS(protos) protos
|
||||||
|
#else /* Not C++ or ANSI C. */
|
||||||
|
#undef PARAMS
|
||||||
|
#define PARAMS(protos) ()
|
||||||
|
#endif /* C++ or ANSI C. */
|
||||||
|
|
||||||
299
config.h.W32.template
Normal file
299
config.h.W32.template
Normal file
@@ -0,0 +1,299 @@
|
|||||||
|
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||||
|
|
||||||
|
/* Define if on AIX 3.
|
||||||
|
System headers sometimes define this.
|
||||||
|
We just want to avoid a redefinition error message. */
|
||||||
|
#ifndef _ALL_SOURCE
|
||||||
|
#undef _ALL_SOURCE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define if using alloca.c. */
|
||||||
|
#undef C_ALLOCA
|
||||||
|
|
||||||
|
/* Define to empty if the keyword does not work. */
|
||||||
|
#undef const
|
||||||
|
|
||||||
|
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||||
|
This function is required for alloca.c support on those systems. */
|
||||||
|
#undef CRAY_STACKSEG_END
|
||||||
|
|
||||||
|
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||||
|
#undef DGUX
|
||||||
|
|
||||||
|
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
||||||
|
#undef GETLOADAVG_PRIVILEGED
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
|
#undef gid_t
|
||||||
|
#define gid_t int
|
||||||
|
|
||||||
|
/* Define if you have alloca, as a function or macro. */
|
||||||
|
#undef HAVE_ALLOCA
|
||||||
|
#define HAVE_ALLOCA
|
||||||
|
|
||||||
|
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||||
|
#undef HAVE_ALLOCA_H
|
||||||
|
|
||||||
|
/* Define if you have the memmove function. */
|
||||||
|
#undef HAVE_MEMMOVE
|
||||||
|
#define HAVE_MEMMOVE 1
|
||||||
|
|
||||||
|
/* Define if you don't have vprintf but do have _doprnt. */
|
||||||
|
#undef HAVE_DOPRNT
|
||||||
|
|
||||||
|
/* Define if your system has its own `getloadavg' function. */
|
||||||
|
#undef HAVE_GETLOADAVG
|
||||||
|
|
||||||
|
/* Define if you have the getmntent function. */
|
||||||
|
#undef HAVE_GETMNTENT
|
||||||
|
|
||||||
|
/* Define if the `long double' type works. */
|
||||||
|
#undef HAVE_LONG_DOUBLE
|
||||||
|
|
||||||
|
/* Define if you support file names longer than 14 characters. */
|
||||||
|
#undef HAVE_LONG_FILE_NAMES
|
||||||
|
#define HAVE_LONG_FILE_NAMES
|
||||||
|
|
||||||
|
/* Define if you have a working `mmap' system call. */
|
||||||
|
#undef HAVE_MMAP
|
||||||
|
|
||||||
|
/* Define if system calls automatically restart after interruption
|
||||||
|
by a signal. */
|
||||||
|
#undef HAVE_RESTARTABLE_SYSCALLS
|
||||||
|
|
||||||
|
/* Define if your struct stat has st_blksize. */
|
||||||
|
#undef HAVE_ST_BLKSIZE
|
||||||
|
|
||||||
|
/* Define if your struct stat has st_blocks. */
|
||||||
|
#undef HAVE_ST_BLOCKS
|
||||||
|
|
||||||
|
/* Define if you have the strcoll function and it is properly defined. */
|
||||||
|
#undef HAVE_STRCOLL
|
||||||
|
#define HAVE_STRCOLL
|
||||||
|
|
||||||
|
/* Define if your struct stat has st_rdev. */
|
||||||
|
#undef HAVE_ST_RDEV
|
||||||
|
#define HAVE_ST_RDEV
|
||||||
|
|
||||||
|
/* Define if you have the strftime function. */
|
||||||
|
#undef HAVE_STRFTIME
|
||||||
|
#define HAVE_STRFTIME
|
||||||
|
|
||||||
|
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||||
|
#undef HAVE_SYS_WAIT_H
|
||||||
|
|
||||||
|
/* Define if your struct tm has tm_zone. */
|
||||||
|
#undef HAVE_TM_ZONE
|
||||||
|
|
||||||
|
/* Define if you don't have tm_zone but do have the external array
|
||||||
|
tzname. */
|
||||||
|
#undef HAVE_TZNAME
|
||||||
|
#define HAVE_TZNAME
|
||||||
|
|
||||||
|
/* Define if you have <unistd.h>. */
|
||||||
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
|
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||||
|
#undef HAVE_UTIME_NULL
|
||||||
|
#define HAVE_UTIME_NULL
|
||||||
|
|
||||||
|
/* Define if you have <vfork.h>. */
|
||||||
|
#undef HAVE_VFORK_H
|
||||||
|
|
||||||
|
/* Define if you have the vprintf function. */
|
||||||
|
#undef HAVE_VPRINTF
|
||||||
|
#define HAVE_VPRINTF
|
||||||
|
|
||||||
|
/* Define if you have the wait3 system call. */
|
||||||
|
#undef HAVE_WAIT3
|
||||||
|
|
||||||
|
/* Define if on MINIX. */
|
||||||
|
#undef _MINIX
|
||||||
|
|
||||||
|
/* Define if your struct nlist has an n_un member. */
|
||||||
|
#undef NLIST_NAME_UNION
|
||||||
|
|
||||||
|
/* Define if you have <nlist.h>. */
|
||||||
|
#undef NLIST_STRUCT
|
||||||
|
|
||||||
|
/* Define if your C compiler doesn't accept -c and -o together. */
|
||||||
|
#undef NO_MINUS_C_MINUS_O
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
|
#undef pid_t
|
||||||
|
#define pid_t int
|
||||||
|
|
||||||
|
/* Define if the system does not provide POSIX.1 features except
|
||||||
|
with this defined. */
|
||||||
|
#undef _POSIX_1_SOURCE
|
||||||
|
|
||||||
|
/* Define if you need to in order for stat and other things to work. */
|
||||||
|
#undef _POSIX_SOURCE
|
||||||
|
#define _POSIX_SOURCE
|
||||||
|
|
||||||
|
/* Define as the return type of signal handlers (int or void). */
|
||||||
|
#undef RETSIGTYPE
|
||||||
|
#define RETSIGTYPE void
|
||||||
|
|
||||||
|
/* Define if the setvbuf function takes the buffering type as its second
|
||||||
|
argument and the buffer pointer as the third, as on System V
|
||||||
|
before release 3. */
|
||||||
|
#undef SETVBUF_REVERSED
|
||||||
|
|
||||||
|
/* If using the C implementation of alloca, define if you know the
|
||||||
|
direction of stack growth for your system; otherwise it will be
|
||||||
|
automatically deduced at run-time.
|
||||||
|
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||||
|
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||||
|
STACK_DIRECTION = 0 => direction of growth unknown
|
||||||
|
*/
|
||||||
|
#undef STACK_DIRECTION
|
||||||
|
|
||||||
|
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||||
|
#undef STAT_MACROS_BROKEN
|
||||||
|
|
||||||
|
/* Define if you have the ANSI C header files. */
|
||||||
|
#undef STDC_HEADERS
|
||||||
|
#define STDC_HEADERS
|
||||||
|
|
||||||
|
/* Define on System V Release 4. */
|
||||||
|
#undef SVR4
|
||||||
|
|
||||||
|
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||||
|
#undef SYS_SIGLIST_DECLARED
|
||||||
|
|
||||||
|
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||||
|
#undef uid_t
|
||||||
|
#define uid_t int
|
||||||
|
|
||||||
|
/* Define for Encore UMAX. */
|
||||||
|
#undef UMAX
|
||||||
|
|
||||||
|
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||||
|
instead of <sys/cpustats.h>. */
|
||||||
|
#undef UMAX4_3
|
||||||
|
|
||||||
|
/* Define vfork as fork if vfork does not work. */
|
||||||
|
#undef vfork
|
||||||
|
|
||||||
|
/* Name of this package (needed by automake) */
|
||||||
|
#define PACKAGE "%PACKAGE%"
|
||||||
|
|
||||||
|
/* Version of this package (needed by automake) */
|
||||||
|
#define VERSION "%VERSION%"
|
||||||
|
|
||||||
|
/* Define to the name of the SCCS `get' command. */
|
||||||
|
#undef SCCS_GET
|
||||||
|
#define SCCS_GET "echo no sccs get"
|
||||||
|
|
||||||
|
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
|
||||||
|
#undef SCCS_GET_MINUS_G
|
||||||
|
|
||||||
|
/* Define this if the C library defines the variable `sys_siglist'. */
|
||||||
|
#undef HAVE_SYS_SIGLIST
|
||||||
|
|
||||||
|
/* Define this if the C library defines the variable `_sys_siglist'. */
|
||||||
|
#undef HAVE__SYS_SIGLIST
|
||||||
|
|
||||||
|
/* Define this if you have the `union wait' type in <sys/wait.h>. */
|
||||||
|
#undef HAVE_UNION_WAIT
|
||||||
|
|
||||||
|
/* Define if you have the dup2 function. */
|
||||||
|
#undef HAVE_DUP2
|
||||||
|
#define HAVE_DUP2
|
||||||
|
|
||||||
|
/* Define if you have the getcwd function. */
|
||||||
|
#undef HAVE_GETCWD
|
||||||
|
#define HAVE_GETCWD
|
||||||
|
|
||||||
|
/* Define if you have the getgroups function. */
|
||||||
|
#undef HAVE_GETGROUPS
|
||||||
|
|
||||||
|
/* Define if you have the mktemp function. */
|
||||||
|
#undef HAVE_MKTEMP
|
||||||
|
#define HAVE_MKTEMP
|
||||||
|
|
||||||
|
/* Define if you have the psignal function. */
|
||||||
|
#undef HAVE_PSIGNAL
|
||||||
|
|
||||||
|
/* Define if you have the setegid function. */
|
||||||
|
#undef HAVE_SETEGID
|
||||||
|
|
||||||
|
/* Define if you have the seteuid function. */
|
||||||
|
#undef HAVE_SETEUID
|
||||||
|
|
||||||
|
/* Define if you have the setlinebuf function. */
|
||||||
|
#undef HAVE_SETLINEBUF
|
||||||
|
|
||||||
|
/* Define if you have the setregid function. */
|
||||||
|
#undef HAVE_SETREGID
|
||||||
|
|
||||||
|
/* Define if you have the setreuid function. */
|
||||||
|
#undef HAVE_SETREUID
|
||||||
|
|
||||||
|
/* Define if you have the sigsetmask function. */
|
||||||
|
#undef HAVE_SIGSETMASK
|
||||||
|
|
||||||
|
/* Define if you have the strerror function. */
|
||||||
|
#undef HAVE_STRERROR
|
||||||
|
#define HAVE_STRERROR
|
||||||
|
|
||||||
|
/* Define if you have the strsignal function. */
|
||||||
|
#undef HAVE_STRSIGNAL
|
||||||
|
|
||||||
|
/* Define if you have the wait3 function. */
|
||||||
|
#undef HAVE_WAIT3
|
||||||
|
|
||||||
|
/* Define if you have the waitpid function. */
|
||||||
|
#undef HAVE_WAITPID
|
||||||
|
|
||||||
|
/* Define if you have the <dirent.h> header file. */
|
||||||
|
#undef HAVE_DIRENT_H
|
||||||
|
#define HAVE_DIRENT_H
|
||||||
|
|
||||||
|
/* Define if you have the <fcntl.h> header file. */
|
||||||
|
#undef HAVE_FCNTL_H
|
||||||
|
#define HAVE_FCNTL_H
|
||||||
|
|
||||||
|
/* Define if you have the <limits.h> header file. */
|
||||||
|
#undef HAVE_LIMITS_H
|
||||||
|
#define HAVE_LIMITS_H
|
||||||
|
|
||||||
|
/* Define if you have the <mach/mach.h> header file. */
|
||||||
|
#undef HAVE_MACH_MACH_H
|
||||||
|
|
||||||
|
/* Define if you have the <memory.h> header file. */
|
||||||
|
#undef HAVE_MEMORY_H
|
||||||
|
#define HAVE_MEMORY_H
|
||||||
|
|
||||||
|
/* Define if you have the <ndir.h> header file. */
|
||||||
|
#undef HAVE_NDIR_H
|
||||||
|
|
||||||
|
/* Define if you have the <string.h> header file. */
|
||||||
|
#undef HAVE_STRING_H
|
||||||
|
#define HAVE_STRING_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/dir.h> header file. */
|
||||||
|
#undef HAVE_SYS_DIR_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/ndir.h> header file. */
|
||||||
|
#undef HAVE_SYS_NDIR_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/param.h> header file. */
|
||||||
|
#undef HAVE_SYS_PARAM_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/timeb.h> header file. */
|
||||||
|
#undef HAVE_SYS_TIMEB_H
|
||||||
|
#define HAVE_SYS_TIMEB_H
|
||||||
|
|
||||||
|
/* Define if you have the <sys/wait.h> header file. */
|
||||||
|
#undef HAVE_SYS_WAIT_H
|
||||||
|
|
||||||
|
/* Define if you have the <unistd.h> header file. */
|
||||||
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
|
/* Define if you have the dgc library (-ldgc). */
|
||||||
|
#undef HAVE_LIBDGC
|
||||||
|
|
||||||
|
/* Define if you have the sun library (-lsun). */
|
||||||
|
#undef HAVE_LIBSUN
|
||||||
@@ -1,65 +1,24 @@
|
|||||||
/* Generated automatically from configure.in by autoheader. DO NOT EDIT! */
|
/* Generated automatically from configure.in by autoheader. DO NOT EDIT! */
|
||||||
|
|
||||||
#define INCLUDEDIR "c:/djgpp/include"
|
/* Many things are defined already by a system header. */
|
||||||
#define LIBDIR "c:/djgpp/lib"
|
#include <sys/config.h>
|
||||||
|
|
||||||
/* Define if you have dirent.h. */
|
/* Name of this package (needed by automake) */
|
||||||
#define DIRENT
|
#define PACKAGE "%PACKAGE%"
|
||||||
|
|
||||||
/* Define if you have the strcoll function and it is properly defined. */
|
/* Version of this package (needed by automake) */
|
||||||
#define HAVE_STRCOLL
|
#define VERSION "%VERSION%"
|
||||||
|
|
||||||
/* Define if you have unistd.h. */
|
/* Define NSIG. */
|
||||||
#define HAVE_UNISTD_H
|
#define NSIG SIGMAX
|
||||||
|
|
||||||
/* Define as the return type of signal handlers (int or void). */
|
|
||||||
#define RETSIGTYPE void
|
|
||||||
|
|
||||||
/* Define if you have the ANSI C header files. */
|
|
||||||
#define STDC_HEADERS
|
|
||||||
|
|
||||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
|
||||||
#define SYS_SIGLIST_DECLARED
|
|
||||||
|
|
||||||
/* Define if you have getdtablesize. */
|
|
||||||
#define HAVE_GETDTABLESIZE
|
|
||||||
|
|
||||||
/* Define if you have dup2. */
|
|
||||||
#define HAVE_DUP2
|
|
||||||
|
|
||||||
/* Define if you have sys_siglist. */
|
|
||||||
#undef HAVE_SYS_SIGLIST
|
|
||||||
|
|
||||||
/* Define if you have _sys_siglist. */
|
|
||||||
#undef HAVE__SYS_SIGLIST
|
|
||||||
|
|
||||||
/* Define if you have psignal. */
|
|
||||||
#define HAVE_PSIGNAL
|
|
||||||
|
|
||||||
/* Define if you have getcwd. */
|
|
||||||
#define HAVE_GETCWD
|
|
||||||
|
|
||||||
/* Define if you have sigsetmask. */
|
/* Define if you have sigsetmask. */
|
||||||
#define HAVE_SIGSETMASK
|
#define HAVE_SIGSETMASK 1
|
||||||
|
|
||||||
/* Define if you have setlinebuf. */
|
|
||||||
#define HAVE_SETLINEBUF
|
|
||||||
|
|
||||||
/* Define if you have the <limits.h> header file. */
|
|
||||||
#define HAVE_LIMITS_H
|
|
||||||
|
|
||||||
/* Define if you have the <sys/param.h> header file. */
|
|
||||||
#define HAVE_SYS_PARAM_H
|
|
||||||
|
|
||||||
/* Define if you have the <fcntl.h> header file. */
|
|
||||||
#define HAVE_FCNTL_H
|
|
||||||
|
|
||||||
/* Define if you have the <string.h> header file. */
|
|
||||||
#define HAVE_STRING_H
|
|
||||||
|
|
||||||
/* Define if you have the <memory.h> header file. */
|
/* Define if you have the <memory.h> header file. */
|
||||||
#define HAVE_MEMORY_H
|
#define HAVE_MEMORY_H 1
|
||||||
|
|
||||||
|
/* Define if you have the memmove function. */
|
||||||
|
#define HAVE_MEMMOVE 1
|
||||||
|
|
||||||
#define INCLUDEDIR "c:/djgpp/include"
|
|
||||||
#define LIBDIR "c:/djgpp/lib"
|
|
||||||
#define SCCS_GET "get"
|
#define SCCS_GET "get"
|
||||||
|
|||||||
@@ -1,43 +1,44 @@
|
|||||||
@echo off
|
@echo off
|
||||||
echo Configuring MAKE for go32
|
echo Configuring MAKE for DJGPP
|
||||||
rem This batch file assumes a unix-type "sed" program
|
|
||||||
|
|
||||||
update configh.dos config.h
|
rem The SmallEnv trick protects against too small environment block,
|
||||||
|
rem in which case the values will be truncated and the whole thing
|
||||||
|
rem goes awry. COMMAND.COM will say "Out of environment space", but
|
||||||
|
rem many people don't care, so we force them to care by refusing to go.
|
||||||
|
|
||||||
echo # Makefile generated by "configure.bat"> Makefile
|
rem Where is the srcdir?
|
||||||
|
set XSRC=.
|
||||||
|
if not "%XSRC%"=="." goto SmallEnv
|
||||||
|
if "%1%"=="" goto SrcDone
|
||||||
|
set XSRC=%1
|
||||||
|
if not "%XSRC%"=="%1" goto SmallEnv
|
||||||
|
|
||||||
if exist config.sed del config.sed
|
:SrcDone
|
||||||
|
|
||||||
echo ": try_sl ">> config.sed
|
update %XSRC%/configh.dos ./config.h
|
||||||
echo "/\\$/ { ">> config.sed
|
|
||||||
echo " N ">> config.sed
|
|
||||||
echo " s/[ ]*\\\n[ ]*/ / ">> config.sed
|
|
||||||
echo " b try_sl ">> config.sed
|
|
||||||
echo "} ">> config.sed
|
|
||||||
|
|
||||||
echo "s/@srcdir@/./ ">> config.sed
|
rem Do they have Make?
|
||||||
echo "s/@CC@/gcc/ ">> config.sed
|
redir -o junk.$$$ -eo make -n -f NUL
|
||||||
echo "s/@CFLAGS@/-O2 -g -DHAVE_CONFIG_H/ ">> config.sed
|
rem REDIR will return 1 if it cannot run Make.
|
||||||
echo "s/@LDFLAGS@// ">> config.sed
|
rem If it can run Make, it will usually return 2,
|
||||||
echo "s/@RANLIB@/ranlib/ ">> config.sed
|
rem but 0 is also OK with us.
|
||||||
echo "s/@DEFS@// ">> config.sed
|
if errorlevel 2 goto MakeOk
|
||||||
echo "s/@REMOTE@/stub/ ">> config.sed
|
if not errorlevel 1 goto MakeOk
|
||||||
echo "s/@ALLOCA@// ">> config.sed
|
if exist junk.$$$ del junk.$$$
|
||||||
echo "s/@LIBS@// ">> config.sed
|
echo No Make program found--use DOSBUILD.BAT to build Make.
|
||||||
echo "s/@LIBOBJS@// ">> config.sed
|
goto End
|
||||||
echo "s/@SET_MAKE@// ">> config.sed
|
|
||||||
echo "s/^Makefile *:/_Makefile:/ ">> config.sed
|
|
||||||
echo "s/^config.h *:/_config.h:/ ">> config.sed
|
|
||||||
echo "s/^defines *=.*$/defines =/ ">> config.sed
|
|
||||||
echo "/mv -f make.new make/d ">> config.sed
|
|
||||||
|
|
||||||
echo "s/cd glob; $(MAKE)/$(MAKE) -C glob/ ">> config.sed
|
rem They do have Make. Generate the Makefile.
|
||||||
|
|
||||||
sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
|
:MakeOk
|
||||||
sed -f config2.sed Makefile.in >> Makefile
|
del junk.$$$
|
||||||
del config.sed
|
update %XSRC%/Makefile.DOS ./Makefile
|
||||||
del config2.sed
|
echo Done.
|
||||||
|
if not "%XSRC%"=="." echo Invoke Make thus: "make srcdir=%XSRC%"
|
||||||
|
goto End
|
||||||
|
|
||||||
cd glob
|
:SmallEnv
|
||||||
call configure
|
echo Your environment is too small. Please enlarge it and run me again.
|
||||||
cd ..
|
|
||||||
|
:End
|
||||||
|
set XRSC=
|
||||||
|
|||||||
108
configure.in
108
configure.in
@@ -1,78 +1,98 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
AC_REVISION([$Id$])
|
AC_REVISION([$Id$])
|
||||||
AC_INIT(vpath.c) dnl A distinctive file to look for in srcdir.
|
AC_PREREQ(2.12)dnl dnl Minimum Autoconf version required.
|
||||||
AC_CONFIG_HEADER(config.h)
|
AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir.
|
||||||
|
|
||||||
# We want these before the checks, so the checks can modify their values.
|
AM_INIT_AUTOMAKE(make, 3.76)
|
||||||
test -z "$CFLAGS" && CFLAGS=-g AC_SUBST(CFLAGS)
|
AM_CONFIG_HEADER(config.h)
|
||||||
test -z "$LDFLAGS" && LDFLAGS=-g AC_SUBST(LDFLAGS)
|
AC_CONFIG_SUBDIRS(glob)
|
||||||
|
|
||||||
AC_SET_MAKE
|
AM_CONDITIONAL(MAINT_MAKEFILE, test -r $srcdir/maintMakefile)
|
||||||
|
|
||||||
|
dnl Regular configure stuff
|
||||||
|
|
||||||
|
AC_PROG_MAKE_SET
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
AC_PROG_RANLIB
|
|
||||||
AC_PROG_CPP dnl Later checks need this.
|
AC_PROG_CPP dnl Later checks need this.
|
||||||
|
AC_ARG_PROGRAM
|
||||||
AC_AIX
|
AC_AIX
|
||||||
AC_ISC_POSIX
|
AC_ISC_POSIX
|
||||||
AC_MINIX
|
AC_MINIX
|
||||||
AC_STDC_HEADERS
|
AC_HEADER_STDC
|
||||||
AC_DIR_HEADER
|
AC_HEADER_DIRENT
|
||||||
AC_UID_T dnl Also does gid_t.
|
AC_TYPE_UID_T dnl Also does gid_t.
|
||||||
AC_GETGROUPS_T
|
AC_TYPE_PID_T
|
||||||
AC_PID_T
|
AC_TYPE_SIGNAL
|
||||||
AC_RETSIGTYPE
|
AC_CHECK_HEADERS(unistd.h limits.h sys/param.h fcntl.h string.h memory.h \
|
||||||
AC_HAVE_HEADERS(unistd.h limits.h sys/param.h fcntl.h string.h memory.h \
|
sys/timeb.h)
|
||||||
sys/timeb.h)
|
AC_PROG_CC_C_O
|
||||||
AC_MINUS_C_MINUS_O
|
AC_C_CONST dnl getopt needs this.
|
||||||
AC_CONST dnl getopt needs this.
|
AC_HEADER_STAT
|
||||||
AC_STAT_MACROS_BROKEN
|
|
||||||
|
|
||||||
AC_SUBST(LIBOBJS)
|
AC_SUBST(LIBOBJS)
|
||||||
|
|
||||||
AC_HAVE_FUNCS(getdtablesize psignal \
|
AC_DEFUN(AC_CHECK_SYMBOL, [dnl
|
||||||
dup2 getcwd sigsetmask getgroups setlinebuf \
|
AC_MSG_CHECKING(for $1)
|
||||||
seteuid setegid setreuid setregid strerror)
|
AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl
|
||||||
AC_COMPILE_CHECK(sys_siglist, ,
|
AC_TRY_LINK(, [extern char *sys_siglist[]; puts(*sys_siglist);],
|
||||||
[extern char *sys_siglist[]; puts(*sys_siglist);],
|
ac_cv_check_symbol_$1=yes, ac_cv_check_symbol_$1=no)])
|
||||||
AC_DEFINE(HAVE_SYS_SIGLIST))
|
if test "$ac_cv_check_symbol_$1" = yes; then
|
||||||
AC_COMPILE_CHECK(_sys_siglist, ,
|
changequote(,)dnl
|
||||||
[extern char *_sys_siglist[]; puts(*_sys_siglist);],
|
ac_tr_symbol=`echo $1 | tr '[a-z]' '[A-Z]'`
|
||||||
AC_DEFINE(HAVE__SYS_SIGLIST))
|
changequote([,])dnl
|
||||||
AC_ALLOCA
|
AC_DEFINE_UNQUOTED(HAVE_${ac_tr_symbol})
|
||||||
AC_VFORK
|
fi
|
||||||
AC_SETVBUF_REVERSED
|
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
|
||||||
AC_GETLOADAVG
|
|
||||||
AC_STRCOLL
|
|
||||||
|
|
||||||
dnl Check out the wait reality.
|
AC_CHECK_FUNCS(memmove psignal mktemp pstat_getdynamic \
|
||||||
AC_HAVE_HEADERS(sys/wait.h) AC_HAVE_FUNCS(waitpid wait3)
|
dup2 getcwd sigsetmask getgroups setlinebuf \
|
||||||
AC_COMPILE_CHECK(union wait, [#include <sys/types.h>
|
seteuid setegid setreuid setregid strerror strsignal)
|
||||||
|
AC_CHECK_SYMBOL(sys_siglist)
|
||||||
|
AC_FUNC_ALLOCA
|
||||||
|
AC_FUNC_VFORK
|
||||||
|
AC_FUNC_SETVBUF_REVERSED
|
||||||
|
AC_FUNC_GETLOADAVG
|
||||||
|
AC_CHECK_LIB(kstat, kstat_open)
|
||||||
|
AC_FUNC_STRCOLL
|
||||||
|
|
||||||
|
# Check out the wait reality.
|
||||||
|
AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_FUNCS(waitpid wait3)
|
||||||
|
AC_MSG_CHECKING(for union wait)
|
||||||
|
AC_CACHE_VAL(make_cv_union_wait, [dnl
|
||||||
|
AC_TRY_LINK([#include <sys/types.h>
|
||||||
#include <sys/wait.h>],
|
#include <sys/wait.h>],
|
||||||
[union wait status; int pid; pid = wait (&status);
|
[union wait status; int pid; pid = wait (&status);
|
||||||
#ifdef WEXITSTATUS
|
#ifdef WEXITSTATUS
|
||||||
/* Some POSIXoid systems have both the new-style macros and the old
|
/* Some POSIXoid systems have both the new-style macros and the old
|
||||||
union wait type, and they do not work together. If union wait
|
union wait type, and they do not work together. If union wait
|
||||||
conflicts with WEXITSTATUS et al, we don't want to use it at all. */
|
conflicts with WEXITSTATUS et al, we don't want to use it at all. */
|
||||||
if (WEXITSTATUS (status) != 0) pid = -1;
|
if (WEXITSTATUS (status) != 0) pid = -1;
|
||||||
|
#ifdef WTERMSIG
|
||||||
|
/* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */
|
||||||
|
-- blow chunks here --
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_WAITPID
|
#ifdef HAVE_WAITPID
|
||||||
/* Make sure union wait works with waitpid. */
|
/* Make sure union wait works with waitpid. */
|
||||||
pid = waitpid (-1, &status, 0);
|
pid = waitpid (-1, &status, 0);
|
||||||
#endif
|
#endif
|
||||||
],
|
],
|
||||||
AC_DEFINE(HAVE_UNION_WAIT))
|
[make_cv_union_wait=yes], [make_cv_union_wait=no])])
|
||||||
|
if test "$make_cv_union_wait" = yes; then
|
||||||
|
AC_DEFINE(HAVE_UNION_WAIT)
|
||||||
|
fi
|
||||||
|
AC_MSG_RESULT($make_cv_union_wait)
|
||||||
|
|
||||||
AC_SYS_SIGLIST_DECLARED
|
AC_DECL_SYS_SIGLIST
|
||||||
|
|
||||||
# The presence of the following is not meant to imply
|
# The presence of the following is not meant to imply
|
||||||
# that make necessarily works on those systems.
|
# that make necessarily works on those systems.
|
||||||
AC_DYNIX_SEQ
|
AC_CHECK_LIB(sun, getpwnam)
|
||||||
AC_XENIX_DIR
|
|
||||||
AC_IRIX_SUN
|
|
||||||
|
|
||||||
AC_SUBST(REMOTE) REMOTE=stub
|
AC_SUBST(REMOTE) REMOTE=stub
|
||||||
AC_WITH(customs, [REMOTE=cstms
|
AC_ARG_WITH(customs, [export jobs with the Customs daemon (NOT SUPPORTED)],
|
||||||
LIBS="$LIBS libcustoms.a"])
|
[REMOTE=cstms LIBS="$LIBS libcustoms.a"])
|
||||||
|
|
||||||
echo checking for location of SCCS get command
|
echo checking for location of SCCS get command
|
||||||
if test -f /usr/sccs/get; then
|
if test -f /usr/sccs/get; then
|
||||||
@@ -94,7 +114,7 @@ if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
|
|||||||
fi
|
fi
|
||||||
rm -f s.conftest conftoast
|
rm -f s.conftest conftoast
|
||||||
|
|
||||||
AC_OUTPUT(Makefile build.sh glob/Makefile, [
|
AC_OUTPUT(Makefile build.sh, [
|
||||||
# Makefile uses this timestamp file to know when to remake Makefile,
|
# Makefile uses this timestamp file to know when to remake Makefile,
|
||||||
# build.sh, and glob/Makefile.
|
# build.sh, and glob/Makefile.
|
||||||
touch stamp-config])
|
touch stamp-config])
|
||||||
|
|||||||
146
default.c
146
default.c
@@ -1,5 +1,5 @@
|
|||||||
/* Data base of default implicit rules for GNU Make.
|
/* Data base of default implicit rules for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,95,96 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -19,7 +19,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "make.h"
|
#include "make.h"
|
||||||
#include "rule.h"
|
#include "rule.h"
|
||||||
#include "dep.h"
|
#include "dep.h"
|
||||||
#include "file.h"
|
#include "filedef.h"
|
||||||
|
#include "job.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
|
|
||||||
@@ -35,9 +36,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
a `.c' or `.p' or ... file rather than from a .s file. */
|
a `.c' or `.p' or ... file rather than from a .s file. */
|
||||||
|
|
||||||
static char default_suffixes[]
|
static char default_suffixes[]
|
||||||
|
#ifdef VMS
|
||||||
|
= ".exe .olb .ln .obj .c .cc .pas .p .for .f .r .y .l .mar \
|
||||||
|
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
||||||
|
.w .ch .cweb .web .com .sh .elc .el";
|
||||||
|
#else
|
||||||
= ".out .a .ln .o .c .cc .C .p .f .F .r .y .l .s .S \
|
= ".out .a .ln .o .c .cc .C .p .f .F .r .y .l .s .S \
|
||||||
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
||||||
.w .ch .web .sh .elc .el";
|
.w .ch .web .sh .elc .el";
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct pspec default_pattern_rules[] =
|
static struct pspec default_pattern_rules[] =
|
||||||
{
|
{
|
||||||
@@ -47,9 +54,13 @@ static struct pspec default_pattern_rules[] =
|
|||||||
/* The X.out rules are only in BSD's default set because
|
/* The X.out rules are only in BSD's default set because
|
||||||
BSD Make has no null-suffix rules, so `foo.out' and
|
BSD Make has no null-suffix rules, so `foo.out' and
|
||||||
`foo' are the same thing. */
|
`foo' are the same thing. */
|
||||||
|
#ifdef VMS
|
||||||
|
{ "%.exe", "%",
|
||||||
|
"copy $< $@" },
|
||||||
|
#else
|
||||||
{ "%.out", "%",
|
{ "%.out", "%",
|
||||||
"@rm -f $@ \n cp $< $@" },
|
"@rm -f $@ \n cp $< $@" },
|
||||||
|
#endif
|
||||||
/* Syntax is "ctangle foo.w foo.ch foo.c". */
|
/* Syntax is "ctangle foo.w foo.ch foo.c". */
|
||||||
{ "%.c", "%.w %.ch",
|
{ "%.c", "%.w %.ch",
|
||||||
"$(CTANGLE) $^ $@" },
|
"$(CTANGLE) $^ $@" },
|
||||||
@@ -61,23 +72,78 @@ static struct pspec default_pattern_rules[] =
|
|||||||
|
|
||||||
static struct pspec default_terminal_rules[] =
|
static struct pspec default_terminal_rules[] =
|
||||||
{
|
{
|
||||||
|
#ifdef VMS
|
||||||
|
/* RCS. */
|
||||||
|
{ "%", "%$$5lv", /* Multinet style */
|
||||||
|
"if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
||||||
|
{ "%", "[.$$rcs]%$$5lv", /* Multinet style */
|
||||||
|
"if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
||||||
|
{ "%", "%_v", /* Normal style */
|
||||||
|
"if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
||||||
|
{ "%", "[.rcs]%_v", /* Normal style */
|
||||||
|
"if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
||||||
|
|
||||||
|
/* SCCS. */
|
||||||
|
/* ain't no SCCS on vms */
|
||||||
|
#else
|
||||||
/* RCS. */
|
/* RCS. */
|
||||||
{ "%", "%,v",
|
{ "%", "%,v",
|
||||||
"+$(CHECKOUT,v)" },
|
"$(CHECKOUT,v)" },
|
||||||
{ "%", "RCS/%,v",
|
{ "%", "RCS/%,v",
|
||||||
"+$(CHECKOUT,v)" },
|
"$(CHECKOUT,v)" },
|
||||||
|
|
||||||
/* SCCS. */
|
/* SCCS. */
|
||||||
{ "%", "s.%",
|
{ "%", "s.%",
|
||||||
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
|
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
|
||||||
{ "%", "SCCS/s.%",
|
{ "%", "SCCS/s.%",
|
||||||
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
|
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
|
||||||
|
#endif /* !VMS */
|
||||||
{ 0, 0, 0 }
|
{ 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *default_suffix_rules[] =
|
static char *default_suffix_rules[] =
|
||||||
{
|
{
|
||||||
|
#ifdef VMS
|
||||||
|
".obj.exe",
|
||||||
|
"$(LINK.obj) $^ $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||||
|
".mar.exe",
|
||||||
|
"$(LINK.mar) $^ $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||||
|
".c.exe",
|
||||||
|
"$(COMPILE.c) $^ \n $(LINK.obj) $(subst .c,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||||
|
".cc.exe",
|
||||||
|
"$(COMPILE.cc) $^ \n $(LINK.obj) $(subst .cc,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||||
|
".for.exe",
|
||||||
|
"$(COMPILE.for) $^ \n $(LINK.obj) $(subst .for,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||||
|
".pas.exe",
|
||||||
|
"$(COMPILE.pas) $^ \n $(LINK.obj) $(subst .pas,.obj,$^) $(LOADLIBES) $(LDLIBS) /exe=$@",
|
||||||
|
|
||||||
|
".com",
|
||||||
|
"copy $< >$@",
|
||||||
|
|
||||||
|
".mar.obj",
|
||||||
|
"$(COMPILE.mar) /obj=$@ $<",
|
||||||
|
".c.obj",
|
||||||
|
"$(COMPILE.c) /obj=$@ $<",
|
||||||
|
".cc.obj",
|
||||||
|
"$(COMPILE.cc) /obj=$@ $<",
|
||||||
|
".for.obj",
|
||||||
|
"$(COMPILE.for) /obj=$@ $<",
|
||||||
|
".pas.obj",
|
||||||
|
"$(COMPILE.pas) /obj=$@ $<",
|
||||||
|
|
||||||
|
".y.c",
|
||||||
|
"$(YACC.y) $< \n rename y_tab.c $@",
|
||||||
|
".l.c",
|
||||||
|
"$(LEX.l) $< \n rename lexyy.c $@",
|
||||||
|
|
||||||
|
".texinfo.info",
|
||||||
|
"$(MAKEINFO) $<",
|
||||||
|
|
||||||
|
".tex.dvi",
|
||||||
|
"$(TEX) $<",
|
||||||
|
|
||||||
|
#else /* ! VMS */
|
||||||
|
|
||||||
".o",
|
".o",
|
||||||
"$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
"$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@",
|
||||||
".s",
|
".s",
|
||||||
@@ -108,17 +174,9 @@ static char *default_suffix_rules[] =
|
|||||||
"cat $< >$@ \n chmod a+x $@",
|
"cat $< >$@ \n chmod a+x $@",
|
||||||
|
|
||||||
".s.o",
|
".s.o",
|
||||||
#if !defined(M_XENIX) || defined(__GNUC__)
|
|
||||||
"$(COMPILE.s) -o $@ $<",
|
"$(COMPILE.s) -o $@ $<",
|
||||||
#else /* Xenix. */
|
|
||||||
"$(COMPILE.s) -o$@ $<",
|
|
||||||
#endif /* Not Xenix. */
|
|
||||||
".S.o",
|
".S.o",
|
||||||
#if !defined(M_XENIX) || defined(__GNUC__)
|
|
||||||
"$(COMPILE.S) -o $@ $<",
|
"$(COMPILE.S) -o $@ $<",
|
||||||
#else /* Xenix. */
|
|
||||||
"$(COMPILE.S) -o$@ $<",
|
|
||||||
#endif /* Not Xenix. */
|
|
||||||
".c.o",
|
".c.o",
|
||||||
"$(COMPILE.c) $< $(OUTPUT_OPTION)",
|
"$(COMPILE.c) $< $(OUTPUT_OPTION)",
|
||||||
".cc.o",
|
".cc.o",
|
||||||
@@ -203,19 +261,54 @@ static char *default_suffix_rules[] =
|
|||||||
".web.tex",
|
".web.tex",
|
||||||
"$(WEAVE) $<",
|
"$(WEAVE) $<",
|
||||||
|
|
||||||
|
#endif /* !VMS */
|
||||||
|
|
||||||
0, 0,
|
0, 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *default_variables[] =
|
static char *default_variables[] =
|
||||||
{
|
{
|
||||||
|
#ifdef VMS
|
||||||
|
"AR", "library/obj",
|
||||||
|
"ARFLAGS", "/replace",
|
||||||
|
"AS", "macro",
|
||||||
|
"CC", "cc",
|
||||||
|
"C++", "gcc/plus",
|
||||||
|
"CXX", "gcc/plus",
|
||||||
|
"CO", "co",
|
||||||
|
"CPP", "$(CC) /preprocess_only",
|
||||||
|
"FC", "fortran",
|
||||||
|
/* System V uses these, so explicit rules using them should work.
|
||||||
|
However, there is no way to make implicit rules use them and FC. */
|
||||||
|
"F77", "$(FC)",
|
||||||
|
"F77FLAGS", "$(FFLAGS)",
|
||||||
|
"LD", "link",
|
||||||
|
"LEX", "lex",
|
||||||
|
"PC", "pascal",
|
||||||
|
"YACC", "yacc", /* Or "bison -y" */
|
||||||
|
"MAKEINFO", "makeinfo",
|
||||||
|
"TEX", "tex",
|
||||||
|
"TEXINDEX", "texindex",
|
||||||
|
|
||||||
|
"RM", "delete/nolog",
|
||||||
|
|
||||||
|
"LINK.obj", "$(LD) $(LDFLAGS)",
|
||||||
|
"COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||||
|
"COMPILE.cc", "$(C++) $(C++FLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
|
||||||
|
"YACC.y", "$(YACC) $(YFLAGS)",
|
||||||
|
"LEX.l", "$(LEX) $(LFLAGS)",
|
||||||
|
"COMPILE.for", "$(FC) $(FFLAGS) $(TARGET_ARCH)",
|
||||||
|
"COMPILE.pas", "$(PC) $(PFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||||
|
"COMPILE.mar", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
|
||||||
|
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||||
|
|
||||||
|
"MV", "rename/new_version",
|
||||||
|
"CP", "copy",
|
||||||
|
|
||||||
|
#else /* !VMS */
|
||||||
|
|
||||||
"AR", "ar",
|
"AR", "ar",
|
||||||
#ifndef __hpux
|
|
||||||
"ARFLAGS", "rv",
|
"ARFLAGS", "rv",
|
||||||
#else
|
|
||||||
/* HPUX ar's f flag says to truncate the file names to archive member
|
|
||||||
name length in comparisons, so replacement notices the equality. */
|
|
||||||
"ARFLAGS", "rfv",
|
|
||||||
#endif
|
|
||||||
"AS", "as",
|
"AS", "as",
|
||||||
#ifdef GCC_IS_NATIVE
|
#ifdef GCC_IS_NATIVE
|
||||||
"CC", "gcc",
|
"CC", "gcc",
|
||||||
@@ -228,8 +321,8 @@ static char *default_variables[] =
|
|||||||
/* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist,
|
/* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist,
|
||||||
and to the empty string if $@ does exist. */
|
and to the empty string if $@ does exist. */
|
||||||
"CHECKOUT,v",
|
"CHECKOUT,v",
|
||||||
"$(patsubst $@-noexist,$(CO) $(COFLAGS) $< $@,\
|
"+$(patsubst $@-noexist,$(CO) $(COFLAGS) $< $@,\
|
||||||
$(filter-out $@,$(firstword $(wildcard $@) $@-noexist)))",
|
$(filter-out $@,$(firstword $(wildcard $@) $@-noexist)))",
|
||||||
|
|
||||||
"CO", "co",
|
"CO", "co",
|
||||||
"CPP", "$(CC) -E",
|
"CPP", "$(CC) -E",
|
||||||
@@ -311,27 +404,20 @@ static char *default_variables[] =
|
|||||||
"COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
|
"COMPILE.s", "$(AS) $(ASFLAGS) $(TARGET_MACH)",
|
||||||
"LINK.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)",
|
"LINK.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_MACH)",
|
||||||
"COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c",
|
"COMPILE.S", "$(CC) $(ASFLAGS) $(CPPFLAGS) $(TARGET_MACH) -c",
|
||||||
#if !defined(M_XENIX) || defined(__GNUC__)
|
|
||||||
"PREPROCESS.S", "$(CC) -E $(CPPFLAGS)",
|
"PREPROCESS.S", "$(CC) -E $(CPPFLAGS)",
|
||||||
#else /* Xenix. */
|
|
||||||
"PREPROCESS.S", "$(CC) -EP $(CPPFLAGS)",
|
|
||||||
#endif /* Not Xenix. */
|
|
||||||
"PREPROCESS.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F",
|
"PREPROCESS.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -F",
|
||||||
"PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F",
|
"PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F",
|
||||||
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
|
||||||
|
|
||||||
#ifndef NO_MINUS_C_MINUS_O
|
#ifndef NO_MINUS_C_MINUS_O
|
||||||
#if !defined(M_XENIX) || defined(__GNUC__)
|
|
||||||
"OUTPUT_OPTION", "-o $@",
|
"OUTPUT_OPTION", "-o $@",
|
||||||
#else /* Xenix. */
|
|
||||||
"OUTPUT_OPTION", "-Fo$@",
|
|
||||||
#endif /* Not Xenix. */
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SCCS_GET_MINUS_G
|
#ifdef SCCS_GET_MINUS_G
|
||||||
"SCCS_OUTPUT_OPTION", "-G$@",
|
"SCCS_OUTPUT_OPTION", "-G$@",
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* !VMS */
|
||||||
0, 0
|
0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
15
dep.h
15
dep.h
@@ -1,5 +1,5 @@
|
|||||||
/* Definitions of dependency data structures for GNU Make.
|
/* Definitions of dependency data structures for GNU Make.
|
||||||
Copyright (C) 1988, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
|
Copyright (C) 1988, 1989, 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -40,11 +40,16 @@ struct nameseq
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
extern struct nameseq *multi_glob (), *parse_file_seq ();
|
extern struct nameseq *multi_glob PARAMS ((struct nameseq *chain, unsigned int size));
|
||||||
extern char *tilde_expand ();
|
#ifdef VMS
|
||||||
|
extern struct nameseq *parse_file_seq ();
|
||||||
|
#else
|
||||||
|
extern struct nameseq *parse_file_seq PARAMS ((char **stringp, int stopchar, unsigned int size, int strip));
|
||||||
|
#endif
|
||||||
|
extern char *tilde_expand PARAMS ((char *name));
|
||||||
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
extern struct nameseq *ar_glob ();
|
extern struct nameseq *ar_glob PARAMS ((char *arname, char *member_pattern, unsigned int size));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef iAPX286
|
#ifndef iAPX286
|
||||||
@@ -54,7 +59,7 @@ extern struct nameseq *ar_glob ();
|
|||||||
extern char *dep_name ();
|
extern char *dep_name ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern struct dep *read_all_makefiles ();
|
extern struct dep *read_all_makefiles PARAMS ((char **makefiles));
|
||||||
|
|
||||||
/* Flag bits for the second argument to `read_makefile'.
|
/* Flag bits for the second argument to `read_makefile'.
|
||||||
These flags are saved in the `changed' field of each
|
These flags are saved in the `changed' field of each
|
||||||
|
|||||||
560
dir.c
560
dir.c
@@ -1,5 +1,5 @@
|
|||||||
/* Directory hashing for GNU Make.
|
/* Directory hashing for GNU Make.
|
||||||
Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -18,37 +18,50 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
|
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
|
|
||||||
#if defined (POSIX) || defined (DIRENT) || defined (__GNU_LIBRARY__)
|
#ifdef HAVE_DIRENT_H
|
||||||
#include <dirent.h>
|
# include <dirent.h>
|
||||||
#ifndef __GNU_LIBRARY__
|
# define NAMLEN(dirent) strlen((dirent)->d_name)
|
||||||
#define D_NAMLEN(d) strlen((d)->d_name)
|
#else
|
||||||
#else /* GNU C library. */
|
# define dirent direct
|
||||||
#define D_NAMLEN(d) ((d)->d_namlen)
|
# define NAMLEN(dirent) (dirent)->d_namlen
|
||||||
#endif /* Not GNU C library. */
|
# ifdef HAVE_SYS_NDIR_H
|
||||||
#else /* Not POSIX or DIRENT. */
|
# include <sys/ndir.h>
|
||||||
#define direct dirent
|
# endif
|
||||||
#define D_NAMLEN(d) ((d)->d_namlen)
|
# ifdef HAVE_SYS_DIR_H
|
||||||
#ifdef SYSNDIR
|
# include <sys/dir.h>
|
||||||
#include <sys/ndir.h>
|
# endif
|
||||||
#endif /* SYSNDIR */
|
# ifdef HAVE_NDIR_H
|
||||||
#ifdef SYSDIR
|
# include <ndir.h>
|
||||||
#include <sys/dir.h>
|
# endif
|
||||||
#endif /* SYSDIR */
|
# ifdef HAVE_VMSDIR_H
|
||||||
#ifdef NDIR
|
# include "vmsdir.h"
|
||||||
#include <ndir.h>
|
# endif /* HAVE_VMSDIR_H */
|
||||||
#endif /* NDIR */
|
#endif
|
||||||
#endif /* POSIX or DIRENT or __GNU_LIBRARY__. */
|
|
||||||
|
|
||||||
#if defined (POSIX) && !defined (__GNU_LIBRARY__)
|
/* In GNU systems, <dirent.h> defines this macro for us. */
|
||||||
|
#ifdef _D_NAMLEN
|
||||||
|
#undef NAMLEN
|
||||||
|
#define NAMLEN(d) _D_NAMLEN(d)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (defined (POSIX) || defined (WINDOWS32)) && !defined (__GNU_LIBRARY__)
|
||||||
/* Posix does not require that the d_ino field be present, and some
|
/* Posix does not require that the d_ino field be present, and some
|
||||||
systems do not provide it. */
|
systems do not provide it. */
|
||||||
#define REAL_DIR_ENTRY(dp) 1
|
#define REAL_DIR_ENTRY(dp) 1
|
||||||
|
#define FAKE_DIR_ENTRY(dp)
|
||||||
#else
|
#else
|
||||||
#define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
|
#define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
|
||||||
|
#define FAKE_DIR_ENTRY(dp) (dp->d_ino = 1)
|
||||||
#endif /* POSIX */
|
#endif /* POSIX */
|
||||||
|
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
|
/* If it's MSDOS that doesn't have _USE_LFN, disable LFN support. */
|
||||||
|
#ifndef _USE_LFN
|
||||||
|
#define _USE_LFN 0
|
||||||
|
#endif
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
dosify (filename)
|
dosify (filename)
|
||||||
@@ -58,9 +71,11 @@ dosify (filename)
|
|||||||
char *df;
|
char *df;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (filename == 0)
|
if (filename == 0 || _USE_LFN)
|
||||||
return 0;
|
return filename;
|
||||||
|
|
||||||
|
/* FIXME: what about filenames which violate
|
||||||
|
8+3 constraints, like "config.h.in", or ".emacs"? */
|
||||||
if (strpbrk (filename, "\"*+,;<=>?[\\]|") != 0)
|
if (strpbrk (filename, "\"*+,;<=>?[\\]|") != 0)
|
||||||
return filename;
|
return filename;
|
||||||
|
|
||||||
@@ -88,7 +103,99 @@ dosify (filename)
|
|||||||
*df = 0;
|
*df = 0;
|
||||||
return dos_filename;
|
return dos_filename;
|
||||||
}
|
}
|
||||||
|
#endif /* __MSDOS__ */
|
||||||
|
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
#include "pathstuff.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _AMIGA
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
static char *
|
||||||
|
amigafy (filename)
|
||||||
|
char *filename;
|
||||||
|
{
|
||||||
|
static char amiga_filename[136];
|
||||||
|
char *df;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (filename == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
df = amiga_filename;
|
||||||
|
|
||||||
|
/* First, transform the name part. */
|
||||||
|
for (i = 0; *filename != '\0'; ++i)
|
||||||
|
{
|
||||||
|
*df++ = tolower (*filename);
|
||||||
|
++filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
*df = 0;
|
||||||
|
|
||||||
|
return amiga_filename;
|
||||||
|
}
|
||||||
|
#endif /* _AMIGA */
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
|
||||||
|
static int
|
||||||
|
vms_hash (name)
|
||||||
|
char *name;
|
||||||
|
{
|
||||||
|
int h = 0;
|
||||||
|
int g;
|
||||||
|
|
||||||
|
while (*name)
|
||||||
|
{
|
||||||
|
h = (h << 4) + *name++;
|
||||||
|
g = h & 0xf0000000;
|
||||||
|
if (g)
|
||||||
|
{
|
||||||
|
h = h ^ (g >> 24);
|
||||||
|
h = h ^ g;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* fake stat entry for a directory */
|
||||||
|
static int
|
||||||
|
vmsstat_dir (name, st)
|
||||||
|
char *name;
|
||||||
|
struct stat *st;
|
||||||
|
{
|
||||||
|
char *s;
|
||||||
|
int h;
|
||||||
|
DIR *dir;
|
||||||
|
|
||||||
|
dir = opendir (name);
|
||||||
|
if (dir == 0)
|
||||||
|
return -1;
|
||||||
|
closedir (dir);
|
||||||
|
s = strchr (name, ':'); /* find device */
|
||||||
|
if (s)
|
||||||
|
{
|
||||||
|
*s++ = 0;
|
||||||
|
st->st_dev = (char *)vms_hash (name);
|
||||||
|
h = vms_hash (s);
|
||||||
|
*(s-1) = ':';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
st->st_dev = 0;
|
||||||
|
s = name;
|
||||||
|
h = vms_hash (s);
|
||||||
|
}
|
||||||
|
|
||||||
|
st->st_ino[0] = h & 0xff;
|
||||||
|
st->st_ino[1] = h & 0xff00;
|
||||||
|
st->st_ino[2] = h >> 16;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif /* VMS */
|
||||||
|
|
||||||
/* Hash table of directories. */
|
/* Hash table of directories. */
|
||||||
|
|
||||||
@@ -100,8 +207,29 @@ struct directory_contents
|
|||||||
{
|
{
|
||||||
struct directory_contents *next;
|
struct directory_contents *next;
|
||||||
|
|
||||||
int dev, ino; /* Device and inode numbers of this dir. */
|
dev_t dev; /* Device and inode numbers of this dir. */
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
/*
|
||||||
|
* Inode means nothing on WINDOWS32. Even file key information is
|
||||||
|
* unreliable because it is random per file open and undefined
|
||||||
|
* for remote filesystems. The most unique attribute I can
|
||||||
|
* come up with is the fully qualified name of the directory. Beware
|
||||||
|
* though, this is also unreliable. I'm open to suggestion on a better
|
||||||
|
* way to emulate inode.
|
||||||
|
*/
|
||||||
|
char *path_key;
|
||||||
|
int mtime; /* controls check for stale directory cache */
|
||||||
|
int fs_flags; /* FS_FAT, FS_NTFS, ... */
|
||||||
|
#define FS_FAT 0x1
|
||||||
|
#define FS_NTFS 0x2
|
||||||
|
#define FS_UNKNOWN 0x4
|
||||||
|
#else
|
||||||
|
#ifdef VMS
|
||||||
|
ino_t ino[3];
|
||||||
|
#else
|
||||||
|
ino_t ino;
|
||||||
|
#endif
|
||||||
|
#endif /* WINDOWS32 */
|
||||||
struct dirfile **files; /* Files in this directory. */
|
struct dirfile **files; /* Files in this directory. */
|
||||||
DIR *dirstream; /* Stream reading this directory. */
|
DIR *dirstream; /* Stream reading this directory. */
|
||||||
};
|
};
|
||||||
@@ -145,7 +273,8 @@ struct dirfile
|
|||||||
#define DIRFILE_BUCKETS 107
|
#define DIRFILE_BUCKETS 107
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int dir_contents_file_exists_p ();
|
static int dir_contents_file_exists_p PARAMS ((struct directory_contents *dir, char *filename));
|
||||||
|
static struct directory *find_directory PARAMS ((char *name));
|
||||||
|
|
||||||
/* Find the directory named NAME and return its `struct directory'. */
|
/* Find the directory named NAME and return its `struct directory'. */
|
||||||
|
|
||||||
@@ -156,13 +285,27 @@ find_directory (name)
|
|||||||
register unsigned int hash = 0;
|
register unsigned int hash = 0;
|
||||||
register char *p;
|
register char *p;
|
||||||
register struct directory *dir;
|
register struct directory *dir;
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
char* w32_path;
|
||||||
|
char fs_label[BUFSIZ];
|
||||||
|
char fs_type[BUFSIZ];
|
||||||
|
long fs_serno;
|
||||||
|
long fs_flags;
|
||||||
|
long fs_len;
|
||||||
|
#endif
|
||||||
|
#ifdef VMS
|
||||||
|
if ((*name == '.') && (*(name+1) == 0))
|
||||||
|
name = "[]";
|
||||||
|
else
|
||||||
|
name = vmsify (name,1);
|
||||||
|
#endif
|
||||||
|
|
||||||
for (p = name; *p != '\0'; ++p)
|
for (p = name; *p != '\0'; ++p)
|
||||||
HASH (hash, *p);
|
HASHI (hash, *p);
|
||||||
hash %= DIRECTORY_BUCKETS;
|
hash %= DIRECTORY_BUCKETS;
|
||||||
|
|
||||||
for (dir = directories[hash]; dir != 0; dir = dir->next)
|
for (dir = directories[hash]; dir != 0; dir = dir->next)
|
||||||
if (streq (dir->name, name))
|
if (strieq (dir->name, name))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (dir == 0)
|
if (dir == 0)
|
||||||
@@ -179,21 +322,50 @@ find_directory (name)
|
|||||||
/* The directory is not in the name hash table.
|
/* The directory is not in the name hash table.
|
||||||
Find its device and inode numbers, and look it up by them. */
|
Find its device and inode numbers, and look it up by them. */
|
||||||
|
|
||||||
if (safe_stat (name, &st) < 0)
|
#ifdef VMS
|
||||||
|
if (vmsstat_dir (name, &st) < 0)
|
||||||
|
#else
|
||||||
|
if (stat (name, &st) < 0)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
/* Couldn't stat the directory. Mark this by
|
/* Couldn't stat the directory. Mark this by
|
||||||
setting the `contents' member to a nil pointer. */
|
setting the `contents' member to a nil pointer. */
|
||||||
dir->contents = 0;
|
dir->contents = 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Search the contents hash table; device and inode are the key. */
|
/* Search the contents hash table; device and inode are the key. */
|
||||||
|
|
||||||
struct directory_contents *dc;
|
struct directory_contents *dc;
|
||||||
|
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
w32_path = w32ify(name, 1);
|
||||||
|
hash = ((unsigned int) st.st_dev << 16) | (unsigned int) st.st_ctime;
|
||||||
|
#else
|
||||||
|
#ifdef VMS
|
||||||
|
hash = ((unsigned int) st.st_dev << 16)
|
||||||
|
| ((unsigned int) st.st_ino[0]
|
||||||
|
+ (unsigned int) st.st_ino[1]
|
||||||
|
+ (unsigned int) st.st_ino[2]);
|
||||||
|
#else
|
||||||
hash = ((unsigned int) st.st_dev << 16) | (unsigned int) st.st_ino;
|
hash = ((unsigned int) st.st_dev << 16) | (unsigned int) st.st_ino;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
hash %= DIRECTORY_BUCKETS;
|
hash %= DIRECTORY_BUCKETS;
|
||||||
|
|
||||||
for (dc = directories_contents[hash]; dc != 0; dc = dc->next)
|
for (dc = directories_contents[hash]; dc != 0; dc = dc->next)
|
||||||
if (dc->dev == st.st_dev && dc->ino == st.st_ino)
|
#ifdef WINDOWS32
|
||||||
|
if (!strcmp(dc->path_key, w32_path))
|
||||||
|
#else
|
||||||
|
if (dc->dev == st.st_dev
|
||||||
|
#ifdef VMS
|
||||||
|
&& dc->ino[0] == st.st_ino[0]
|
||||||
|
&& dc->ino[1] == st.st_ino[1]
|
||||||
|
&& dc->ino[2] == st.st_ino[2])
|
||||||
|
#else
|
||||||
|
&& dc->ino == st.st_ino)
|
||||||
|
#endif
|
||||||
|
#endif /* WINDOWS32 */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (dc == 0)
|
if (dc == 0)
|
||||||
@@ -205,15 +377,46 @@ find_directory (name)
|
|||||||
|
|
||||||
/* Enter it in the contents hash table. */
|
/* Enter it in the contents hash table. */
|
||||||
dc->dev = st.st_dev;
|
dc->dev = st.st_dev;
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
dc->path_key = strdup(w32_path);
|
||||||
|
dc->mtime = st.st_mtime;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NTFS is the only WINDOWS32 filesystem that bumps mtime
|
||||||
|
* on a directory when files are added/deleted from
|
||||||
|
* a directory.
|
||||||
|
*/
|
||||||
|
w32_path[3] = '\0';
|
||||||
|
if (GetVolumeInformation(w32_path,
|
||||||
|
fs_label, sizeof (fs_label),
|
||||||
|
&fs_serno, &fs_len,
|
||||||
|
&fs_flags, fs_type, sizeof (fs_type)) == FALSE)
|
||||||
|
dc->fs_flags = FS_UNKNOWN;
|
||||||
|
else if (!strcmp(fs_type, "FAT"))
|
||||||
|
dc->fs_flags = FS_FAT;
|
||||||
|
else if (!strcmp(fs_type, "NTFS"))
|
||||||
|
dc->fs_flags = FS_NTFS;
|
||||||
|
else
|
||||||
|
dc->fs_flags = FS_UNKNOWN;
|
||||||
|
#else
|
||||||
|
#ifdef VMS
|
||||||
|
dc->ino[0] = st.st_ino[0];
|
||||||
|
dc->ino[1] = st.st_ino[1];
|
||||||
|
dc->ino[2] = st.st_ino[2];
|
||||||
|
#else
|
||||||
dc->ino = st.st_ino;
|
dc->ino = st.st_ino;
|
||||||
|
#endif
|
||||||
|
#endif /* WINDOWS32 */
|
||||||
dc->next = directories_contents[hash];
|
dc->next = directories_contents[hash];
|
||||||
directories_contents[hash] = dc;
|
directories_contents[hash] = dc;
|
||||||
|
|
||||||
dc->dirstream = opendir (name);
|
dc->dirstream = opendir (name);
|
||||||
if (dc->dirstream == 0)
|
if (dc->dirstream == 0)
|
||||||
|
{
|
||||||
/* Couldn't open the directory. Mark this by
|
/* Couldn't open the directory. Mark this by
|
||||||
setting the `files' member to a nil pointer. */
|
setting the `files' member to a nil pointer. */
|
||||||
dc->files = 0;
|
dc->files = 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Allocate an array of buckets for files and zero it. */
|
/* Allocate an array of buckets for files and zero it. */
|
||||||
@@ -251,21 +454,36 @@ dir_contents_file_exists_p (dir, filename)
|
|||||||
register char *p;
|
register char *p;
|
||||||
register struct dirfile *df;
|
register struct dirfile *df;
|
||||||
register struct dirent *d;
|
register struct dirent *d;
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
struct stat st;
|
||||||
|
int rehash = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (dir == 0 || dir->files == 0)
|
if (dir == 0 || dir->files == 0)
|
||||||
|
{
|
||||||
/* The directory could not be stat'd or opened. */
|
/* The directory could not be stat'd or opened. */
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
filename = dosify (filename);
|
filename = dosify (filename);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _AMIGA
|
||||||
|
filename = amigafy (filename);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
filename = vmsify (filename,0);
|
||||||
|
#endif
|
||||||
|
|
||||||
hash = 0;
|
hash = 0;
|
||||||
if (filename != 0)
|
if (filename != 0)
|
||||||
{
|
{
|
||||||
if (*filename == '\0')
|
if (*filename == '\0')
|
||||||
|
{
|
||||||
/* Checking if the directory exists. */
|
/* Checking if the directory exists. */
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
for (p = filename; *p != '\0'; ++p)
|
for (p = filename; *p != '\0'; ++p)
|
||||||
HASH (hash, *p);
|
HASH (hash, *p);
|
||||||
@@ -274,16 +492,45 @@ dir_contents_file_exists_p (dir, filename)
|
|||||||
/* Search the list of hashed files. */
|
/* Search the list of hashed files. */
|
||||||
|
|
||||||
for (df = dir->files[hash]; df != 0; df = df->next)
|
for (df = dir->files[hash]; df != 0; df = df->next)
|
||||||
if (streq (df->name, filename))
|
{
|
||||||
return !df->impossible;
|
if (strieq (df->name, filename))
|
||||||
|
{
|
||||||
|
return !df->impossible;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The file was not found in the hashed list.
|
/* The file was not found in the hashed list.
|
||||||
Try to read the directory further. */
|
Try to read the directory further. */
|
||||||
|
|
||||||
if (dir->dirstream == 0)
|
if (dir->dirstream == 0)
|
||||||
|
{
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
/*
|
||||||
|
* Check to see if directory has changed since last read. FAT
|
||||||
|
* filesystems force a rehash always as mtime does not change
|
||||||
|
* on directories (ugh!).
|
||||||
|
*/
|
||||||
|
if (dir->path_key &&
|
||||||
|
(dir->fs_flags & FS_FAT ||
|
||||||
|
(stat(dir->path_key, &st) == 0 &&
|
||||||
|
st.st_mtime > dir->mtime))) {
|
||||||
|
|
||||||
|
/* reset date stamp to show most recent re-process */
|
||||||
|
dir->mtime = st.st_mtime;
|
||||||
|
|
||||||
|
/* make sure directory can still be opened */
|
||||||
|
dir->dirstream = opendir(dir->path_key);
|
||||||
|
|
||||||
|
if (dir->dirstream)
|
||||||
|
rehash = 1;
|
||||||
|
else
|
||||||
|
return 0; /* couldn't re-read - fail */
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
/* The directory has been all read in. */
|
/* The directory has been all read in. */
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
while ((d = readdir (dir->dirstream)) != 0)
|
while ((d = readdir (dir->dirstream)) != 0)
|
||||||
{
|
{
|
||||||
@@ -295,24 +542,43 @@ dir_contents_file_exists_p (dir, filename)
|
|||||||
if (!REAL_DIR_ENTRY (d))
|
if (!REAL_DIR_ENTRY (d))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
len = D_NAMLEN (d);
|
len = NAMLEN (d);
|
||||||
while (d->d_name[len - 1] == '\0')
|
|
||||||
--len;
|
|
||||||
|
|
||||||
for (i = 0; i < len; ++i)
|
for (i = 0; i < len; ++i)
|
||||||
HASH (newhash, d->d_name[i]);
|
HASHI (newhash, d->d_name[i]);
|
||||||
newhash %= DIRFILE_BUCKETS;
|
newhash %= DIRFILE_BUCKETS;
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
/*
|
||||||
|
* If re-reading a directory, check that this file isn't already
|
||||||
|
* in the cache.
|
||||||
|
*/
|
||||||
|
if (rehash) {
|
||||||
|
for (df = dir->files[newhash]; df != 0; df = df->next)
|
||||||
|
if (streq(df->name, d->d_name))
|
||||||
|
break;
|
||||||
|
} else
|
||||||
|
df = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If re-reading a directory, don't cache files that have
|
||||||
|
* already been discovered.
|
||||||
|
*/
|
||||||
|
if (!df) {
|
||||||
|
#endif
|
||||||
|
|
||||||
df = (struct dirfile *) xmalloc (sizeof (struct dirfile));
|
df = (struct dirfile *) xmalloc (sizeof (struct dirfile));
|
||||||
df->next = dir->files[newhash];
|
df->next = dir->files[newhash];
|
||||||
dir->files[newhash] = df;
|
dir->files[newhash] = df;
|
||||||
df->name = savestring (d->d_name, len);
|
df->name = savestring (d->d_name, len);
|
||||||
df->impossible = 0;
|
df->impossible = 0;
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
}
|
||||||
|
#endif
|
||||||
/* Check if the name matches the one we're searching for. */
|
/* Check if the name matches the one we're searching for. */
|
||||||
if (filename != 0
|
if (filename != 0
|
||||||
&& newhash == hash && streq (d->d_name, filename))
|
&& newhash == hash && strieq (d->d_name, filename))
|
||||||
return 1;
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the directory has been completely read in,
|
/* If the directory has been completely read in,
|
||||||
@@ -323,7 +589,6 @@ dir_contents_file_exists_p (dir, filename)
|
|||||||
closedir (dir->dirstream);
|
closedir (dir->dirstream);
|
||||||
dir->dirstream = 0;
|
dir->dirstream = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,13 +619,39 @@ file_exists_p (name)
|
|||||||
return ar_member_date (name) != (time_t) -1;
|
return ar_member_date (name) != (time_t) -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
dirend = rindex (name, ']');
|
||||||
|
dirend++;
|
||||||
|
if (dirend == (char *)1)
|
||||||
|
return dir_file_exists_p ("[]", name);
|
||||||
|
#else /* !VMS */
|
||||||
dirend = rindex (name, '/');
|
dirend = rindex (name, '/');
|
||||||
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|
/* Forward and backslashes might be mixed. We need the rightmost one. */
|
||||||
|
{
|
||||||
|
char *bslash = rindex(name, '\\');
|
||||||
|
if (!dirend || bslash > dirend)
|
||||||
|
dirend = bslash;
|
||||||
|
/* The case of "d:file" is unhandled. But I don't think
|
||||||
|
such names can happen here. */
|
||||||
|
}
|
||||||
|
#endif /* WINDOWS32 || __MSDOS__ */
|
||||||
if (dirend == 0)
|
if (dirend == 0)
|
||||||
|
#ifndef _AMIGA
|
||||||
return dir_file_exists_p (".", name);
|
return dir_file_exists_p (".", name);
|
||||||
|
#else /* !VMS && !AMIGA */
|
||||||
|
return dir_file_exists_p ("", name);
|
||||||
|
#endif /* AMIGA */
|
||||||
|
#endif /* VMS */
|
||||||
|
|
||||||
dirname = (char *) alloca (dirend - name + 1);
|
if (dirend == name)
|
||||||
bcopy (name, dirname, dirend - name);
|
dirname = "/";
|
||||||
dirname[dirend - name] = '\0';
|
else
|
||||||
|
{
|
||||||
|
dirname = (char *) alloca (dirend - name + 1);
|
||||||
|
bcopy (name, dirname, dirend - name);
|
||||||
|
dirname[dirend - name] = '\0';
|
||||||
|
}
|
||||||
return dir_file_exists_p (dirname, dirend + 1);
|
return dir_file_exists_p (dirname, dirend + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -378,20 +669,47 @@ file_impossible (filename)
|
|||||||
register struct directory *dir;
|
register struct directory *dir;
|
||||||
register struct dirfile *new;
|
register struct dirfile *new;
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
dirend = rindex (p, ']');
|
||||||
|
dirend++;
|
||||||
|
if (dirend == (char *)1)
|
||||||
|
dir = find_directory ("[]");
|
||||||
|
#else
|
||||||
dirend = rindex (p, '/');
|
dirend = rindex (p, '/');
|
||||||
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|
/* Forward and backslashes might be mixed. We need the rightmost one. */
|
||||||
|
{
|
||||||
|
char *bslash = rindex(p, '\\');
|
||||||
|
if (!dirend || bslash > dirend)
|
||||||
|
dirend = bslash;
|
||||||
|
/* The case of "d:file" is unhandled. But I don't think
|
||||||
|
such names can happen here. */
|
||||||
|
}
|
||||||
|
#endif /* WINDOWS32 or __MSDOS__ */
|
||||||
if (dirend == 0)
|
if (dirend == 0)
|
||||||
|
#ifdef _AMIGA
|
||||||
|
dir = find_directory ("");
|
||||||
|
#else /* !VMS && !AMIGA */
|
||||||
dir = find_directory (".");
|
dir = find_directory (".");
|
||||||
|
#endif /* AMIGA */
|
||||||
|
#endif /* VMS */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *dirname = (char *) alloca (dirend - p + 1);
|
char *dirname;
|
||||||
bcopy (p, dirname, dirend - p);
|
if (dirend == p)
|
||||||
dirname[dirend - p] = '\0';
|
dirname = "/";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dirname = (char *) alloca (dirend - p + 1);
|
||||||
|
bcopy (p, dirname, dirend - p);
|
||||||
|
dirname[dirend - p] = '\0';
|
||||||
|
}
|
||||||
dir = find_directory (dirname);
|
dir = find_directory (dirname);
|
||||||
filename = p = dirend + 1;
|
filename = p = dirend + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (hash = 0; *p != '\0'; ++p)
|
for (hash = 0; *p != '\0'; ++p)
|
||||||
HASH (hash, *p);
|
HASHI (hash, *p);
|
||||||
hash %= DIRFILE_BUCKETS;
|
hash %= DIRFILE_BUCKETS;
|
||||||
|
|
||||||
if (dir->contents == 0)
|
if (dir->contents == 0)
|
||||||
@@ -400,7 +718,18 @@ file_impossible (filename)
|
|||||||
structure for it, but leave it out of the contents hash table. */
|
structure for it, but leave it out of the contents hash table. */
|
||||||
dir->contents = (struct directory_contents *)
|
dir->contents = (struct directory_contents *)
|
||||||
xmalloc (sizeof (struct directory_contents));
|
xmalloc (sizeof (struct directory_contents));
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
dir->contents->path_key = NULL;
|
||||||
|
dir->contents->mtime = 0;
|
||||||
|
#else /* WINDOWS32 */
|
||||||
|
#ifdef VMS
|
||||||
|
dir->contents->dev = 0;
|
||||||
|
dir->contents->ino[0] = dir->contents->ino[1] =
|
||||||
|
dir->contents->ino[2] = 0;
|
||||||
|
#else
|
||||||
dir->contents->dev = dir->contents->ino = 0;
|
dir->contents->dev = dir->contents->ino = 0;
|
||||||
|
#endif
|
||||||
|
#endif /* WINDOWS32 */
|
||||||
dir->contents->files = 0;
|
dir->contents->files = 0;
|
||||||
dir->contents->dirstream = 0;
|
dir->contents->dirstream = 0;
|
||||||
}
|
}
|
||||||
@@ -435,16 +764,42 @@ file_impossible_p (filename)
|
|||||||
register struct directory_contents *dir;
|
register struct directory_contents *dir;
|
||||||
register struct dirfile *next;
|
register struct dirfile *next;
|
||||||
|
|
||||||
dirend = rindex (filename, '/');
|
#ifdef VMS
|
||||||
|
dirend = rindex (filename, ']');
|
||||||
if (dirend == 0)
|
if (dirend == 0)
|
||||||
|
dir = find_directory ("[]")->contents;
|
||||||
|
#else
|
||||||
|
dirend = rindex (filename, '/');
|
||||||
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|
/* Forward and backslashes might be mixed. We need the rightmost one. */
|
||||||
|
{
|
||||||
|
char *bslash = rindex(filename, '\\');
|
||||||
|
if (!dirend || bslash > dirend)
|
||||||
|
dirend = bslash;
|
||||||
|
/* The case of "d:file" is unhandled. But I don't think
|
||||||
|
such names can happen here. */
|
||||||
|
}
|
||||||
|
#endif /* WINDOWS32 || __MSDOS__ */
|
||||||
|
if (dirend == 0)
|
||||||
|
#ifdef _AMIGA
|
||||||
|
dir = find_directory ("")->contents;
|
||||||
|
#else /* !VMS && !AMIGA */
|
||||||
dir = find_directory (".")->contents;
|
dir = find_directory (".")->contents;
|
||||||
|
#endif /* AMIGA */
|
||||||
|
#endif /* VMS */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *dirname = (char *) alloca (dirend - filename + 1);
|
char *dirname;
|
||||||
bcopy (p, dirname, dirend - p);
|
if (dirend == filename)
|
||||||
dirname[dirend - p] = '\0';
|
dirname = "/";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dirname = (char *) alloca (dirend - filename + 1);
|
||||||
|
bcopy (p, dirname, dirend - p);
|
||||||
|
dirname[dirend - p] = '\0';
|
||||||
|
}
|
||||||
dir = find_directory (dirname)->contents;
|
dir = find_directory (dirname)->contents;
|
||||||
p = dirend + 1;
|
p = filename = dirend + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dir == 0 || dir->files == 0)
|
if (dir == 0 || dir->files == 0)
|
||||||
@@ -454,13 +809,19 @@ file_impossible_p (filename)
|
|||||||
#ifdef __MSDOS__
|
#ifdef __MSDOS__
|
||||||
p = filename = dosify (p);
|
p = filename = dosify (p);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef _AMIGA
|
||||||
|
p = filename = amigafy (p);
|
||||||
|
#endif
|
||||||
|
#ifdef VMS
|
||||||
|
p = filename = vmsify (p, 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
for (hash = 0; *p != '\0'; ++p)
|
for (hash = 0; *p != '\0'; ++p)
|
||||||
HASH (hash, *p);
|
HASH (hash, *p);
|
||||||
hash %= DIRFILE_BUCKETS;
|
hash %= DIRFILE_BUCKETS;
|
||||||
|
|
||||||
for (next = dir->files[hash]; next != 0; next = next->next)
|
for (next = dir->files[hash]; next != 0; next = next->next)
|
||||||
if (streq (filename, next->name))
|
if (strieq (filename, next->name))
|
||||||
return next->impossible;
|
return next->impossible;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -494,8 +855,21 @@ print_dir_data_base ()
|
|||||||
if (dir->contents == 0)
|
if (dir->contents == 0)
|
||||||
printf ("# %s: could not be stat'd.\n", dir->name);
|
printf ("# %s: could not be stat'd.\n", dir->name);
|
||||||
else if (dir->contents->files == 0)
|
else if (dir->contents->files == 0)
|
||||||
printf ("# %s (device %d, inode %d): could not be opened.\n",
|
#ifdef WINDOWS32
|
||||||
dir->name, dir->contents->dev, dir->contents->ino);
|
printf ("# %s (key %s, mtime %d): could not be opened.\n",
|
||||||
|
dir->name, dir->contents->path_key,dir->contents->mtime);
|
||||||
|
#else /* WINDOWS32 */
|
||||||
|
#ifdef VMS
|
||||||
|
printf ("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n",
|
||||||
|
dir->name, dir->contents->dev,
|
||||||
|
dir->contents->ino[0], dir->contents->ino[1],
|
||||||
|
dir->contents->ino[2]);
|
||||||
|
#else
|
||||||
|
printf ("# %s (device %ld, inode %ld): could not be opened.\n",
|
||||||
|
dir->name, (long int) dir->contents->dev,
|
||||||
|
(long int) dir->contents->ino);
|
||||||
|
#endif
|
||||||
|
#endif /* WINDOWS32 */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
register unsigned int f = 0, im = 0;
|
register unsigned int f = 0, im = 0;
|
||||||
@@ -507,8 +881,20 @@ print_dir_data_base ()
|
|||||||
++im;
|
++im;
|
||||||
else
|
else
|
||||||
++f;
|
++f;
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
printf ("# %s (key %s, mtime %d): ",
|
||||||
|
dir->name, dir->contents->path_key, dir->contents->mtime);
|
||||||
|
#else /* WINDOWS32 */
|
||||||
|
#ifdef VMS
|
||||||
|
printf ("# %s (device %d, inode [%d,%d,%d]): ",
|
||||||
|
dir->name, dir->contents->dev,
|
||||||
|
dir->contents->ino[0], dir->contents->ino[1],
|
||||||
|
dir->contents->ino[2]);
|
||||||
|
#else
|
||||||
printf ("# %s (device %d, inode %d): ",
|
printf ("# %s (device %d, inode %d): ",
|
||||||
dir->name, dir->contents->dev, dir->contents->ino);
|
dir->name, dir->contents->dev, dir->contents->ino);
|
||||||
|
#endif
|
||||||
|
#endif /* WINDOWS32 */
|
||||||
if (f == 0)
|
if (f == 0)
|
||||||
fputs ("No", stdout);
|
fputs ("No", stdout);
|
||||||
else
|
else
|
||||||
@@ -556,15 +942,15 @@ struct dirstream
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Forward declarations. */
|
/* Forward declarations. */
|
||||||
static __ptr_t open_dirstream __P ((const char *));
|
static __ptr_t open_dirstream PARAMS ((const char *));
|
||||||
static const char *read_dirstream __P ((__ptr_t));
|
static struct dirent *read_dirstream PARAMS ((__ptr_t));
|
||||||
|
|
||||||
static __ptr_t
|
static __ptr_t
|
||||||
open_dirstream (directory)
|
open_dirstream (directory)
|
||||||
const char *directory;
|
const char *directory;
|
||||||
{
|
{
|
||||||
struct dirstream *new;
|
struct dirstream *new;
|
||||||
struct directory *dir = find_directory (directory);
|
struct directory *dir = find_directory ((char *)directory);
|
||||||
|
|
||||||
if (dir->contents == 0 || dir->contents->files == 0)
|
if (dir->contents == 0 || dir->contents->files == 0)
|
||||||
/* DIR->contents is nil if the directory could not be stat'd.
|
/* DIR->contents is nil if the directory could not be stat'd.
|
||||||
@@ -584,12 +970,14 @@ open_dirstream (directory)
|
|||||||
return (__ptr_t) new;
|
return (__ptr_t) new;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static struct dirent *
|
||||||
read_dirstream (stream)
|
read_dirstream (stream)
|
||||||
__ptr_t stream;
|
__ptr_t stream;
|
||||||
{
|
{
|
||||||
struct dirstream *const ds = (struct dirstream *) stream;
|
struct dirstream *const ds = (struct dirstream *) stream;
|
||||||
register struct dirfile *df;
|
register struct dirfile *df;
|
||||||
|
static char *buf;
|
||||||
|
static unsigned int bufsz;
|
||||||
|
|
||||||
while (ds->bucket < DIRFILE_BUCKETS)
|
while (ds->bucket < DIRFILE_BUCKETS)
|
||||||
{
|
{
|
||||||
@@ -597,7 +985,28 @@ read_dirstream (stream)
|
|||||||
{
|
{
|
||||||
ds->elt = df->next;
|
ds->elt = df->next;
|
||||||
if (!df->impossible)
|
if (!df->impossible)
|
||||||
return df->name;
|
{
|
||||||
|
/* The glob interface wants a `struct dirent',
|
||||||
|
so mock one up. */
|
||||||
|
struct dirent *d;
|
||||||
|
unsigned int len = strlen (df->name) + 1;
|
||||||
|
if (sizeof *d - sizeof d->d_name + len > bufsz)
|
||||||
|
{
|
||||||
|
if (buf != 0)
|
||||||
|
free (buf);
|
||||||
|
bufsz *= 2;
|
||||||
|
if (sizeof *d - sizeof d->d_name + len > bufsz)
|
||||||
|
bufsz = sizeof *d - sizeof d->d_name + len;
|
||||||
|
buf = xmalloc (bufsz);
|
||||||
|
}
|
||||||
|
d = (struct dirent *) buf;
|
||||||
|
FAKE_DIR_ENTRY (d);
|
||||||
|
#ifdef _DIRENT_HAVE_D_NAMLEN
|
||||||
|
d->d_namlen = len - 1;
|
||||||
|
#endif
|
||||||
|
memcpy (d->d_name, df->name, len);
|
||||||
|
return d;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (++ds->bucket == DIRFILE_BUCKETS)
|
if (++ds->bucket == DIRFILE_BUCKETS)
|
||||||
break;
|
break;
|
||||||
@@ -608,9 +1017,16 @@ read_dirstream (stream)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
init_dir ()
|
dir_setup_glob (gl)
|
||||||
|
glob_t *gl;
|
||||||
{
|
{
|
||||||
__glob_opendir_hook = open_dirstream;
|
extern int stat ();
|
||||||
__glob_readdir_hook = read_dirstream;
|
|
||||||
__glob_closedir_hook = (void (*) __P ((__ptr_t stream))) free;
|
/* Bogus sunos4 compiler complains (!) about & before functions. */
|
||||||
|
gl->gl_opendir = open_dirstream;
|
||||||
|
gl->gl_readdir = read_dirstream;
|
||||||
|
gl->gl_closedir = free;
|
||||||
|
gl->gl_stat = stat;
|
||||||
|
/* We don't bother setting gl_lstat, since glob never calls it.
|
||||||
|
The slot is only there for compatibility with 4.4 BSD. */
|
||||||
}
|
}
|
||||||
|
|||||||
42
dosbuild.bat
Normal file
42
dosbuild.bat
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
@echo Building Make for MSDOS
|
||||||
|
@rem Echo ON so they will see what is going on.
|
||||||
|
@echo on
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g commands.c -o commands.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g job.c -o job.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g dir.c -o dir.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g file.c -o file.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g misc.c -o misc.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g main.c -o main.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g read.c -o read.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g remake.c -o remake.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g rule.c -o rule.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g implicit.c -o implicit.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g default.c -o default.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g variable.c -o variable.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g expand.c -o expand.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g function.c -o function.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g vpath.c -o vpath.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g version.c -o version.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g ar.c -o ar.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g arscan.c -o arscan.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g signame.c -o signame.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g remote-stub.c -o remote-stub.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt.c -o getopt.o
|
||||||
|
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt1.c -o getopt1.o
|
||||||
|
@cd glob
|
||||||
|
@if exist libglob.a del libglob.a
|
||||||
|
gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g glob.c -o glob.o
|
||||||
|
gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g fnmatch.c -o fnmatch.o
|
||||||
|
ar rv libglob.a glob.o fnmatch.o
|
||||||
|
@echo off
|
||||||
|
cd ..
|
||||||
|
echo commands.o > respf.$$$
|
||||||
|
for %%f in (job dir file misc main read remake rule implicit default variable) do echo %%f.o >> respf.$$$
|
||||||
|
for %%f in (expand function vpath version ar arscan signame remote-stub getopt getopt1) do echo %%f.o >> respf.$$$
|
||||||
|
echo glob/libglob.a >> respf.$$$
|
||||||
|
@echo Linking...
|
||||||
|
@echo on
|
||||||
|
gcc -o make.new @respf.$$$
|
||||||
|
@if exist make.exe echo Make.exe is now built!
|
||||||
|
@if not exist make.exe echo Make.exe build failed...
|
||||||
|
@if exist make.exe del respf.$$$
|
||||||
211
expand.c
211
expand.c
@@ -1,5 +1,5 @@
|
|||||||
/* Variable expansion functions for GNU Make.
|
/* Variable expansion functions for GNU Make.
|
||||||
Copyright (C) 1988, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
|
Copyright (C) 1988, 89, 91, 92, 93, 95 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -17,8 +17,9 @@ along with GNU Make; see the file COPYING. If not, write to
|
|||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
|
#include "filedef.h"
|
||||||
|
#include "job.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "file.h"
|
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
|
|
||||||
/* The next two describe the variable output buffer.
|
/* The next two describe the variable output buffer.
|
||||||
@@ -197,9 +198,9 @@ variable_expand (line)
|
|||||||
char openparen = *p;
|
char openparen = *p;
|
||||||
char closeparen = (openparen == '(') ? ')' : '}';
|
char closeparen = (openparen == '(') ? ')' : '}';
|
||||||
register char *beg = p + 1;
|
register char *beg = p + 1;
|
||||||
|
int free_beg = 0;
|
||||||
char *op, *begp;
|
char *op, *begp;
|
||||||
char *end;
|
char *end, *colon;
|
||||||
char *colon = 0;
|
|
||||||
|
|
||||||
op = o;
|
op = o;
|
||||||
begp = p;
|
begp = p;
|
||||||
@@ -213,10 +214,18 @@ variable_expand (line)
|
|||||||
/* Is there a variable reference inside the parens or braces?
|
/* Is there a variable reference inside the parens or braces?
|
||||||
If so, expand it before expanding the entire reference. */
|
If so, expand it before expanding the entire reference. */
|
||||||
|
|
||||||
p1 = index (beg, closeparen);
|
end = index (beg, closeparen);
|
||||||
|
if (end == 0)
|
||||||
|
{
|
||||||
|
/* Unterminated variable reference. */
|
||||||
|
if (reading_filename != 0)
|
||||||
|
makefile_fatal (reading_filename, *reading_lineno_ptr,
|
||||||
|
"unterminated variable reference");
|
||||||
|
else
|
||||||
|
fatal ("unterminated variable reference");
|
||||||
|
}
|
||||||
|
p1 = lindex (beg, end, '$');
|
||||||
if (p1 != 0)
|
if (p1 != 0)
|
||||||
p1 = lindex (beg, p1, '$');
|
|
||||||
if (p1 != 0 && lindex (beg, p1, ':') == 0)
|
|
||||||
{
|
{
|
||||||
/* BEG now points past the opening paren or brace.
|
/* BEG now points past the opening paren or brace.
|
||||||
Count parens or braces until it is matched. */
|
Count parens or braces until it is matched. */
|
||||||
@@ -227,133 +236,109 @@ variable_expand (line)
|
|||||||
++count;
|
++count;
|
||||||
else if (*p == closeparen && --count < 0)
|
else if (*p == closeparen && --count < 0)
|
||||||
break;
|
break;
|
||||||
else if (colon == 0 && count == 0 && *p == ':')
|
|
||||||
/* Record where we found a colon, which
|
|
||||||
indicates a substitution reference.
|
|
||||||
We want to expand the text before the
|
|
||||||
reference only. */
|
|
||||||
colon = p;
|
|
||||||
}
|
}
|
||||||
/* If COUNT is >= 0, there were unmatched opening parens
|
/* If COUNT is >= 0, there were unmatched opening parens
|
||||||
or braces, so we go to the simple case of a variable name
|
or braces, so we go to the simple case of a variable name
|
||||||
such as `$($(a)'. */
|
such as `$($(a)'. */
|
||||||
if (count < 0)
|
if (count < 0)
|
||||||
{
|
{
|
||||||
char *name = expand_argument (beg, colon == 0 ? p : colon);
|
beg = expand_argument (beg, p); /* Expand the name. */
|
||||||
unsigned int namelen = strlen (name);
|
free_beg = 1; /* Remember to free BEG when finished. */
|
||||||
if (colon == 0)
|
end = index (beg, '\0');
|
||||||
{
|
|
||||||
/* This is a simple reference to the expanded name. */
|
|
||||||
o = reference_variable (o, name, namelen);
|
|
||||||
free (name);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* This is a substitution reference to the expanded
|
|
||||||
name. We replace the pending text with a copy
|
|
||||||
containing the expanded name in place of the
|
|
||||||
original name, and then fall through to
|
|
||||||
the normal substitution reference code below. */
|
|
||||||
unsigned int restlen = strlen (colon) + 1;
|
|
||||||
beg = (char *) alloca (namelen + restlen);
|
|
||||||
bcopy (name, beg, namelen);
|
|
||||||
bcopy (colon, &beg[namelen], restlen);
|
|
||||||
/* Point COLON into the new copy. */
|
|
||||||
colon = &beg[namelen];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
/* Advance P to the end of this reference. After we are
|
||||||
|
finished expanding this one, P will be incremented to
|
||||||
|
continue the scan. */
|
||||||
|
p = end;
|
||||||
|
|
||||||
/* This is not a reference to a built-in function and
|
/* This is not a reference to a built-in function and
|
||||||
it does not contain any variable references inside.
|
any variable references inside are now expanded.
|
||||||
There are several things it could be. */
|
Is the resultant text a substitution reference? */
|
||||||
|
|
||||||
if (colon == 0)
|
colon = lindex (beg, end, ':');
|
||||||
colon = index (beg, ':');
|
if (colon != 0)
|
||||||
if (colon != 0 && lindex (beg, colon, closeparen) == 0)
|
|
||||||
{
|
{
|
||||||
/* This is a substitution reference: $(FOO:A=B). */
|
/* This looks like a substitution reference: $(FOO:A=B). */
|
||||||
int count;
|
|
||||||
char *subst_beg, *subst_end, *replace_beg, *replace_end;
|
char *subst_beg, *subst_end, *replace_beg, *replace_end;
|
||||||
|
|
||||||
v = lookup_variable (beg, colon - beg);
|
|
||||||
if (v == 0)
|
|
||||||
warn_undefined (beg, colon - beg);
|
|
||||||
|
|
||||||
subst_beg = colon + 1;
|
subst_beg = colon + 1;
|
||||||
count = 0;
|
subst_end = index (subst_beg, '=');
|
||||||
for (p = subst_beg; *p != '\0'; ++p)
|
if (subst_end == 0)
|
||||||
|
/* There is no = in sight. Punt on the substitution
|
||||||
|
reference and treat this as a variable name containing
|
||||||
|
a colon, in the code below. */
|
||||||
|
colon = 0;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (*p == openparen)
|
replace_beg = subst_end + 1;
|
||||||
++count;
|
replace_end = end;
|
||||||
else if (*p == closeparen)
|
|
||||||
--count;
|
/* Extract the variable name before the colon
|
||||||
else if (*p == '=' && count <= 0)
|
and look up that variable. */
|
||||||
break;
|
v = lookup_variable (beg, colon - beg);
|
||||||
|
if (v == 0)
|
||||||
|
warn_undefined (beg, colon - beg);
|
||||||
|
|
||||||
|
if (v != 0 && *v->value != '\0')
|
||||||
|
{
|
||||||
|
char *value = (v->recursive ? recursively_expand (v)
|
||||||
|
: v->value);
|
||||||
|
char *pattern, *percent;
|
||||||
|
if (free_beg)
|
||||||
|
{
|
||||||
|
*subst_end = '\0';
|
||||||
|
pattern = subst_beg;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pattern = (char *) alloca (subst_end - subst_beg
|
||||||
|
+ 1);
|
||||||
|
bcopy (subst_beg, pattern, subst_end - subst_beg);
|
||||||
|
pattern[subst_end - subst_beg] = '\0';
|
||||||
|
}
|
||||||
|
percent = find_percent (pattern);
|
||||||
|
if (percent != 0)
|
||||||
|
{
|
||||||
|
char *replace;
|
||||||
|
if (free_beg)
|
||||||
|
{
|
||||||
|
*replace_end = '\0';
|
||||||
|
replace = replace_beg;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
replace = (char *) alloca (replace_end
|
||||||
|
- replace_beg
|
||||||
|
+ 1);
|
||||||
|
bcopy (replace_beg, replace,
|
||||||
|
replace_end - replace_beg);
|
||||||
|
replace[replace_end - replace_beg] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
o = patsubst_expand (o, value, pattern, replace,
|
||||||
|
percent, (char *) 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
o = subst_expand (o, value,
|
||||||
|
pattern, replace_beg,
|
||||||
|
strlen (pattern),
|
||||||
|
end - replace_beg,
|
||||||
|
0, 1);
|
||||||
|
if (v->recursive)
|
||||||
|
free (value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (count > 0)
|
|
||||||
/* There were unmatched opening parens. */
|
|
||||||
return initialize_variable_output ();
|
|
||||||
subst_end = p;
|
|
||||||
|
|
||||||
replace_beg = p + 1;
|
|
||||||
count = 0;
|
|
||||||
for (p = replace_beg; *p != '\0'; ++p)
|
|
||||||
{
|
|
||||||
if (*p == openparen)
|
|
||||||
++count;
|
|
||||||
else if (*p == closeparen && --count < 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (count > 0)
|
|
||||||
/* There were unmatched opening parens. */
|
|
||||||
return initialize_variable_output ();
|
|
||||||
end = p;
|
|
||||||
replace_end = p;
|
|
||||||
|
|
||||||
p = expand_argument (subst_beg, subst_end);
|
|
||||||
p1 = expand_argument (replace_beg, replace_end);
|
|
||||||
|
|
||||||
if (v != 0 && *v->value != '\0')
|
|
||||||
{
|
|
||||||
char *value = (v->recursive ? recursively_expand (v)
|
|
||||||
: v->value);
|
|
||||||
char *percent = find_percent (p);
|
|
||||||
if (percent != 0)
|
|
||||||
o = patsubst_expand (o, value, p, p1,
|
|
||||||
percent, (char *) 0);
|
|
||||||
else
|
|
||||||
o = subst_expand (o, value,
|
|
||||||
p, p1, strlen (p), strlen (p1),
|
|
||||||
0, 1);
|
|
||||||
if (v->recursive)
|
|
||||||
free (value);
|
|
||||||
}
|
|
||||||
|
|
||||||
free (p);
|
|
||||||
free (p1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No, this must be an ordinary variable reference. */
|
if (colon == 0)
|
||||||
else
|
/* This is an ordinary variable reference.
|
||||||
{
|
Look up the value of the variable. */
|
||||||
/* Look up the value of the variable. */
|
|
||||||
end = index (beg, closeparen);
|
|
||||||
if (end == 0)
|
|
||||||
{
|
|
||||||
/* Unterminated variable reference. */
|
|
||||||
if (reading_filename != 0)
|
|
||||||
makefile_fatal (reading_filename, *reading_lineno_ptr,
|
|
||||||
"unterminated variable reference");
|
|
||||||
else
|
|
||||||
fatal ("unterminated variable reference");
|
|
||||||
}
|
|
||||||
o = reference_variable (o, beg, end - beg);
|
o = reference_variable (o, beg, end - beg);
|
||||||
}
|
|
||||||
|
|
||||||
/* Advance p past the variable reference to resume scan. */
|
if (free_beg)
|
||||||
p = end;
|
free (beg);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
168
file.c
168
file.c
@@ -1,5 +1,5 @@
|
|||||||
/* Target file hash table management for GNU Make.
|
/* Target file hash table management for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -17,10 +17,12 @@ along with GNU Make; see the file COPYING. If not, write to
|
|||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
#include "commands.h"
|
|
||||||
#include "dep.h"
|
#include "dep.h"
|
||||||
#include "file.h"
|
#include "filedef.h"
|
||||||
|
#include "job.h"
|
||||||
|
#include "commands.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
|
||||||
/* Hash table of files the makefile knows how to make. */
|
/* Hash table of files the makefile knows how to make. */
|
||||||
@@ -54,6 +56,10 @@ lookup_file (name)
|
|||||||
/* This is also done in parse_file_seq, so this is redundant
|
/* This is also done in parse_file_seq, so this is redundant
|
||||||
for names read from makefiles. It is here for names passed
|
for names read from makefiles. It is here for names passed
|
||||||
on the command line. */
|
on the command line. */
|
||||||
|
#ifdef VMS
|
||||||
|
while (name[0] == '[' && name[1] == ']' && name[2] != '\0')
|
||||||
|
name += 2;
|
||||||
|
#endif
|
||||||
while (name[0] == '.' && name[1] == '/' && name[2] != '\0')
|
while (name[0] == '.' && name[1] == '/' && name[2] != '\0')
|
||||||
{
|
{
|
||||||
name += 2;
|
name += 2;
|
||||||
@@ -64,16 +70,28 @@ lookup_file (name)
|
|||||||
|
|
||||||
if (*name == '\0')
|
if (*name == '\0')
|
||||||
/* It was all slashes after a dot. */
|
/* It was all slashes after a dot. */
|
||||||
|
#ifdef VMS
|
||||||
|
name = "[]";
|
||||||
|
#else
|
||||||
|
#ifdef _AMIGA
|
||||||
|
name = "";
|
||||||
|
#else
|
||||||
name = "./";
|
name = "./";
|
||||||
|
#endif /* AMIGA */
|
||||||
|
#endif /* VMS */
|
||||||
|
|
||||||
hashval = 0;
|
hashval = 0;
|
||||||
for (n = name; *n != '\0'; ++n)
|
for (n = name; *n != '\0'; ++n)
|
||||||
HASH (hashval, *n);
|
HASHI (hashval, *n);
|
||||||
hashval %= FILE_BUCKETS;
|
hashval %= FILE_BUCKETS;
|
||||||
|
|
||||||
for (f = files[hashval]; f != 0; f = f->next)
|
for (f = files[hashval]; f != 0; f = f->next)
|
||||||
if (streq (f->name, name))
|
{
|
||||||
return f;
|
if (strieq (f->hname, name))
|
||||||
|
{
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,25 +102,46 @@ enter_file (name)
|
|||||||
register struct file *f, *new;
|
register struct file *f, *new;
|
||||||
register char *n;
|
register char *n;
|
||||||
register unsigned int hashval;
|
register unsigned int hashval;
|
||||||
|
#ifdef VMS
|
||||||
|
char *lname, *ln;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (*name == '\0')
|
if (*name == '\0')
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
lname = (char *)malloc (strlen (name) + 1);
|
||||||
|
for (n = name, ln = lname; *n != '\0'; ++n, ++ln)
|
||||||
|
{
|
||||||
|
if (isupper(*n))
|
||||||
|
*ln = tolower(*n);
|
||||||
|
else
|
||||||
|
*ln = *n;
|
||||||
|
}
|
||||||
|
*ln = 0;
|
||||||
|
name = lname;
|
||||||
|
#endif
|
||||||
|
|
||||||
hashval = 0;
|
hashval = 0;
|
||||||
for (n = name; *n != '\0'; ++n)
|
for (n = name; *n != '\0'; ++n)
|
||||||
HASH (hashval, *n);
|
HASHI (hashval, *n);
|
||||||
hashval %= FILE_BUCKETS;
|
hashval %= FILE_BUCKETS;
|
||||||
|
|
||||||
for (f = files[hashval]; f != 0; f = f->next)
|
for (f = files[hashval]; f != 0; f = f->next)
|
||||||
if (streq (f->name, name))
|
if (strieq (f->hname, name))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (f != 0 && !f->double_colon)
|
if (f != 0 && !f->double_colon)
|
||||||
return f;
|
{
|
||||||
|
#ifdef VMS
|
||||||
|
free(lname);
|
||||||
|
#endif
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
|
||||||
new = (struct file *) xmalloc (sizeof (struct file));
|
new = (struct file *) xmalloc (sizeof (struct file));
|
||||||
bzero ((char *) new, sizeof (struct file));
|
bzero ((char *) new, sizeof (struct file));
|
||||||
new->name = name;
|
new->name = new->hname = name;
|
||||||
new->update_status = -1;
|
new->update_status = -1;
|
||||||
|
|
||||||
if (f == 0)
|
if (f == 0)
|
||||||
@@ -123,16 +162,16 @@ enter_file (name)
|
|||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Rename FILE to NAME. This is not as simple as resetting
|
/* Rehash FILE to NAME. This is not as simple as resetting
|
||||||
the `name' member, since it must be put in a new hash bucket,
|
the `hname' member, since it must be put in a new hash bucket,
|
||||||
and possibly merged with an existing file called NAME. */
|
and possibly merged with an existing file called NAME. */
|
||||||
|
|
||||||
void
|
void
|
||||||
rename_file (file, name)
|
rehash_file (file, name)
|
||||||
register struct file *file;
|
register struct file *file;
|
||||||
char *name;
|
char *name;
|
||||||
{
|
{
|
||||||
char *oldname = file->name;
|
char *oldname = file->hname;
|
||||||
register unsigned int oldhash;
|
register unsigned int oldhash;
|
||||||
register char *n;
|
register char *n;
|
||||||
|
|
||||||
@@ -143,11 +182,28 @@ rename_file (file, name)
|
|||||||
|
|
||||||
oldhash = 0;
|
oldhash = 0;
|
||||||
for (n = oldname; *n != '\0'; ++n)
|
for (n = oldname; *n != '\0'; ++n)
|
||||||
HASH (oldhash, *n);
|
HASHI (oldhash, *n);
|
||||||
|
|
||||||
file_hash_enter (file, name, oldhash, file->name);
|
file_hash_enter (file, name, oldhash, file->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Rename FILE to NAME. This is not as simple as resetting
|
||||||
|
the `name' member, since it must be put in a new hash bucket,
|
||||||
|
and possibly merged with an existing file called NAME. */
|
||||||
|
|
||||||
|
void
|
||||||
|
rename_file (file, name)
|
||||||
|
register struct file *file;
|
||||||
|
char *name;
|
||||||
|
{
|
||||||
|
rehash_file(file, name);
|
||||||
|
while (file)
|
||||||
|
{
|
||||||
|
file->name = file->hname;
|
||||||
|
file = file->prev;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
file_hash_enter (file, name, oldhash, oldname)
|
file_hash_enter (file, name, oldhash, oldname)
|
||||||
register struct file *file;
|
register struct file *file;
|
||||||
@@ -163,15 +219,18 @@ file_hash_enter (file, name, oldhash, oldname)
|
|||||||
|
|
||||||
newhash = 0;
|
newhash = 0;
|
||||||
for (n = name; *n != '\0'; ++n)
|
for (n = name; *n != '\0'; ++n)
|
||||||
HASH (newhash, *n);
|
HASHI (newhash, *n);
|
||||||
newbucket = newhash % FILE_BUCKETS;
|
newbucket = newhash % FILE_BUCKETS;
|
||||||
|
|
||||||
/* Look for an existing file under the new name. */
|
/* Look for an existing file under the new name. */
|
||||||
|
|
||||||
for (oldfile = files[newbucket]; oldfile != 0; oldfile = oldfile->next)
|
for (oldfile = files[newbucket]; oldfile != 0; oldfile = oldfile->next)
|
||||||
if (streq (oldfile->name, name))
|
if (strieq (oldfile->hname, name))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* If the old file is the same as the new file, something's wrong. */
|
||||||
|
assert (oldfile != file);
|
||||||
|
|
||||||
if (oldhash != 0 && (newbucket != oldbucket || oldfile != 0))
|
if (oldhash != 0 && (newbucket != oldbucket || oldfile != 0))
|
||||||
{
|
{
|
||||||
/* Remove FILE from its hash bucket. */
|
/* Remove FILE from its hash bucket. */
|
||||||
@@ -189,9 +248,9 @@ file_hash_enter (file, name, oldhash, oldname)
|
|||||||
|
|
||||||
/* Give FILE its new name. */
|
/* Give FILE its new name. */
|
||||||
|
|
||||||
file->name = name;
|
file->hname = name;
|
||||||
for (f = file->double_colon; f != 0; f = f->prev)
|
for (f = file->double_colon; f != 0; f = f->prev)
|
||||||
f->name = name;
|
f->hname = name;
|
||||||
|
|
||||||
if (oldfile == 0)
|
if (oldfile == 0)
|
||||||
{
|
{
|
||||||
@@ -256,12 +315,17 @@ in favor of those for `%s'.",
|
|||||||
|
|
||||||
merge_variable_set_lists (&oldfile->variables, file->variables);
|
merge_variable_set_lists (&oldfile->variables, file->variables);
|
||||||
|
|
||||||
if (oldfile->double_colon && !file->double_colon)
|
if (oldfile->double_colon && file->is_target && !file->double_colon)
|
||||||
fatal ("can't rename single-colon `%s' to double-colon `%s'",
|
fatal ("can't rename single-colon `%s' to double-colon `%s'",
|
||||||
oldname, name);
|
oldname, name);
|
||||||
if (!oldfile->double_colon && file->double_colon)
|
if (!oldfile->double_colon && file->double_colon)
|
||||||
fatal ("can't rename double-colon `%s' to single-colon `%s'",
|
{
|
||||||
oldname, name);
|
if (oldfile->is_target)
|
||||||
|
fatal ("can't rename double-colon `%s' to single-colon `%s'",
|
||||||
|
oldname, name);
|
||||||
|
else
|
||||||
|
oldfile->double_colon = file->double_colon;
|
||||||
|
}
|
||||||
|
|
||||||
if (file->last_mtime > oldfile->last_mtime)
|
if (file->last_mtime > oldfile->last_mtime)
|
||||||
/* %%% Kludge so -W wins on a file that gets vpathized. */
|
/* %%% Kludge so -W wins on a file that gets vpathized. */
|
||||||
@@ -275,6 +339,7 @@ in favor of those for `%s'.",
|
|||||||
MERGE (is_target);
|
MERGE (is_target);
|
||||||
MERGE (cmd_target);
|
MERGE (cmd_target);
|
||||||
MERGE (phony);
|
MERGE (phony);
|
||||||
|
MERGE (ignore_vpath);
|
||||||
#undef MERGE
|
#undef MERGE
|
||||||
|
|
||||||
file->renamed = oldfile;
|
file->renamed = oldfile;
|
||||||
@@ -294,16 +359,23 @@ remove_intermediates (sig)
|
|||||||
register struct file *f;
|
register struct file *f;
|
||||||
char doneany;
|
char doneany;
|
||||||
|
|
||||||
if (!sig && just_print_flag)
|
if (question_flag || touch_flag)
|
||||||
|
return;
|
||||||
|
if (sig && just_print_flag)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
doneany = 0;
|
doneany = 0;
|
||||||
for (i = 0; i < FILE_BUCKETS; ++i)
|
for (i = 0; i < FILE_BUCKETS; ++i)
|
||||||
for (f = files[i]; f != 0; f = f->next)
|
for (f = files[i]; f != 0; f = f->next)
|
||||||
if (f->intermediate && (f->dontcare || !f->precious))
|
if (f->intermediate && (f->dontcare || !f->precious)
|
||||||
|
&& !f->secondary)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
if (just_print_flag)
|
if (f->update_status == -1)
|
||||||
|
/* If nothing would have created this file yet,
|
||||||
|
don't print an "rm" command for it. */
|
||||||
|
continue;
|
||||||
|
else if (just_print_flag)
|
||||||
status = 0;
|
status = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -342,7 +414,8 @@ remove_intermediates (sig)
|
|||||||
/* For each dependency of each file, make the `struct dep' point
|
/* For each dependency of each file, make the `struct dep' point
|
||||||
at the appropriate `struct file' (which may have to be created).
|
at the appropriate `struct file' (which may have to be created).
|
||||||
|
|
||||||
Also mark the files depended on by .PRECIOUS and .PHONY. */
|
Also mark the files depended on by .PRECIOUS, .PHONY, .SILENT,
|
||||||
|
and various other special targets. */
|
||||||
|
|
||||||
void
|
void
|
||||||
snap_deps ()
|
snap_deps ()
|
||||||
@@ -380,6 +453,41 @@ snap_deps ()
|
|||||||
f2->last_mtime = (time_t) -1;
|
f2->last_mtime = (time_t) -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (f = lookup_file (".INTERMEDIATE"); f != 0; f = f->prev)
|
||||||
|
{
|
||||||
|
/* .INTERMEDIATE with deps listed
|
||||||
|
marks those deps as intermediate files. */
|
||||||
|
for (d = f->deps; d != 0; d = d->next)
|
||||||
|
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||||
|
f2->intermediate = 1;
|
||||||
|
/* .INTERMEDIATE with no deps does nothing.
|
||||||
|
Marking all files as intermediates is useless
|
||||||
|
since the goal targets would be deleted after they are built. */
|
||||||
|
}
|
||||||
|
|
||||||
|
for (f = lookup_file (".SECONDARY"); f != 0; f = f->prev)
|
||||||
|
{
|
||||||
|
/* .SECONDARY with deps listed
|
||||||
|
marks those deps as intermediate files
|
||||||
|
in that they don't get rebuilt if not actually needed;
|
||||||
|
but unlike real intermediate files,
|
||||||
|
these are not deleted after make finishes. */
|
||||||
|
if (f->deps)
|
||||||
|
{
|
||||||
|
for (d = f->deps; d != 0; d = d->next)
|
||||||
|
for (f2 = d->file; f2 != 0; f2 = f2->prev)
|
||||||
|
f2->intermediate = f2->secondary = 1;
|
||||||
|
}
|
||||||
|
/* .SECONDARY with no deps listed marks *all* files that way. */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < FILE_BUCKETS; i++)
|
||||||
|
for (f2 = files[i]; f2; f2= f2->next)
|
||||||
|
f2->intermediate = f2->secondary = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
f = lookup_file (".EXPORT_ALL_VARIABLES");
|
f = lookup_file (".EXPORT_ALL_VARIABLES");
|
||||||
if (f != 0 && f->is_target)
|
if (f != 0 && f->is_target)
|
||||||
export_all_variables = 1;
|
export_all_variables = 1;
|
||||||
@@ -491,6 +599,10 @@ print_file (f)
|
|||||||
puts ("# Successfully updated.");
|
puts ("# Successfully updated.");
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
assert (question_flag);
|
||||||
|
puts ("# Needs to be updated (-q is set).");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
puts ("# Failed to be updated.");
|
puts ("# Failed to be updated.");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -553,3 +665,5 @@ print_file_data_base ()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Definition of target file data structures for GNU Make.
|
/* Definition of target file data structures for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -24,6 +24,8 @@ struct file
|
|||||||
{
|
{
|
||||||
struct file *next;
|
struct file *next;
|
||||||
char *name;
|
char *name;
|
||||||
|
char *hname; /* Hashed filename */
|
||||||
|
char *vpath; /* VPATH/vpath pathname */
|
||||||
struct dep *deps;
|
struct dep *deps;
|
||||||
struct commands *cmds; /* Commands to execute for this target. */
|
struct commands *cmds; /* Commands to execute for this target. */
|
||||||
int command_flags; /* Flags OR'd in for cmds; see commands.h. */
|
int command_flags; /* Flags OR'd in for cmds; see commands.h. */
|
||||||
@@ -72,8 +74,12 @@ struct file
|
|||||||
unsigned int phony:1; /* Nonzero if this is a phony file
|
unsigned int phony:1; /* Nonzero if this is a phony file
|
||||||
i.e., a dependency of .PHONY. */
|
i.e., a dependency of .PHONY. */
|
||||||
unsigned int intermediate:1;/* Nonzero if this is an intermediate file. */
|
unsigned int intermediate:1;/* Nonzero if this is an intermediate file. */
|
||||||
|
/* Nonzero, for an intermediate file,
|
||||||
|
means remove_intermediates should not delete it. */
|
||||||
|
unsigned int secondary:1;
|
||||||
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
|
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
|
||||||
this target cannot be remade. */
|
this target cannot be remade. */
|
||||||
|
unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Number of intermediate files entered. */
|
/* Number of intermediate files entered. */
|
||||||
@@ -85,15 +91,21 @@ extern struct file *default_goal_file, *suffix_file, *default_file;
|
|||||||
|
|
||||||
extern struct file *lookup_file (), *enter_file ();
|
extern struct file *lookup_file (), *enter_file ();
|
||||||
extern void remove_intermediates (), snap_deps ();
|
extern void remove_intermediates (), snap_deps ();
|
||||||
extern void rename_file (), file_hash_enter ();
|
extern void rename_file (), rehash_file (), file_hash_enter ();
|
||||||
extern void set_command_state ();
|
extern void set_command_state ();
|
||||||
|
|
||||||
|
|
||||||
|
/* Return the mtime of file F (a struct file *), caching it.
|
||||||
|
The value is -1 if the file does not exist. */
|
||||||
|
#define file_mtime(f) file_mtime_1 ((f), 1)
|
||||||
|
/* Return the mtime of file F (a struct file *), caching it.
|
||||||
|
Don't search using vpath for the file--if it doesn't actually exist,
|
||||||
|
we don't find it.
|
||||||
|
The value is -1 if the file does not exist. */
|
||||||
|
#define file_mtime_no_search(f) file_mtime_1 ((f), 0)
|
||||||
extern time_t f_mtime ();
|
extern time_t f_mtime ();
|
||||||
#define file_mtime_1(f, v) \
|
#define file_mtime_1(f, v) \
|
||||||
((f)->last_mtime != (time_t) 0 ? (f)->last_mtime : f_mtime ((f), v))
|
((f)->last_mtime != (time_t) 0 ? (f)->last_mtime : f_mtime ((f), v))
|
||||||
#define file_mtime(f) file_mtime_1 ((f), 1)
|
|
||||||
#define file_mtime_no_search(f) file_mtime_1 ((f), 0)
|
|
||||||
|
|
||||||
/* Modtime value to use for `infinitely new'. We used to get the current time
|
/* Modtime value to use for `infinitely new'. We used to get the current time
|
||||||
from the system and use that whenever we wanted `new'. But that causes
|
from the system and use that whenever we wanted `new'. But that causes
|
||||||
@@ -102,10 +114,12 @@ extern time_t f_mtime ();
|
|||||||
targets, which need to be considered newer than anything that depends on
|
targets, which need to be considered newer than anything that depends on
|
||||||
them, even if said dependents' modtimes are in the future.
|
them, even if said dependents' modtimes are in the future.
|
||||||
|
|
||||||
NOTE: This assumes 32-bit `time_t's, but I cannot think of a portable way
|
If time_t is unsigned, its maximum value is the same as "(time_t) -1",
|
||||||
to produce the largest representable integer of a given signed type. */
|
so use one less than that, because -1 is used for non-existing files. */
|
||||||
#define NEW_MTIME ((time_t) 0x7fffffff)
|
#define NEW_MTIME \
|
||||||
|
(INTEGER_TYPE_SIGNED (time_t) \
|
||||||
|
? INTEGER_TYPE_MAXIMUM (time_t) \
|
||||||
|
: (INTEGER_TYPE_MAXIMUM (time_t) - 1))
|
||||||
|
|
||||||
#define check_renamed(file) \
|
#define check_renamed(file) \
|
||||||
while ((file)->renamed != 0) (file) = (file)->renamed /* No ; here. */
|
while ((file)->renamed != 0) (file) = (file)->renamed /* No ; here. */
|
||||||
446
function.c
446
function.c
@@ -1,5 +1,5 @@
|
|||||||
/* Variable function expansion for GNU Make.
|
/* Variable function expansion for GNU Make.
|
||||||
Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -17,16 +17,22 @@ along with GNU Make; see the file COPYING. If not, write to
|
|||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
|
#include "filedef.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#include "dep.h"
|
#include "dep.h"
|
||||||
#include "commands.h"
|
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
|
#include "commands.h"
|
||||||
|
|
||||||
#ifdef __MSDOS__
|
#ifdef _AMIGA
|
||||||
#include <process.h>
|
#include "amiga.h"
|
||||||
|
#endif
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
#include <windows.h>
|
||||||
|
#include <io.h>
|
||||||
|
#include "sub_proc.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char *string_glob ();
|
static char *string_glob PARAMS ((char *line));
|
||||||
|
|
||||||
/* Store into VARIABLE_BUFFER at O the result of scanning TEXT and replacing
|
/* Store into VARIABLE_BUFFER at O the result of scanning TEXT and replacing
|
||||||
each occurrence of SUBST with REPLACE. TEXT is null-terminated. SLEN is
|
each occurrence of SUBST with REPLACE. TEXT is null-terminated. SLEN is
|
||||||
@@ -112,9 +118,9 @@ patsubst_expand (o, text, pattern, replace, pattern_percent, replace_percent)
|
|||||||
register char *pattern, *replace;
|
register char *pattern, *replace;
|
||||||
register char *pattern_percent, *replace_percent;
|
register char *pattern_percent, *replace_percent;
|
||||||
{
|
{
|
||||||
register int pattern_prepercent_len, pattern_postpercent_len;
|
unsigned int pattern_prepercent_len, pattern_postpercent_len;
|
||||||
register int replace_prepercent_len, replace_postpercent_len;
|
unsigned int replace_prepercent_len, replace_postpercent_len;
|
||||||
register char *t;
|
char *t;
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
int doneany = 0;
|
int doneany = 0;
|
||||||
|
|
||||||
@@ -154,14 +160,14 @@ patsubst_expand (o, text, pattern, replace, pattern_percent, replace_percent)
|
|||||||
if (len < pattern_prepercent_len + pattern_postpercent_len)
|
if (len < pattern_prepercent_len + pattern_postpercent_len)
|
||||||
fail = 1;
|
fail = 1;
|
||||||
|
|
||||||
/* Does the prefix match? */
|
/* Does the prefix match? */
|
||||||
if (!fail && pattern_prepercent_len > 0
|
if (!fail && pattern_prepercent_len > 0
|
||||||
&& (*t != *pattern
|
&& (*t != *pattern
|
||||||
|| t[pattern_prepercent_len - 1] != pattern_percent[-1]
|
|| t[pattern_prepercent_len - 1] != pattern_percent[-1]
|
||||||
|| strncmp (t + 1, pattern + 1, pattern_prepercent_len - 1)))
|
|| strncmp (t + 1, pattern + 1, pattern_prepercent_len - 1)))
|
||||||
fail = 1;
|
fail = 1;
|
||||||
|
|
||||||
/* Does the suffix match? */
|
/* Does the suffix match? */
|
||||||
if (!fail && pattern_postpercent_len > 0
|
if (!fail && pattern_postpercent_len > 0
|
||||||
&& (t[len - 1] != pattern_percent[pattern_postpercent_len]
|
&& (t[len - 1] != pattern_percent[pattern_postpercent_len]
|
||||||
|| t[len - pattern_postpercent_len] != pattern_percent[1]
|
|| t[len - pattern_postpercent_len] != pattern_percent[1]
|
||||||
@@ -225,6 +231,7 @@ enum function
|
|||||||
function_firstword,
|
function_firstword,
|
||||||
function_word,
|
function_word,
|
||||||
function_words,
|
function_words,
|
||||||
|
function_wordlist,
|
||||||
function_findstring,
|
function_findstring,
|
||||||
function_strip,
|
function_strip,
|
||||||
function_join,
|
function_join,
|
||||||
@@ -261,6 +268,7 @@ static struct
|
|||||||
{ "firstword", 9, function_firstword },
|
{ "firstword", 9, function_firstword },
|
||||||
{ "word", 4, function_word },
|
{ "word", 4, function_word },
|
||||||
{ "words", 5, function_words },
|
{ "words", 5, function_words },
|
||||||
|
{ "wordlist", 8, function_wordlist },
|
||||||
{ "findstring", 10, function_findstring },
|
{ "findstring", 10, function_findstring },
|
||||||
{ "strip", 5, function_strip },
|
{ "strip", 5, function_strip },
|
||||||
{ "join", 4, function_join },
|
{ "join", 4, function_join },
|
||||||
@@ -310,12 +318,12 @@ int shell_function_pid = 0, shell_function_completed;
|
|||||||
The output is written into VARIABLE_BUFFER starting at O. */
|
The output is written into VARIABLE_BUFFER starting at O. */
|
||||||
|
|
||||||
/* Note this absorbs a semicolon and is safe to use in conditionals. */
|
/* Note this absorbs a semicolon and is safe to use in conditionals. */
|
||||||
#define BADARGS(func) \
|
#define BADARGS(func) \
|
||||||
if (reading_filename != 0) \
|
if (reading_filename != 0) \
|
||||||
makefile_fatal (reading_filename, *reading_lineno_ptr, \
|
makefile_fatal (reading_filename, *reading_lineno_ptr, \
|
||||||
"insufficient arguments to function `%s'", \
|
"insufficient arguments to function `%s'", \
|
||||||
func); \
|
func); \
|
||||||
else \
|
else \
|
||||||
fatal ("insufficient arguments to function `%s'", func)
|
fatal ("insufficient arguments to function `%s'", func)
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
@@ -326,7 +334,7 @@ expand_function (o, function, text, end)
|
|||||||
char *end;
|
char *end;
|
||||||
{
|
{
|
||||||
char *p, *p2, *p3;
|
char *p, *p2, *p3;
|
||||||
unsigned int i, len;
|
unsigned int i, j, len;
|
||||||
int doneany = 0;
|
int doneany = 0;
|
||||||
int count;
|
int count;
|
||||||
char endparen = *end, startparen = *end == ')' ? '(' : '{';
|
char endparen = *end, startparen = *end == ')' ? '(' : '{';
|
||||||
@@ -337,23 +345,42 @@ expand_function (o, function, text, end)
|
|||||||
abort ();
|
abort ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifndef VMS /* not supported for vms yet */
|
||||||
case function_shell:
|
case function_shell:
|
||||||
{
|
{
|
||||||
char **argv, **envp;
|
#ifdef WINDOWS32
|
||||||
|
SECURITY_ATTRIBUTES saAttr;
|
||||||
|
HANDLE hIn;
|
||||||
|
HANDLE hErr;
|
||||||
|
HANDLE hChildOutRd;
|
||||||
|
HANDLE hChildOutWr;
|
||||||
|
HANDLE hProcess;
|
||||||
|
#endif
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
FILE *fpipe;
|
||||||
|
#endif
|
||||||
|
char **argv;
|
||||||
char *error_prefix;
|
char *error_prefix;
|
||||||
|
#ifndef _AMIGA
|
||||||
|
char **envp;
|
||||||
int pipedes[2];
|
int pipedes[2];
|
||||||
int pid;
|
int pid;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Expand the command line. */
|
/* Expand the command line. */
|
||||||
text = expand_argument (text, end);
|
text = expand_argument (text, end);
|
||||||
|
|
||||||
|
#ifndef __MSDOS__
|
||||||
/* Construct the argument list. */
|
/* Construct the argument list. */
|
||||||
argv = construct_command_argv (text, (char *) NULL, (struct file *) 0);
|
argv = construct_command_argv (text,
|
||||||
|
(char **) NULL, (struct file *) 0);
|
||||||
if (argv == 0)
|
if (argv == 0)
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _AMIGA
|
||||||
/* Using a target environment for `shell' loses in cases like:
|
/* Using a target environment for `shell' loses in cases like:
|
||||||
export var = $(shell echo foobie)
|
export var = $(shell echo foobie)
|
||||||
because target_environment hits a loop trying to expand $(var)
|
because target_environment hits a loop trying to expand $(var)
|
||||||
to put it in the environment. This is even more confusing when
|
to put it in the environment. This is even more confusing when
|
||||||
var was not explicitly exported, but just appeared in the
|
var was not explicitly exported, but just appeared in the
|
||||||
@@ -364,6 +391,7 @@ expand_function (o, function, text, end)
|
|||||||
/* Construct the environment. */
|
/* Construct the environment. */
|
||||||
envp = target_environment ((struct file *) 0);
|
envp = target_environment ((struct file *) 0);
|
||||||
#endif
|
#endif
|
||||||
|
#endif /* Not Amiga. */
|
||||||
|
|
||||||
/* For error messages. */
|
/* For error messages. */
|
||||||
if (reading_filename != 0)
|
if (reading_filename != 0)
|
||||||
@@ -375,29 +403,129 @@ expand_function (o, function, text, end)
|
|||||||
else
|
else
|
||||||
error_prefix = "";
|
error_prefix = "";
|
||||||
|
|
||||||
#ifndef __MSDOS__
|
#ifndef _AMIGA
|
||||||
|
# ifdef WINDOWS32
|
||||||
|
saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||||
|
saAttr.bInheritHandle = TRUE;
|
||||||
|
saAttr.lpSecurityDescriptor = NULL;
|
||||||
|
|
||||||
|
if (DuplicateHandle(GetCurrentProcess(),
|
||||||
|
GetStdHandle(STD_INPUT_HANDLE),
|
||||||
|
GetCurrentProcess(),
|
||||||
|
&hIn,
|
||||||
|
0,
|
||||||
|
TRUE,
|
||||||
|
DUPLICATE_SAME_ACCESS) == FALSE) {
|
||||||
|
fatal("create_child_process: DuplicateHandle(In) failed (e=%d)\n",
|
||||||
|
GetLastError());
|
||||||
|
}
|
||||||
|
if (DuplicateHandle(GetCurrentProcess(),
|
||||||
|
GetStdHandle(STD_ERROR_HANDLE),
|
||||||
|
GetCurrentProcess(),
|
||||||
|
&hErr,
|
||||||
|
0,
|
||||||
|
TRUE,
|
||||||
|
DUPLICATE_SAME_ACCESS) == FALSE) {
|
||||||
|
fatal("create_child_process: DuplicateHandle(Err) failed (e=%d)\n",
|
||||||
|
GetLastError());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!CreatePipe(&hChildOutRd, &hChildOutWr, &saAttr, 0))
|
||||||
|
fatal("CreatePipe() failed (e=%d)\n", GetLastError());
|
||||||
|
|
||||||
|
hProcess = process_init_fd(hIn, hChildOutWr, hErr);
|
||||||
|
|
||||||
|
if (!hProcess)
|
||||||
|
fatal("expand_function: process_init_fd() failed\n");
|
||||||
|
else
|
||||||
|
process_register(hProcess);
|
||||||
|
|
||||||
|
/* make sure that CreateProcess() has Path it needs */
|
||||||
|
sync_Path_environment();
|
||||||
|
|
||||||
|
if (!process_begin(hProcess, argv, envp, argv[0], NULL))
|
||||||
|
pid = (int) hProcess;
|
||||||
|
else
|
||||||
|
fatal("expand_function: unable to launch process (e=%d)\n",
|
||||||
|
process_last_err(hProcess));
|
||||||
|
|
||||||
|
/* set up to read data from child */
|
||||||
|
pipedes[0] = _open_osfhandle((long) hChildOutRd, O_RDONLY);
|
||||||
|
|
||||||
|
/* this will be closed almost right away */
|
||||||
|
pipedes[1] = _open_osfhandle((long) hChildOutWr, O_APPEND);
|
||||||
|
# else /* WINDOWS32 */
|
||||||
|
# ifdef __MSDOS__
|
||||||
|
{
|
||||||
|
/* MSDOS can't fork, but it has `popen'.
|
||||||
|
(Bwt, why isn't `popen' used in all the versions?) */
|
||||||
|
struct variable *sh = lookup_variable ("SHELL", 5);
|
||||||
|
int e;
|
||||||
|
extern int dos_command_running, dos_status;
|
||||||
|
|
||||||
|
/* Make sure not to bother processing an empty line. */
|
||||||
|
while (isblank (*text))
|
||||||
|
++text;
|
||||||
|
if (*text == '\0')
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (sh)
|
||||||
|
{
|
||||||
|
char buf[PATH_MAX + 7];
|
||||||
|
/* This makes sure $SHELL value is used by $(shell), even
|
||||||
|
though the target environment is not passed to it. */
|
||||||
|
sprintf (buf, "SHELL=%s", sh->value);
|
||||||
|
putenv (buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
e = errno;
|
||||||
|
errno = 0;
|
||||||
|
dos_command_running = 1;
|
||||||
|
dos_status = 0;
|
||||||
|
fpipe = popen (text, "rt");
|
||||||
|
dos_command_running = 0;
|
||||||
|
if (!fpipe || dos_status)
|
||||||
|
{
|
||||||
|
pipedes[0] = -1;
|
||||||
|
pid = -1;
|
||||||
|
if (dos_status)
|
||||||
|
errno = EINTR;
|
||||||
|
else if (errno == 0)
|
||||||
|
errno = ENOMEM;
|
||||||
|
shell_function_completed = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pipedes[0] = fileno (fpipe);
|
||||||
|
pid = 42;
|
||||||
|
errno = e;
|
||||||
|
shell_function_completed = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pipedes[0] < 0)
|
||||||
|
# else /* ! __MSDOS__ */
|
||||||
if (pipe (pipedes) < 0)
|
if (pipe (pipedes) < 0)
|
||||||
|
# endif /* __MSDOS__ */
|
||||||
{
|
{
|
||||||
perror_with_name (error_prefix, "pipe");
|
perror_with_name (error_prefix, "pipe");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ifndef __MSDOS__
|
||||||
pid = vfork ();
|
pid = vfork ();
|
||||||
if (pid < 0)
|
if (pid < 0)
|
||||||
perror_with_name (error_prefix, "fork");
|
perror_with_name (error_prefix, "fork");
|
||||||
else if (pid == 0)
|
else if (pid == 0)
|
||||||
child_execute_job (0, pipedes[1], argv, envp);
|
child_execute_job (0, pipedes[1], argv, envp);
|
||||||
else
|
else
|
||||||
|
# endif /* ! __MSDOS__ */
|
||||||
|
# endif /* WINDOWS32 */
|
||||||
{
|
{
|
||||||
/* We are the parent. */
|
/* We are the parent. */
|
||||||
|
|
||||||
char *buffer;
|
char *buffer;
|
||||||
unsigned int maxlen;
|
unsigned int maxlen;
|
||||||
int cc;
|
int cc;
|
||||||
|
|
||||||
/* Free the storage only the child needed. */
|
|
||||||
free (argv[0]);
|
|
||||||
free ((char *) argv);
|
|
||||||
#if 0
|
#if 0
|
||||||
for (i = 0; envp[i] != 0; ++i)
|
for (i = 0; envp[i] != 0; ++i)
|
||||||
free (envp[i]);
|
free (envp[i]);
|
||||||
@@ -406,17 +534,22 @@ expand_function (o, function, text, end)
|
|||||||
|
|
||||||
/* Record the PID for reap_children. */
|
/* Record the PID for reap_children. */
|
||||||
shell_function_pid = pid;
|
shell_function_pid = pid;
|
||||||
|
#ifndef __MSDOS__
|
||||||
shell_function_completed = 0;
|
shell_function_completed = 0;
|
||||||
|
|
||||||
|
/* Free the storage only the child needed. */
|
||||||
|
free (argv[0]);
|
||||||
|
free ((char *) argv);
|
||||||
|
|
||||||
|
/* Close the write side of the pipe. */
|
||||||
|
(void) close (pipedes[1]);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Set up and read from the pipe. */
|
/* Set up and read from the pipe. */
|
||||||
|
|
||||||
maxlen = 200;
|
maxlen = 200;
|
||||||
buffer = (char *) xmalloc (maxlen + 1);
|
buffer = (char *) xmalloc (maxlen + 1);
|
||||||
|
|
||||||
/* Close the write side of the pipe. */
|
|
||||||
(void) close (pipedes[1]);
|
|
||||||
|
|
||||||
/* Read from the pipe until it gets EOF. */
|
/* Read from the pipe until it gets EOF. */
|
||||||
i = 0;
|
i = 0;
|
||||||
do
|
do
|
||||||
@@ -439,7 +572,12 @@ expand_function (o, function, text, end)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Close the read side of the pipe. */
|
/* Close the read side of the pipe. */
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
if (fpipe)
|
||||||
|
(void) pclose (fpipe);
|
||||||
|
#else
|
||||||
(void) close (pipedes[0]);
|
(void) close (pipedes[0]);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Loop until child_handler sets shell_function_completed
|
/* Loop until child_handler sets shell_function_completed
|
||||||
to the status of our child shell. */
|
to the status of our child shell. */
|
||||||
@@ -468,48 +606,80 @@ expand_function (o, function, text, end)
|
|||||||
if (i > 0)
|
if (i > 0)
|
||||||
{
|
{
|
||||||
if (buffer[i - 1] == '\n')
|
if (buffer[i - 1] == '\n')
|
||||||
buffer[--i] = '\0';
|
{
|
||||||
|
if (i > 1 && buffer[i - 2] == '\r')
|
||||||
|
--i;
|
||||||
|
buffer[--i] = '\0';
|
||||||
|
}
|
||||||
else
|
else
|
||||||
buffer[i] = '\0';
|
buffer[i] = '\0';
|
||||||
|
|
||||||
p = buffer;
|
p = buffer;
|
||||||
while ((p = index (p, '\n')) != 0)
|
for (p2=p; *p != '\0'; ++p)
|
||||||
*p++ = ' ';
|
{
|
||||||
|
if (p[0] == '\r' && p[1] == '\n')
|
||||||
|
continue;
|
||||||
|
if (*p == '\n')
|
||||||
|
*p2++ = ' ';
|
||||||
|
else
|
||||||
|
*p2++ = *p;
|
||||||
|
}
|
||||||
|
*p2 = '\0';
|
||||||
o = variable_buffer_output (o, buffer, i);
|
o = variable_buffer_output (o, buffer, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free (buffer);
|
free (buffer);
|
||||||
}
|
}
|
||||||
#else /* MSDOS. */
|
#else /* Amiga */
|
||||||
{
|
{
|
||||||
/* MS-DOS can't do fork, but it can do spawn. However, this
|
/* Amiga can't fork nor spawn, but I can start a program with
|
||||||
means that we don't have an opportunity to reopen stdout to
|
redirection of my choice. However, this means that we
|
||||||
trap it. Thus, we save our own stdout onto a new descriptor
|
don't have an opportunity to reopen stdout to trap it. Thus,
|
||||||
and dup a temp file's descriptor onto our stdout temporarily.
|
we save our own stdout onto a new descriptor and dup a temp
|
||||||
After we spawn the shell program, we dup our own stdout back
|
file's descriptor onto our stdout temporarily. After we
|
||||||
to the stdout descriptor. The buffer reading is the same as
|
spawn the shell program, we dup our own stdout back to the
|
||||||
above, except that we're now reading from a file. */
|
stdout descriptor. The buffer reading is the same as above,
|
||||||
|
except that we're now reading from a file. */
|
||||||
|
#include <dos/dos.h>
|
||||||
|
#include <proto/dos.h>
|
||||||
|
|
||||||
int save_stdout;
|
BPTR child_stdout;
|
||||||
int child_stdout;
|
|
||||||
char tmp_output[FILENAME_MAX];
|
char tmp_output[FILENAME_MAX];
|
||||||
FILE *child_stream;
|
|
||||||
unsigned int maxlen = 200;
|
unsigned int maxlen = 200;
|
||||||
int cc;
|
int cc;
|
||||||
char *buffer;
|
char * buffer, * ptr;
|
||||||
|
char ** aptr;
|
||||||
|
int len = 0;
|
||||||
|
|
||||||
strcpy (tmp_output, "shXXXXXX");
|
strcpy (tmp_output, "t:MakeshXXXXXXXX");
|
||||||
mktemp (tmp_output);
|
mktemp (tmp_output);
|
||||||
child_stdout = open (tmp_output,
|
child_stdout = Open (tmp_output, MODE_NEWFILE);
|
||||||
O_WRONLY|O_CREAT|O_TRUNC|O_TEXT, 0644);
|
|
||||||
save_stdout = dup (1);
|
|
||||||
dup2 (child_stdout, 1);
|
|
||||||
spawnvp (P_WAIT, argv[0], argv);
|
|
||||||
dup2 (save_stdout, 1);
|
|
||||||
close (child_stdout);
|
|
||||||
close (save_stdout);
|
|
||||||
|
|
||||||
child_stdout = open (tmp_output, O_RDONLY|O_TEXT, 0644);
|
for (aptr=argv; *aptr; aptr++)
|
||||||
|
{
|
||||||
|
len += strlen (*aptr) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer = xmalloc (len + 1);
|
||||||
|
ptr = buffer;
|
||||||
|
|
||||||
|
for (aptr=argv; *aptr; aptr++)
|
||||||
|
{
|
||||||
|
strcpy (ptr, *aptr);
|
||||||
|
ptr += strlen (ptr) + 1;
|
||||||
|
*ptr ++ = ' ';
|
||||||
|
*ptr = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ptr[-1] = '\n';
|
||||||
|
|
||||||
|
Execute (buffer, NULL, child_stdout);
|
||||||
|
free (buffer);
|
||||||
|
|
||||||
|
Close (child_stdout);
|
||||||
|
|
||||||
|
child_stdout = Open (tmp_output, MODE_OLDFILE);
|
||||||
|
|
||||||
buffer = xmalloc (maxlen);
|
buffer = xmalloc (maxlen);
|
||||||
i = 0;
|
i = 0;
|
||||||
@@ -521,13 +691,13 @@ expand_function (o, function, text, end)
|
|||||||
buffer = (char *) xrealloc (buffer, maxlen + 1);
|
buffer = (char *) xrealloc (buffer, maxlen + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
cc = read (child_stdout, &buffer[i], maxlen - i);
|
cc = Read (child_stdout, &buffer[i], maxlen - i);
|
||||||
if (cc > 0)
|
if (cc > 0)
|
||||||
i += cc;
|
i += cc;
|
||||||
} while (cc > 0);
|
} while (cc > 0);
|
||||||
|
|
||||||
close (child_stdout);
|
Close (child_stdout);
|
||||||
unlink (tmp_output);
|
DeleteFile (tmp_output);
|
||||||
|
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
{
|
{
|
||||||
@@ -542,11 +712,12 @@ expand_function (o, function, text, end)
|
|||||||
}
|
}
|
||||||
free (buffer);
|
free (buffer);
|
||||||
}
|
}
|
||||||
#endif /* Not MSDOS. */
|
#endif /* Not Amiga. */
|
||||||
|
|
||||||
free (text);
|
free (text);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif /* !VMS */
|
||||||
|
|
||||||
case function_origin:
|
case function_origin:
|
||||||
/* Expand the argument. */
|
/* Expand the argument. */
|
||||||
@@ -891,8 +1062,15 @@ expand_function (o, function, text, end)
|
|||||||
text = expand_argument (text, end);
|
text = expand_argument (text, end);
|
||||||
|
|
||||||
p2 = text;
|
p2 = text;
|
||||||
while ((p = find_next_token (&p2, &i)) != 0)
|
while (*p2 != '\0')
|
||||||
{
|
{
|
||||||
|
while (isspace(*p2))
|
||||||
|
++p2;
|
||||||
|
p = p2;
|
||||||
|
for (i=0; *p2 != '\0' && !isspace(*p2); ++p2, ++i)
|
||||||
|
{}
|
||||||
|
if (!i)
|
||||||
|
break;
|
||||||
o = variable_buffer_output (o, p, i);
|
o = variable_buffer_output (o, p, i);
|
||||||
o = variable_buffer_output (o, " ", 1);
|
o = variable_buffer_output (o, " ", 1);
|
||||||
doneany = 1;
|
doneany = 1;
|
||||||
@@ -907,8 +1085,12 @@ expand_function (o, function, text, end)
|
|||||||
case function_wildcard:
|
case function_wildcard:
|
||||||
text = expand_argument (text, end);
|
text = expand_argument (text, end);
|
||||||
|
|
||||||
|
#ifdef _AMIGA
|
||||||
|
o = wildcard_expansion (text, o);
|
||||||
|
#else
|
||||||
p = string_glob (text);
|
p = string_glob (text);
|
||||||
o = variable_buffer_output (o, p, strlen (p));
|
o = variable_buffer_output (o, p, strlen (p));
|
||||||
|
#endif
|
||||||
|
|
||||||
free (text);
|
free (text);
|
||||||
break;
|
break;
|
||||||
@@ -1035,6 +1217,91 @@ index argument");
|
|||||||
free (text);
|
free (text);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case function_wordlist:
|
||||||
|
/* Get two comma-separated arguments and expand each one. */
|
||||||
|
count = 0;
|
||||||
|
for (p = text; p < end; ++p)
|
||||||
|
{
|
||||||
|
if (*p == startparen)
|
||||||
|
++count;
|
||||||
|
else if (*p == endparen)
|
||||||
|
--count;
|
||||||
|
else if (*p == ',' && count <= 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (p == end)
|
||||||
|
BADARGS ("wordlist");
|
||||||
|
text = expand_argument (text, p);
|
||||||
|
|
||||||
|
/* Check the first argument. */
|
||||||
|
for (p2 = text; *p2 != '\0'; ++p2)
|
||||||
|
if (*p2 < '0' || *p2 > '9')
|
||||||
|
{
|
||||||
|
if (reading_filename != 0)
|
||||||
|
makefile_fatal (reading_filename, *reading_lineno_ptr,
|
||||||
|
"non-numeric first argument to `wordlist' function");
|
||||||
|
else
|
||||||
|
fatal ("non-numeric first argument to `wordlist' function");
|
||||||
|
}
|
||||||
|
i = (unsigned int)atoi(text);
|
||||||
|
free (text);
|
||||||
|
|
||||||
|
/* Check the next argument */
|
||||||
|
for (p2 = p + 1; isblank(*p2); ++p2)
|
||||||
|
{}
|
||||||
|
count = 0;
|
||||||
|
for (p = p2; p < end; ++p)
|
||||||
|
{
|
||||||
|
if (*p == startparen)
|
||||||
|
++count;
|
||||||
|
else if (*p == endparen)
|
||||||
|
--count;
|
||||||
|
else if (*p == ',' && count <= 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (p == end)
|
||||||
|
BADARGS ("wordlist");
|
||||||
|
text = expand_argument (p2, p);
|
||||||
|
|
||||||
|
for (p2 = text; *p2 != '\0'; ++p2)
|
||||||
|
if (*p2 < '0' || *p2 > '9')
|
||||||
|
{
|
||||||
|
if (reading_filename != 0)
|
||||||
|
makefile_fatal (reading_filename, *reading_lineno_ptr,
|
||||||
|
"non-numeric second argument to `wordlist' function");
|
||||||
|
else
|
||||||
|
fatal ("non-numeric second argument to `wordlist' function");
|
||||||
|
}
|
||||||
|
j = (unsigned int)atoi(text);
|
||||||
|
free (text);
|
||||||
|
|
||||||
|
if (j > i)
|
||||||
|
j -= i;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unsigned int k;
|
||||||
|
k = j;
|
||||||
|
j = i - j;
|
||||||
|
i = k;
|
||||||
|
}
|
||||||
|
++j;
|
||||||
|
|
||||||
|
/* Extract the requested words */
|
||||||
|
text = expand_argument (p + 1, end);
|
||||||
|
p2 = text;
|
||||||
|
|
||||||
|
while (((p = find_next_token (&p2, &len)) != 0) && --i)
|
||||||
|
{}
|
||||||
|
if (p)
|
||||||
|
{
|
||||||
|
while (--j && (find_next_token (&p2, &len) != 0))
|
||||||
|
{}
|
||||||
|
o = variable_buffer_output (o, p, p2 - p);
|
||||||
|
}
|
||||||
|
|
||||||
|
free (text);
|
||||||
|
break;
|
||||||
|
|
||||||
case function_findstring:
|
case function_findstring:
|
||||||
/* Get two comma-separated arguments and expand each one. */
|
/* Get two comma-separated arguments and expand each one. */
|
||||||
count = 0;
|
count = 0;
|
||||||
@@ -1110,16 +1377,38 @@ index argument");
|
|||||||
while ((p2 = find_next_token (&p3, &len)) != 0)
|
while ((p2 = find_next_token (&p3, &len)) != 0)
|
||||||
{
|
{
|
||||||
p = p2 + len;
|
p = p2 + len;
|
||||||
while (p >= p2 && *p != (function == function_dir ? '/' : '.'))
|
#ifdef VMS
|
||||||
|
while (p >= p2 && *p != ']'
|
||||||
|
&& (function != function_basename || *p != '.'))
|
||||||
|
#else
|
||||||
|
# ifdef __MSDOS__
|
||||||
|
while (p >= p2 && *p != '/' && *p != '\\'
|
||||||
|
&& (function != function_basename || *p != '.'))
|
||||||
|
# else
|
||||||
|
while (p >= p2 && *p != '/'
|
||||||
|
&& (function != function_basename || *p != '.'))
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
--p;
|
--p;
|
||||||
if (p >= p2)
|
if (p >= p2 && (function == function_dir))
|
||||||
{
|
o = variable_buffer_output (o, p2, ++p - p2);
|
||||||
if (function == function_dir)
|
else if (p >= p2 && (*p == '.'))
|
||||||
++p;
|
o = variable_buffer_output (o, p2, p - p2);
|
||||||
o = variable_buffer_output (o, p2, p - p2);
|
#if defined(WINDOWS32) || defined(__MSDOS__)
|
||||||
}
|
/* Handle the "d:foobar" case */
|
||||||
|
else if (p2[0] && p2[1] == ':' && function == function_dir)
|
||||||
|
o = variable_buffer_output (o, p2, 2);
|
||||||
|
#endif
|
||||||
else if (function == function_dir)
|
else if (function == function_dir)
|
||||||
o = variable_buffer_output (o, "./", 2);
|
#ifdef VMS
|
||||||
|
o = variable_buffer_output (o, "[]", 2);
|
||||||
|
#else
|
||||||
|
#ifndef _AMIGA
|
||||||
|
o = variable_buffer_output (o, "./", 2);
|
||||||
|
#else
|
||||||
|
/* o = o */; /* Just a nop... */
|
||||||
|
#endif /* AMIGA */
|
||||||
|
#endif /* !VMS */
|
||||||
else
|
else
|
||||||
/* The entire name is the basename. */
|
/* The entire name is the basename. */
|
||||||
o = variable_buffer_output (o, p2, len);
|
o = variable_buffer_output (o, p2, len);
|
||||||
@@ -1143,14 +1432,35 @@ index argument");
|
|||||||
while ((p2 = find_next_token (&p3, &len)) != 0)
|
while ((p2 = find_next_token (&p3, &len)) != 0)
|
||||||
{
|
{
|
||||||
p = p2 + len;
|
p = p2 + len;
|
||||||
while (p >= p2 && *p != (function == function_notdir ? '/' : '.'))
|
#ifdef VMS
|
||||||
|
while (p >= p2 && *p != ']'
|
||||||
|
&& (function != function_suffix || *p != '.'))
|
||||||
|
#else
|
||||||
|
# ifdef __MSDOS__
|
||||||
|
while (p >= p2 && *p != '/' && *p != '\\'
|
||||||
|
&& (function != function_suffix || *p != '.'))
|
||||||
|
# else
|
||||||
|
while (p >= p2 && *p != '/'
|
||||||
|
&& (function != function_suffix || *p != '.'))
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
--p;
|
--p;
|
||||||
if (p >= p2)
|
if (p >= p2)
|
||||||
{
|
{
|
||||||
if (function == function_notdir)
|
if (function == function_notdir)
|
||||||
++p;
|
++p;
|
||||||
|
else if (*p != '.')
|
||||||
|
continue;
|
||||||
o = variable_buffer_output (o, p, len - (p - p2));
|
o = variable_buffer_output (o, p, len - (p - p2));
|
||||||
}
|
}
|
||||||
|
#if defined(WINDOWS32) || defined(__MSDOS__)
|
||||||
|
/* Handle the case of "d:foo/bar". */
|
||||||
|
else if (function == function_notdir && p2[0] && p2[1] == ':')
|
||||||
|
{
|
||||||
|
p = p2 + 2;
|
||||||
|
o = variable_buffer_output (o, p, len - (p - p2));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
else if (function == function_notdir)
|
else if (function == function_notdir)
|
||||||
o = variable_buffer_output (o, p2, len);
|
o = variable_buffer_output (o, p2, len);
|
||||||
|
|
||||||
|
|||||||
816
getloadavg.c
816
getloadavg.c
File diff suppressed because it is too large
Load Diff
133
getopt.h
Normal file
133
getopt.h
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
/* Declarations for getopt.
|
||||||
|
Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||||
|
Bugs can be reported to bug-glibc@gnu.org.
|
||||||
|
|
||||||
|
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 2, 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, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifndef _GETOPT_H
|
||||||
|
#define _GETOPT_H 1
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* For communication from `getopt' to the caller.
|
||||||
|
When `getopt' finds an option that takes an argument,
|
||||||
|
the argument value is returned here.
|
||||||
|
Also, when `ordering' is RETURN_IN_ORDER,
|
||||||
|
each non-option ARGV-element is returned here. */
|
||||||
|
|
||||||
|
extern char *optarg;
|
||||||
|
|
||||||
|
/* Index in ARGV of the next element to be scanned.
|
||||||
|
This is used for communication to and from the caller
|
||||||
|
and for communication between successive calls to `getopt'.
|
||||||
|
|
||||||
|
On entry to `getopt', zero means this is the first call; initialize.
|
||||||
|
|
||||||
|
When `getopt' returns -1, this is the index of the first of the
|
||||||
|
non-option elements that the caller should itself scan.
|
||||||
|
|
||||||
|
Otherwise, `optind' communicates from one call to the next
|
||||||
|
how much of ARGV has been scanned so far. */
|
||||||
|
|
||||||
|
extern int optind;
|
||||||
|
|
||||||
|
/* Callers store zero here to inhibit the error message `getopt' prints
|
||||||
|
for unrecognized options. */
|
||||||
|
|
||||||
|
extern int opterr;
|
||||||
|
|
||||||
|
/* Set to an option character which was unrecognized. */
|
||||||
|
|
||||||
|
extern int optopt;
|
||||||
|
|
||||||
|
/* Describe the long-named options requested by the application.
|
||||||
|
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
|
||||||
|
of `struct option' terminated by an element containing a name which is
|
||||||
|
zero.
|
||||||
|
|
||||||
|
The field `has_arg' is:
|
||||||
|
no_argument (or 0) if the option does not take an argument,
|
||||||
|
required_argument (or 1) if the option requires an argument,
|
||||||
|
optional_argument (or 2) if the option takes an optional argument.
|
||||||
|
|
||||||
|
If the field `flag' is not NULL, it points to a variable that is set
|
||||||
|
to the value given in the field `val' when the option is found, but
|
||||||
|
left unchanged if the option is not found.
|
||||||
|
|
||||||
|
To have a long-named option do something other than set an `int' to
|
||||||
|
a compiled-in constant, such as set a value from `optarg', set the
|
||||||
|
option's `flag' field to zero and its `val' field to a nonzero
|
||||||
|
value (the equivalent single-letter option character, if there is
|
||||||
|
one). For long options that have a zero `flag' field, `getopt'
|
||||||
|
returns the contents of the `val' field. */
|
||||||
|
|
||||||
|
struct option
|
||||||
|
{
|
||||||
|
#if defined (__STDC__) && __STDC__
|
||||||
|
const char *name;
|
||||||
|
#else
|
||||||
|
char *name;
|
||||||
|
#endif
|
||||||
|
/* has_arg can't be an enum because some compilers complain about
|
||||||
|
type mismatches in all the code that assumes it is an int. */
|
||||||
|
int has_arg;
|
||||||
|
int *flag;
|
||||||
|
int val;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Names for the values of the `has_arg' field of `struct option'. */
|
||||||
|
|
||||||
|
#define no_argument 0
|
||||||
|
#define required_argument 1
|
||||||
|
#define optional_argument 2
|
||||||
|
|
||||||
|
#if defined (__STDC__) && __STDC__
|
||||||
|
#ifdef __GNU_LIBRARY__
|
||||||
|
/* Many other libraries have conflicting prototypes for getopt, with
|
||||||
|
differences in the consts, in stdlib.h. To avoid compilation
|
||||||
|
errors, only prototype getopt for the GNU C library. */
|
||||||
|
extern int getopt (int argc, char *const *argv, const char *shortopts);
|
||||||
|
#else /* not __GNU_LIBRARY__ */
|
||||||
|
extern int getopt ();
|
||||||
|
#endif /* __GNU_LIBRARY__ */
|
||||||
|
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
|
||||||
|
const struct option *longopts, int *longind);
|
||||||
|
extern int getopt_long_only (int argc, char *const *argv,
|
||||||
|
const char *shortopts,
|
||||||
|
const struct option *longopts, int *longind);
|
||||||
|
|
||||||
|
/* Internal only. Users should not call this directly. */
|
||||||
|
extern int _getopt_internal (int argc, char *const *argv,
|
||||||
|
const char *shortopts,
|
||||||
|
const struct option *longopts, int *longind,
|
||||||
|
int long_only);
|
||||||
|
#else /* not __STDC__ */
|
||||||
|
extern int getopt ();
|
||||||
|
extern int getopt_long ();
|
||||||
|
extern int getopt_long_only ();
|
||||||
|
|
||||||
|
extern int _getopt_internal ();
|
||||||
|
#endif /* __STDC__ */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* getopt.h */
|
||||||
189
getopt1.c
Normal file
189
getopt1.c
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||||
|
Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||||
|
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||||
|
|
||||||
|
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 2, 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, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
USA. */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "getopt.h"
|
||||||
|
|
||||||
|
#if !defined (__STDC__) || !__STDC__
|
||||||
|
/* This is a separate conditional since some stdc systems
|
||||||
|
reject `defined (const)'. */
|
||||||
|
#ifndef const
|
||||||
|
#define const
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||||
|
actually compiling the library itself. This code is part of the GNU C
|
||||||
|
Library, but also included in many other GNU distributions. Compiling
|
||||||
|
and linking in this code is a waste when using the GNU C library
|
||||||
|
(especially if it is a shared library). Rather than having every GNU
|
||||||
|
program understand `configure --with-gnu-libc' and omit the object files,
|
||||||
|
it is simpler to just do this in the source for each such file. */
|
||||||
|
|
||||||
|
#define GETOPT_INTERFACE_VERSION 2
|
||||||
|
#if !defined (_LIBC) && defined (__GLIBC__) && __GLIBC__ >= 2
|
||||||
|
#include <gnu-versions.h>
|
||||||
|
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
|
||||||
|
#define ELIDE_CODE
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ELIDE_CODE
|
||||||
|
|
||||||
|
|
||||||
|
/* This needs to come after some library #include
|
||||||
|
to get __GNU_LIBRARY__ defined. */
|
||||||
|
#ifdef __GNU_LIBRARY__
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NULL
|
||||||
|
#define NULL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
getopt_long (argc, argv, options, long_options, opt_index)
|
||||||
|
int argc;
|
||||||
|
char *const *argv;
|
||||||
|
const char *options;
|
||||||
|
const struct option *long_options;
|
||||||
|
int *opt_index;
|
||||||
|
{
|
||||||
|
return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
|
||||||
|
If an option that starts with '-' (not '--') doesn't match a long option,
|
||||||
|
but does match a short option, it is parsed as a short option
|
||||||
|
instead. */
|
||||||
|
|
||||||
|
int
|
||||||
|
getopt_long_only (argc, argv, options, long_options, opt_index)
|
||||||
|
int argc;
|
||||||
|
char *const *argv;
|
||||||
|
const char *options;
|
||||||
|
const struct option *long_options;
|
||||||
|
int *opt_index;
|
||||||
|
{
|
||||||
|
return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* Not ELIDE_CODE. */
|
||||||
|
|
||||||
|
#ifdef TEST
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main (argc, argv)
|
||||||
|
int argc;
|
||||||
|
char **argv;
|
||||||
|
{
|
||||||
|
int c;
|
||||||
|
int digit_optind = 0;
|
||||||
|
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
int this_option_optind = optind ? optind : 1;
|
||||||
|
int option_index = 0;
|
||||||
|
static struct option long_options[] =
|
||||||
|
{
|
||||||
|
{"add", 1, 0, 0},
|
||||||
|
{"append", 0, 0, 0},
|
||||||
|
{"delete", 1, 0, 0},
|
||||||
|
{"verbose", 0, 0, 0},
|
||||||
|
{"create", 0, 0, 0},
|
||||||
|
{"file", 1, 0, 0},
|
||||||
|
{0, 0, 0, 0}
|
||||||
|
};
|
||||||
|
|
||||||
|
c = getopt_long (argc, argv, "abc:d:0123456789",
|
||||||
|
long_options, &option_index);
|
||||||
|
if (c == -1)
|
||||||
|
break;
|
||||||
|
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
printf ("option %s", long_options[option_index].name);
|
||||||
|
if (optarg)
|
||||||
|
printf (" with arg %s", optarg);
|
||||||
|
printf ("\n");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '0':
|
||||||
|
case '1':
|
||||||
|
case '2':
|
||||||
|
case '3':
|
||||||
|
case '4':
|
||||||
|
case '5':
|
||||||
|
case '6':
|
||||||
|
case '7':
|
||||||
|
case '8':
|
||||||
|
case '9':
|
||||||
|
if (digit_optind != 0 && digit_optind != this_option_optind)
|
||||||
|
printf ("digits occur in two different argv-elements.\n");
|
||||||
|
digit_optind = this_option_optind;
|
||||||
|
printf ("option %c\n", c);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'a':
|
||||||
|
printf ("option a\n");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'b':
|
||||||
|
printf ("option b\n");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'c':
|
||||||
|
printf ("option c with value `%s'\n", optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'd':
|
||||||
|
printf ("option d with value `%s'\n", optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '?':
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
printf ("?? getopt returned character code 0%o ??\n", c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (optind < argc)
|
||||||
|
{
|
||||||
|
printf ("non-option ARGV-elements: ");
|
||||||
|
while (optind < argc)
|
||||||
|
printf ("%s ", argv[optind++]);
|
||||||
|
printf ("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
exit (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* TEST */
|
||||||
44
glob/ChangeLog
Normal file
44
glob/ChangeLog
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
Tue Aug 12 10:52:34 1997 Paul D. Smith <psmith@baynetworks.com>
|
||||||
|
|
||||||
|
* configure.in: Require autoconf 2.12.
|
||||||
|
|
||||||
|
* glob: Updates from latest GNU libc glob code.
|
||||||
|
|
||||||
|
* glob.c,glob.h,fnmatch.h: Change all WIN32 references to WINDOWS32.
|
||||||
|
|
||||||
|
* glob.h: OSF4 defines macros in such a way that GLOB_ALTDIRFUNC
|
||||||
|
is not defined. Added a test to the #if which defines it if
|
||||||
|
_GNU_SOURCE is defined; that's set by both glob.c and GNU make.
|
||||||
|
|
||||||
|
* glob.c: SunOS4 w/ cc needs #include <stdio.h>, since assert.h
|
||||||
|
requires stderr but doesn't include stdio.h :-/.
|
||||||
|
(next_brace_sub): De-protoize function definition.
|
||||||
|
(glob): Cast __alloca(); on SunOS4 it uses the default return type
|
||||||
|
of int.
|
||||||
|
(glob): Irix defines getlogin_r() to return a char*; move the
|
||||||
|
extern for that into the _LIBC area since it isn't used except in
|
||||||
|
LIBC anyway. Likewise, move extern getlogin() into the "else".
|
||||||
|
|
||||||
|
Sat Jul 20 21:55:31 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
Win32 hacks from <Rob_Tulloh@tivoli.com>.
|
||||||
|
* posix/glob.c [WIN32]: Don't include <pwd.h>; don't use d_ino;
|
||||||
|
use void * for my_realloc; include <malloc.h> for alloca.
|
||||||
|
(glob) [WIN32]: Use "c:/users/default" for ~ if no HOME variable.
|
||||||
|
* posix/fnmatch.h [WIN32]: Use prototypes even if [!__STDC__].
|
||||||
|
* posix/glob.h: Likewise.
|
||||||
|
|
||||||
|
Fri Jul 19 16:56:41 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* posix/glob.h [!_AMIGA && !VMS]: Check this instead of just [!_AMIGA]
|
||||||
|
for `struct stat;' forward decl.
|
||||||
|
|
||||||
|
Sat Jun 22 10:44:09 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* posix/glob.c: Include <alloca.h> only [HAVE_ALLOCA_H], not [sparc].
|
||||||
|
|
||||||
|
Fri Jun 21 00:27:51 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* posix/fnmatch.c (fnmatch): Fix \*[*?]+ case to increment name ptr
|
||||||
|
only for ?s, not for *s. Fix from Chet Ramey.
|
||||||
|
|
||||||
10
glob/Makefile.am
Normal file
10
glob/Makefile.am
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# -*-Makefile-*-, or close enough
|
||||||
|
|
||||||
|
AUTOMAKE_OPTIONS = 1.2 foreign
|
||||||
|
|
||||||
|
noinst_LIBRARIES = libglob.a
|
||||||
|
|
||||||
|
libglob_a_SOURCES = glob.c glob.h fnmatch.c fnmatch.h
|
||||||
|
|
||||||
|
EXTRA_DIST = COPYING.LIB Makefile.ami SCOPTIONS SMakefile \
|
||||||
|
configure.bat
|
||||||
69
glob/Makefile.ami
Normal file
69
glob/Makefile.ami
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
|
||||||
|
|
||||||
|
# Copyright (C) 1991, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||||
|
# This file is part of the GNU C Library.
|
||||||
|
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Library General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
# This library 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
|
||||||
|
# Library General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU Library General Public
|
||||||
|
# License along with this library; see the file COPYING.LIB. If
|
||||||
|
# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||||
|
# Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
|
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||||
|
VPATH = /glob/
|
||||||
|
# This must repeat the value, because configure will remove `VPATH = .'.
|
||||||
|
srcdir = /glob/
|
||||||
|
|
||||||
|
CC = sc
|
||||||
|
RM = delete
|
||||||
|
CPPFLAGS =
|
||||||
|
CFLAGS =
|
||||||
|
|
||||||
|
# Information determined by configure.
|
||||||
|
DEFS = Define HAVE_HEADER_STDC Define HAVE_UNISTD_H Define HAVE_STRING_H \
|
||||||
|
Define HAVE_DIRENT_H
|
||||||
|
|
||||||
|
# How to invoke ar.
|
||||||
|
AR = join
|
||||||
|
ARFLAGS = as
|
||||||
|
|
||||||
|
# How to invoke ranlib.
|
||||||
|
RANLIB = ;
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: glob.lib
|
||||||
|
|
||||||
|
glob.lib : glob.o fnmatch.o
|
||||||
|
$(AR) $(ARFLAGS) $@ glob.o fnmatch.o
|
||||||
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
# For some reason, Unix make wants the dependencies on the source files.
|
||||||
|
# Otherwise it refuses to use an implicit rule!
|
||||||
|
# And, get this: it doesn't work to use $(srcdir)foo.c!!
|
||||||
|
glob.o: $(srcdir)glob.h $(srcdir)fnmatch.h glob.c
|
||||||
|
fnmatch.o: $(srcdir)fnmatch.h fnmatch.c
|
||||||
|
|
||||||
|
OUTPUT_OPTION =
|
||||||
|
.c.o:
|
||||||
|
$(CC) IDir "" \
|
||||||
|
$(DEFS) $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
||||||
|
|
||||||
|
.PHONY: clean realclean glob-clean glob-realclean distclean
|
||||||
|
clean glob-clean:
|
||||||
|
-$(RM) glob.lib "#?.o" core
|
||||||
|
distclean glob-realclean: clean
|
||||||
|
-$(RM) TAGS tags Makefile config.status config.h config.log
|
||||||
|
realcean: distclean
|
||||||
|
|
||||||
|
# For inside the C library.
|
||||||
|
glob.tar glob.tar.Z:
|
||||||
|
$(MAKE) -C .. $@
|
||||||
13
glob/SCOPTIONS
Normal file
13
glob/SCOPTIONS
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
ERRORREXX
|
||||||
|
OPTIMIZE
|
||||||
|
NOVERSION
|
||||||
|
OPTIMIZERTIME
|
||||||
|
OPTIMIZERALIAS
|
||||||
|
DEFINE INCLUDEDIR="include:"
|
||||||
|
DEFINE LIBDIR="lib:"
|
||||||
|
DEFINE NO_ALLOCA
|
||||||
|
DEFINE NO_FLOAT
|
||||||
|
DEFINE NO_ARCHIVES
|
||||||
|
IGNORE=161
|
||||||
|
IGNORE=100
|
||||||
|
STARTUP=cres
|
||||||
69
glob/SMakefile
Normal file
69
glob/SMakefile
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
|
||||||
|
|
||||||
|
# Copyright (C) 1991, 92, 93, 94, 95 Free Software Foundation, Inc.
|
||||||
|
# This file is part of the GNU C Library.
|
||||||
|
|
||||||
|
# This library is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU Library General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2 of
|
||||||
|
# the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
# This library 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
|
||||||
|
# Library General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU Library General Public
|
||||||
|
# License along with this library; see the file COPYING.LIB. If
|
||||||
|
# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||||
|
# Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
|
# Ultrix 2.2 make doesn't expand the value of VPATH.
|
||||||
|
VPATH = /glob/
|
||||||
|
# This must repeat the value, because configure will remove `VPATH = .'.
|
||||||
|
srcdir = /glob/
|
||||||
|
|
||||||
|
CC = sc
|
||||||
|
CPPFLAGS =
|
||||||
|
CFLAGS =
|
||||||
|
MAKE = smake
|
||||||
|
RM = delete
|
||||||
|
|
||||||
|
# Information determined by configure.
|
||||||
|
DEFS = Define HAVE_HEADER_STDC Define HAVE_UNISTD_H Define HAVE_STRING_H \
|
||||||
|
Define HAVE_DIRENT_H
|
||||||
|
|
||||||
|
# How to invoke ar.
|
||||||
|
AR = join
|
||||||
|
ARFLAGS = as
|
||||||
|
|
||||||
|
# How to invoke ranlib.
|
||||||
|
RANLIB = ;
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: glob.lib
|
||||||
|
|
||||||
|
glob.lib : glob.o fnmatch.o
|
||||||
|
$(AR) $(ARFLAGS) $@ glob.o fnmatch.o
|
||||||
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
# For some reason, Unix make wants the dependencies on the source files.
|
||||||
|
# Otherwise it refuses to use an implicit rule!
|
||||||
|
# And, get this: it doesn't work to use $(srcdir)foo.c!!
|
||||||
|
glob.o: $(srcdir)glob.h $(srcdir)fnmatch.h glob.c
|
||||||
|
fnmatch.o: $(srcdir)fnmatch.h fnmatch.c
|
||||||
|
|
||||||
|
.c.o:
|
||||||
|
$(CC) IDir "" \
|
||||||
|
$(DEFS) $(CPPFLAGS) $(CFLAGS) $< $(OUTPUT_OPTION)
|
||||||
|
|
||||||
|
.PHONY: clean realclean glob-clean glob-realclean distclean
|
||||||
|
clean glob-clean:
|
||||||
|
-$(RM) -f glob.lib *.o core
|
||||||
|
distclean glob-realclean: clean
|
||||||
|
-$(RM) -f TAGS tags Makefile config.status config.h config.log
|
||||||
|
realcean: distclean
|
||||||
|
|
||||||
|
# For inside the C library.
|
||||||
|
glob.tar glob.tar.Z:
|
||||||
|
$(MAKE) -C .. $@
|
||||||
26
glob/configure.bat
Normal file
26
glob/configure.bat
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
@echo off
|
||||||
|
echo Configuring glob for DJGPP
|
||||||
|
rem This batch file assumes a unix-type "sed" program
|
||||||
|
|
||||||
|
echo # Makefile generated by "configure.bat"> Makefile
|
||||||
|
|
||||||
|
if exist config.sed del config.sed
|
||||||
|
|
||||||
|
echo "s/@srcdir@/./ ">> config.sed
|
||||||
|
echo "s/@CC@/gcc/ ">> config.sed
|
||||||
|
echo "s/@CFLAGS@/-O2 -g/ ">> config.sed
|
||||||
|
echo "s/@CPPFLAGS@/-DHAVE_CONFIG_H -I../ ">> config.sed
|
||||||
|
echo "s/@AR@/ar/ ">> config.sed
|
||||||
|
echo "s/@RANLIB@/ranlib/ ">> config.sed
|
||||||
|
echo "s/@LDFLAGS@// ">> config.sed
|
||||||
|
echo "s/@DEFS@// ">> config.sed
|
||||||
|
echo "s/@ALLOCA@// ">> config.sed
|
||||||
|
echo "s/@LIBS@// ">> config.sed
|
||||||
|
echo "s/@LIBOBJS@// ">> config.sed
|
||||||
|
echo "s/^Makefile *:/_Makefile:/ ">> config.sed
|
||||||
|
echo "s/^config.h *:/_config.h:/ ">> config.sed
|
||||||
|
|
||||||
|
sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
|
||||||
|
sed -f config2.sed Makefile.in >> Makefile
|
||||||
|
del config.sed
|
||||||
|
del config2.sed
|
||||||
22
glob/configure.in
Normal file
22
glob/configure.in
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
AC_INIT(fnmatch.c) dnl A distinctive file to look for in srcdir.
|
||||||
|
AC_PREREQ(2.12) dnl Minimum Autoconf version required.
|
||||||
|
|
||||||
|
AM_INIT_AUTOMAKE(glob, 0.0, nodefs)
|
||||||
|
|
||||||
|
AC_PROG_CC
|
||||||
|
AC_CHECK_PROG(AR, ar, ar, ar)
|
||||||
|
AC_PROG_RANLIB
|
||||||
|
AC_PROG_CPP dnl Later checks need this.
|
||||||
|
dnl These two want to come early.
|
||||||
|
AC_AIX
|
||||||
|
AC_MINIX
|
||||||
|
AC_ISC_POSIX
|
||||||
|
AC_CONST
|
||||||
|
AC_HEADER_STDC
|
||||||
|
AC_CHECK_HEADERS(memory.h unistd.h string.h)
|
||||||
|
AC_HEADER_DIRENT
|
||||||
|
AC_FUNC_CLOSEDIR_VOID
|
||||||
|
AC_FUNC_ALLOCA
|
||||||
|
AC_FUNC_STRCOLL
|
||||||
|
AC_OUTPUT(Makefile)
|
||||||
242
glob/fnmatch.c
Normal file
242
glob/fnmatch.c
Normal file
@@ -0,0 +1,242 @@
|
|||||||
|
/* Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this library; see the file COPYING.LIB. If not,
|
||||||
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Enable GNU extensions in fnmatch.h. */
|
||||||
|
#ifndef _GNU_SOURCE
|
||||||
|
# define _GNU_SOURCE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fnmatch.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||||
|
actually compiling the library itself. This code is part of the GNU C
|
||||||
|
Library, but also included in many other GNU distributions. Compiling
|
||||||
|
and linking in this code is a waste when using the GNU C library
|
||||||
|
(especially if it is a shared library). Rather than having every GNU
|
||||||
|
program understand `configure --with-gnu-libc' and omit the object files,
|
||||||
|
it is simpler to just do this in the source for each such file. */
|
||||||
|
|
||||||
|
#if defined _LIBC || !defined __GNU_LIBRARY__
|
||||||
|
|
||||||
|
|
||||||
|
# if defined STDC_HEADERS || !defined isascii
|
||||||
|
# define ISASCII(c) 1
|
||||||
|
# else
|
||||||
|
# define ISASCII(c) isascii(c)
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# define ISUPPER(c) (ISASCII (c) && isupper (c))
|
||||||
|
|
||||||
|
|
||||||
|
# ifndef errno
|
||||||
|
extern int errno;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/* Match STRING against the filename pattern PATTERN, returning zero if
|
||||||
|
it matches, nonzero if not. */
|
||||||
|
int
|
||||||
|
fnmatch (pattern, string, flags)
|
||||||
|
const char *pattern;
|
||||||
|
const char *string;
|
||||||
|
int flags;
|
||||||
|
{
|
||||||
|
register const char *p = pattern, *n = string;
|
||||||
|
register char c;
|
||||||
|
|
||||||
|
/* Note that this evaluates C many times. */
|
||||||
|
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
|
||||||
|
|
||||||
|
while ((c = *p++) != '\0')
|
||||||
|
{
|
||||||
|
c = FOLD (c);
|
||||||
|
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case '?':
|
||||||
|
if (*n == '\0')
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
else if ((flags & FNM_FILE_NAME) && *n == '/')
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
else if ((flags & FNM_PERIOD) && *n == '.' &&
|
||||||
|
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '\\':
|
||||||
|
if (!(flags & FNM_NOESCAPE))
|
||||||
|
{
|
||||||
|
c = *p++;
|
||||||
|
if (c == '\0')
|
||||||
|
/* Trailing \ loses. */
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
c = FOLD (c);
|
||||||
|
}
|
||||||
|
if (FOLD (*n) != c)
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '*':
|
||||||
|
if ((flags & FNM_PERIOD) && *n == '.' &&
|
||||||
|
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
for (c = *p++; c == '?' || c == '*'; c = *p++)
|
||||||
|
{
|
||||||
|
if ((flags & FNM_FILE_NAME) && *n == '/')
|
||||||
|
/* A slash does not match a wildcard under FNM_FILE_NAME. */
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
else if (c == '?')
|
||||||
|
{
|
||||||
|
/* A ? needs to match one character. */
|
||||||
|
if (*n == '\0')
|
||||||
|
/* There isn't another character; no match. */
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
else
|
||||||
|
/* One character of the string is consumed in matching
|
||||||
|
this ? wildcard, so *??? won't match if there are
|
||||||
|
less than three characters. */
|
||||||
|
++n;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c == '\0')
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
{
|
||||||
|
char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
|
||||||
|
c1 = FOLD (c1);
|
||||||
|
for (--p; *n != '\0'; ++n)
|
||||||
|
if ((c == '[' || FOLD (*n) == c1) &&
|
||||||
|
fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
|
||||||
|
return 0;
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
}
|
||||||
|
|
||||||
|
case '[':
|
||||||
|
{
|
||||||
|
/* Nonzero if the sense of the character class is inverted. */
|
||||||
|
register int not;
|
||||||
|
|
||||||
|
if (*n == '\0')
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
if ((flags & FNM_PERIOD) && *n == '.' &&
|
||||||
|
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
not = (*p == '!' || *p == '^');
|
||||||
|
if (not)
|
||||||
|
++p;
|
||||||
|
|
||||||
|
c = *p++;
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
register char cstart = c, cend = c;
|
||||||
|
|
||||||
|
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||||
|
{
|
||||||
|
if (*p == '\0')
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
cstart = cend = *p++;
|
||||||
|
}
|
||||||
|
|
||||||
|
cstart = cend = FOLD (cstart);
|
||||||
|
|
||||||
|
if (c == '\0')
|
||||||
|
/* [ (unterminated) loses. */
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
c = *p++;
|
||||||
|
c = FOLD (c);
|
||||||
|
|
||||||
|
if ((flags & FNM_FILE_NAME) && c == '/')
|
||||||
|
/* [/] can never match. */
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
if (c == '-' && *p != ']')
|
||||||
|
{
|
||||||
|
cend = *p++;
|
||||||
|
if (!(flags & FNM_NOESCAPE) && cend == '\\')
|
||||||
|
cend = *p++;
|
||||||
|
if (cend == '\0')
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
cend = FOLD (cend);
|
||||||
|
|
||||||
|
c = *p++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FOLD (*n) >= cstart && FOLD (*n) <= cend)
|
||||||
|
goto matched;
|
||||||
|
|
||||||
|
if (c == ']')
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!not)
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
break;
|
||||||
|
|
||||||
|
matched:;
|
||||||
|
/* Skip the rest of the [...] that already matched. */
|
||||||
|
while (c != ']')
|
||||||
|
{
|
||||||
|
if (c == '\0')
|
||||||
|
/* [... (unterminated) loses. */
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
c = *p++;
|
||||||
|
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||||
|
{
|
||||||
|
if (*p == '\0')
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
/* XXX 1003.2d11 is unclear if this is right. */
|
||||||
|
++p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (not)
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
if (c != FOLD (*n))
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
}
|
||||||
|
|
||||||
|
++n;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*n == '\0')
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if ((flags & FNM_LEADING_DIR) && *n == '/')
|
||||||
|
/* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return FNM_NOMATCH;
|
||||||
|
|
||||||
|
# undef FOLD
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||||
68
glob/fnmatch.h
Normal file
68
glob/fnmatch.h
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/* Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The GNU C Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#ifndef _FNMATCH_H
|
||||||
|
#define _FNMATCH_H 1
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \
|
||||||
|
|| defined (WINDOWS32))
|
||||||
|
#undef __P
|
||||||
|
#define __P(protos) protos
|
||||||
|
#else /* Not C++ or ANSI C. */
|
||||||
|
#undef __P
|
||||||
|
#define __P(protos) ()
|
||||||
|
/* We can get away without defining `const' here only because in this file
|
||||||
|
it is used only inside the prototype for `fnmatch', which is elided in
|
||||||
|
non-ANSI C where `const' is problematical. */
|
||||||
|
#endif /* C++ or ANSI C. */
|
||||||
|
|
||||||
|
|
||||||
|
/* We #undef these before defining them because some losing systems
|
||||||
|
(HP-UX A.08.07 for example) define these in <unistd.h>. */
|
||||||
|
#undef FNM_PATHNAME
|
||||||
|
#undef FNM_NOESCAPE
|
||||||
|
#undef FNM_PERIOD
|
||||||
|
|
||||||
|
/* Bits set in the FLAGS argument to `fnmatch'. */
|
||||||
|
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
|
||||||
|
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
|
||||||
|
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
|
||||||
|
|
||||||
|
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
|
||||||
|
#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
|
||||||
|
#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
|
||||||
|
#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
|
||||||
|
#define FNM_NOMATCH 1
|
||||||
|
|
||||||
|
/* Match STRING against the filename pattern PATTERN,
|
||||||
|
returning zero if it matches, FNM_NOMATCH if not. */
|
||||||
|
extern int fnmatch __P ((const char *__pattern, const char *__string,
|
||||||
|
int __flags));
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* fnmatch.h */
|
||||||
1030
glob/glob.c
Normal file
1030
glob/glob.c
Normal file
File diff suppressed because it is too large
Load Diff
132
glob/glob.h
Normal file
132
glob/glob.h
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
/* Copyright (C) 1991, 1992, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The GNU C Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#ifndef _GLOB_H
|
||||||
|
#define _GLOB_H 1
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef __ptr_t
|
||||||
|
#if (defined __cplusplus || (defined __STDC__ && __STDC__) \
|
||||||
|
|| defined WINDOWS32)
|
||||||
|
# undef __P
|
||||||
|
# define __P(protos) protos
|
||||||
|
# define __ptr_t void *
|
||||||
|
# if !defined __GNUC__ || __GNUC__ < 2
|
||||||
|
# undef __const
|
||||||
|
# define __const const
|
||||||
|
# endif
|
||||||
|
#else /* Not C++ or ANSI C. */
|
||||||
|
# undef __P
|
||||||
|
# define __P(protos) ()
|
||||||
|
# undef __const
|
||||||
|
# define __const
|
||||||
|
# define __ptr_t char *
|
||||||
|
#endif /* C++ or ANSI C. */
|
||||||
|
|
||||||
|
/* Bits set in the FLAGS argument to `glob'. */
|
||||||
|
#define GLOB_ERR (1 << 0)/* Return on read errors. */
|
||||||
|
#define GLOB_MARK (1 << 1)/* Append a slash to each name. */
|
||||||
|
#define GLOB_NOSORT (1 << 2)/* Don't sort the names. */
|
||||||
|
#define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */
|
||||||
|
#define GLOB_NOCHECK (1 << 4)/* If nothing matches, return the pattern. */
|
||||||
|
#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
|
||||||
|
#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
|
||||||
|
#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
|
||||||
|
|
||||||
|
#if (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _BSD_SOURCE \
|
||||||
|
|| defined _GNU_SOURCE)
|
||||||
|
# define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
|
||||||
|
# define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
|
||||||
|
# define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
|
||||||
|
# define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
|
||||||
|
# define GLOB_TILDE (1 <<12)/* Expand ~user and ~ to home directories. */
|
||||||
|
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
|
||||||
|
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
|
||||||
|
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
|
||||||
|
GLOB_NOMAGIC|GLOB_TILDE)
|
||||||
|
#else
|
||||||
|
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
|
||||||
|
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
|
||||||
|
GLOB_PERIOD)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Error returns from `glob'. */
|
||||||
|
#define GLOB_NOSPACE 1 /* Ran out of memory. */
|
||||||
|
#define GLOB_ABORTED 2 /* Read error. */
|
||||||
|
#define GLOB_NOMATCH 3 /* No matches found. */
|
||||||
|
|
||||||
|
#ifdef _GNU_SOURCE
|
||||||
|
/* Previous versions of this file defined GLOB_ABEND instead of
|
||||||
|
GLOB_ABORTED. Provide a compatibility definition here. */
|
||||||
|
# define GLOB_ABEND GLOB_ABORTED
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Structure describing a globbing run. */
|
||||||
|
#if !defined _AMIGA && !defined VMS /* Buggy compiler. */
|
||||||
|
struct stat;
|
||||||
|
#endif
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int gl_pathc; /* Count of paths matched by the pattern. */
|
||||||
|
char **gl_pathv; /* List of matched pathnames. */
|
||||||
|
int gl_offs; /* Slots to reserve in `gl_pathv'. */
|
||||||
|
int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
|
||||||
|
|
||||||
|
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
|
||||||
|
are used instead of the normal file access functions. */
|
||||||
|
void (*gl_closedir) __P ((void *));
|
||||||
|
struct dirent *(*gl_readdir) __P ((void *));
|
||||||
|
__ptr_t (*gl_opendir) __P ((__const char *));
|
||||||
|
int (*gl_lstat) __P ((__const char *, struct stat *));
|
||||||
|
int (*gl_stat) __P ((__const char *, struct stat *));
|
||||||
|
} glob_t;
|
||||||
|
|
||||||
|
/* Do glob searching for PATTERN, placing results in PGLOB.
|
||||||
|
The bits defined above may be set in FLAGS.
|
||||||
|
If a directory cannot be opened or read and ERRFUNC is not nil,
|
||||||
|
it is called with the pathname that caused the error, and the
|
||||||
|
`errno' value from the failing call; if it returns non-zero
|
||||||
|
`glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
|
||||||
|
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
|
||||||
|
Otherwise, `glob' returns zero. */
|
||||||
|
extern int glob __P ((__const char *__pattern, int __flags,
|
||||||
|
int (*__errfunc) __P ((__const char *, int)),
|
||||||
|
glob_t *__pglob));
|
||||||
|
|
||||||
|
/* Free storage allocated in PGLOB by a previous `glob' call. */
|
||||||
|
extern void globfree __P ((glob_t *__pglob));
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _GNU_SOURCE
|
||||||
|
/* Return nonzero if PATTERN contains any metacharacters.
|
||||||
|
Metacharacters can be quoted with backslashes if QUOTE is nonzero.
|
||||||
|
|
||||||
|
This function is not part of the interface specified by POSIX.2
|
||||||
|
but several programs want to use it. */
|
||||||
|
extern int __glob_pattern_p __P ((__const char *__pattern, int __quote));
|
||||||
|
extern int glob_pattern_p __P ((__const char *__pattern, int __quote));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* glob.h */
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
@display
|
@display
|
||||||
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
|
Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
|
||||||
675 Mass Ave, Cambridge, MA 02139, USA
|
59 Temple Place -- Suite 330, Boston, MA 02111-1307, USA
|
||||||
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
@@ -349,9 +349,9 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License along
|
||||||
along with this program; if not, write to the Free Software
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|||||||
36
implicit.c
36
implicit.c
@@ -1,5 +1,5 @@
|
|||||||
/* Implicit rule searching for GNU Make.
|
/* Implicit rule searching for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -19,9 +19,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "make.h"
|
#include "make.h"
|
||||||
#include "rule.h"
|
#include "rule.h"
|
||||||
#include "dep.h"
|
#include "dep.h"
|
||||||
#include "file.h"
|
#include "filedef.h"
|
||||||
|
|
||||||
static int pattern_search ();
|
static int pattern_search PARAMS ((struct file *file, int archive, unsigned int depth,
|
||||||
|
unsigned int recursions));
|
||||||
|
|
||||||
/* For a FILE which has no commands specified, try to figure out some
|
/* For a FILE which has no commands specified, try to figure out some
|
||||||
from the implicit pattern rules.
|
from the implicit pattern rules.
|
||||||
@@ -151,7 +152,7 @@ pattern_search (file, archive, depth, recursions)
|
|||||||
register struct rule *rule;
|
register struct rule *rule;
|
||||||
register struct dep *dep;
|
register struct dep *dep;
|
||||||
|
|
||||||
char *p;
|
char *p, *vp;
|
||||||
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
if (archive || ar_name (filename))
|
if (archive || ar_name (filename))
|
||||||
@@ -162,7 +163,22 @@ pattern_search (file, archive, depth, recursions)
|
|||||||
/* Set LASTSLASH to point at the last slash in FILENAME
|
/* Set LASTSLASH to point at the last slash in FILENAME
|
||||||
but not counting any slash at the end. (foo/bar/ counts as
|
but not counting any slash at the end. (foo/bar/ counts as
|
||||||
bar/ in directory foo/, not empty in directory foo/bar/.) */
|
bar/ in directory foo/, not empty in directory foo/bar/.) */
|
||||||
|
#ifdef VMS
|
||||||
|
lastslash = rindex (filename, ']');
|
||||||
|
#else
|
||||||
lastslash = rindex (filename, '/');
|
lastslash = rindex (filename, '/');
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
/* Handle backslashes (possibly mixed with forward slashes)
|
||||||
|
and the case of "d:file". */
|
||||||
|
{
|
||||||
|
char *bslash = rindex (filename, '\\');
|
||||||
|
if (lastslash == 0 || bslash > lastslash)
|
||||||
|
lastslash = bslash;
|
||||||
|
if (lastslash == 0 && filename[0] && filename[1] == ':')
|
||||||
|
lastslash = filename + 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
if (lastslash != 0 && lastslash[1] == '\0')
|
if (lastslash != 0 && lastslash[1] == '\0')
|
||||||
lastslash = 0;
|
lastslash = 0;
|
||||||
}
|
}
|
||||||
@@ -210,7 +226,11 @@ pattern_search (file, archive, depth, recursions)
|
|||||||
/* Set CHECK_LASTSLASH if FILENAME contains a directory
|
/* Set CHECK_LASTSLASH if FILENAME contains a directory
|
||||||
prefix and the target pattern does not contain a slash. */
|
prefix and the target pattern does not contain a slash. */
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
check_lastslash = lastslash != 0 && index (target, ']') == 0;
|
||||||
|
#else
|
||||||
check_lastslash = lastslash != 0 && index (target, '/') == 0;
|
check_lastslash = lastslash != 0 && index (target, '/') == 0;
|
||||||
|
#endif
|
||||||
if (check_lastslash)
|
if (check_lastslash)
|
||||||
{
|
{
|
||||||
/* In that case, don't include the
|
/* In that case, don't include the
|
||||||
@@ -379,10 +399,12 @@ pattern_search (file, archive, depth, recursions)
|
|||||||
}
|
}
|
||||||
/* This code, given FILENAME = "lib/foo.o", dependency name
|
/* This code, given FILENAME = "lib/foo.o", dependency name
|
||||||
"lib/foo.c", and VPATH=src, searches for "src/lib/foo.c". */
|
"lib/foo.c", and VPATH=src, searches for "src/lib/foo.c". */
|
||||||
if (vpath_search (&p, (time_t *) 0))
|
vp = p;
|
||||||
|
if (vpath_search (&vp, (time_t *) 0))
|
||||||
{
|
{
|
||||||
DEBUGP2 ("Found dependency as `%s'.%s\n", p, "");
|
DEBUGP2 ("Found dependency `%s' as VPATH `%s'\n", p, vp);
|
||||||
found_files[deps_found++] = p;
|
strcpy(vp, p);
|
||||||
|
found_files[deps_found++] = vp;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
34
job.h
34
job.h
@@ -1,5 +1,5 @@
|
|||||||
/* Definitions for managing subprocesses in GNU Make.
|
/* Definitions for managing subprocesses in GNU Make.
|
||||||
Copyright (C) 1992, 1993 Free Software Foundation, Inc.
|
Copyright (C) 1992, 1993, 1996 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -16,6 +16,9 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with GNU Make; see the file COPYING. If not, write to
|
along with GNU Make; see the file COPYING. If not, write to
|
||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
|
#ifndef SEEN_JOB_H
|
||||||
|
#define SEEN_JOB_H
|
||||||
|
|
||||||
/* Structure describing a running or dead child process. */
|
/* Structure describing a running or dead child process. */
|
||||||
|
|
||||||
struct child
|
struct child
|
||||||
@@ -31,6 +34,10 @@ struct child
|
|||||||
char *command_ptr; /* Ptr into command_lines[command_line]. */
|
char *command_ptr; /* Ptr into command_lines[command_line]. */
|
||||||
|
|
||||||
pid_t pid; /* Child process's ID number. */
|
pid_t pid; /* Child process's ID number. */
|
||||||
|
#ifdef VMS
|
||||||
|
int efn; /* Completion event flag number */
|
||||||
|
int cstatus; /* Completion status */
|
||||||
|
#endif
|
||||||
unsigned int remote:1; /* Nonzero if executing remotely. */
|
unsigned int remote:1; /* Nonzero if executing remotely. */
|
||||||
|
|
||||||
unsigned int noerror:1; /* Nonzero if commands contained a `-'. */
|
unsigned int noerror:1; /* Nonzero if commands contained a `-'. */
|
||||||
@@ -41,18 +48,27 @@ struct child
|
|||||||
|
|
||||||
extern struct child *children;
|
extern struct child *children;
|
||||||
|
|
||||||
extern void new_job ();
|
extern void new_job PARAMS ((struct file *file));
|
||||||
extern void reap_children ();
|
extern void reap_children PARAMS ((int block, int err));
|
||||||
extern void start_waiting_jobs ();
|
extern void start_waiting_jobs PARAMS ((void));
|
||||||
|
|
||||||
extern char **construct_command_argv ();
|
extern char **construct_command_argv PARAMS ((char *line, char **restp, struct file *file));
|
||||||
extern void child_execute_job ();
|
#ifdef VMS
|
||||||
extern void exec_command ();
|
extern int child_execute_job PARAMS ((char *argv, struct child *child));
|
||||||
|
#else
|
||||||
|
extern void child_execute_job PARAMS ((int stdin_fd, int stdout_fd, char **argv, char **envp));
|
||||||
|
#endif
|
||||||
|
#ifdef _AMIGA
|
||||||
|
extern void exec_command PARAMS ((char **argv));
|
||||||
|
#else
|
||||||
|
extern void exec_command PARAMS ((char **argv, char **envp));
|
||||||
|
#endif
|
||||||
|
|
||||||
extern unsigned int job_slots_used;
|
extern unsigned int job_slots_used;
|
||||||
|
|
||||||
|
extern void block_sigs PARAMS ((void));
|
||||||
#ifdef POSIX
|
#ifdef POSIX
|
||||||
extern void unblock_sigs ();
|
extern void unblock_sigs PARAMS ((void));
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_SIGSETMASK
|
#ifdef HAVE_SIGSETMASK
|
||||||
extern int fatal_signal_mask;
|
extern int fatal_signal_mask;
|
||||||
@@ -61,3 +77,5 @@ extern int fatal_signal_mask;
|
|||||||
#define unblock_sigs()
|
#define unblock_sigs()
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* SEEN_JOB_H */
|
||||||
|
|||||||
31
loadtest.c
Normal file
31
loadtest.c
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
extern volatile void exit (int);
|
||||||
|
extern double load_average (void);
|
||||||
|
|
||||||
|
double max_load_average = -1;
|
||||||
|
unsigned int job_slots_used = 0;
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
printf ("load_average () = %.2f\n", load_average ());
|
||||||
|
exit (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
error (char *fmt, ...)
|
||||||
|
{
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
perror_with_name (char *a, char *b)
|
||||||
|
{
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
wait_for_children (int i)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
58
maintMakefile
Normal file
58
maintMakefile
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
# Maintainer-only makefile segment. This contains things that are relevant
|
||||||
|
# only if you have the full copy of the GNU make sources, not a dist copy.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Find the glob source files... this might be dangerous, but we're maintainers!
|
||||||
|
#
|
||||||
|
globsrc := $(wildcard glob/*.c)
|
||||||
|
globhdr := $(wildcard glob/*.h)
|
||||||
|
|
||||||
|
TEMPLATES = README config.ami configh.dos config.h.W32 config.h-vms
|
||||||
|
|
||||||
|
# General rule for turning a .template into a regular file.
|
||||||
|
#
|
||||||
|
$(TEMPLATES) : % : %.template configure.in
|
||||||
|
rm -f $@
|
||||||
|
sed -e 's@%VERSION%@$(VERSION)@' \
|
||||||
|
-e 's@%PACKAGE%@$(PACKAGE)@' \
|
||||||
|
$< > $@
|
||||||
|
chmod a-w $@
|
||||||
|
|
||||||
|
# Construct Makefile.DOS
|
||||||
|
#
|
||||||
|
Makefile.DOS: Makefile.DOS.template Makefile.am configure.in
|
||||||
|
rm -f $@
|
||||||
|
sed -e 's@%VERSION%@$(VERSION)@' \
|
||||||
|
-e 's@%PROGRAMS%@$(bin_PROGRAMS)@' \
|
||||||
|
-e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@' \
|
||||||
|
-e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@' \
|
||||||
|
-e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@' \
|
||||||
|
-e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@' \
|
||||||
|
$< > $@
|
||||||
|
chmod a-w $@
|
||||||
|
|
||||||
|
# Construct build.sh.in
|
||||||
|
#
|
||||||
|
build.sh.in: build.template Makefile.am
|
||||||
|
rm -f $@
|
||||||
|
sed -e 's@%objs%@$(filter-out remote-%, $(make_OBJECTS)\
|
||||||
|
$(patsubst %.c,%.o,$(globsrc)))@' \
|
||||||
|
$< > $@
|
||||||
|
chmod a-w+x $@
|
||||||
|
|
||||||
|
# We clean everything here. The GNU standards for makefile conventions say
|
||||||
|
# you shouldn't remove configure, etc., but this makefile is only available
|
||||||
|
# in a full development distribution, so they'll only be removed then.
|
||||||
|
#
|
||||||
|
MAINTAINERCLEANFILES = $(TEMPLATES) Makefile.DOS build.sh.in \
|
||||||
|
configure Makefile.in stamp-h.in
|
||||||
|
|
||||||
|
# Put the alpha distribution files up for anonymous FTP.
|
||||||
|
#
|
||||||
|
ALPHA := ~ftp/gnu
|
||||||
|
TARFILE := $(distdir).tar.gz
|
||||||
|
|
||||||
|
.PHONY: alpha
|
||||||
|
alpha: $(ALPHA) $(TARFILE)
|
||||||
|
@rm -f $(ALPHA)/$(TARFILE)
|
||||||
|
cp -p $(TARFILE) $(ALPHA)
|
||||||
738
make-stds.texi
738
make-stds.texi
@@ -8,14 +8,28 @@
|
|||||||
@cindex conventions for makefiles
|
@cindex conventions for makefiles
|
||||||
@cindex standards for makefiles
|
@cindex standards for makefiles
|
||||||
|
|
||||||
This chapter describes conventions for writing the Makefiles for GNU programs.
|
This
|
||||||
|
@ifinfo
|
||||||
|
node
|
||||||
|
@end ifinfo
|
||||||
|
@iftex
|
||||||
|
@ifset CODESTD
|
||||||
|
section
|
||||||
|
@end ifset
|
||||||
|
@ifclear CODESTD
|
||||||
|
chapter
|
||||||
|
@end ifclear
|
||||||
|
@end iftex
|
||||||
|
describes conventions for writing the Makefiles for GNU programs.
|
||||||
|
|
||||||
@menu
|
@menu
|
||||||
* Makefile Basics::
|
* Makefile Basics:: General Conventions for Makefiles
|
||||||
* Utilities in Makefiles::
|
* Utilities in Makefiles:: Utilities in Makefiles
|
||||||
* Standard Targets::
|
* Command Variables:: Variables for Specifying Commands
|
||||||
* Command Variables::
|
* Directory Variables:: Variables for Installation Directories
|
||||||
* Directory Variables::
|
* Standard Targets:: Standard Targets for Users
|
||||||
|
* Install Command Categories:: Three categories of commands in the `install'
|
||||||
|
rule: normal, pre-install and post-install.
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
@node Makefile Basics
|
@node Makefile Basics
|
||||||
@@ -53,9 +67,10 @@ part of the make or @file{$(srcdir)/} if the file is an unchanging part
|
|||||||
of the source code. Without one of these prefixes, the current search
|
of the source code. Without one of these prefixes, the current search
|
||||||
path is used.
|
path is used.
|
||||||
|
|
||||||
The distinction between @file{./} and @file{$(srcdir)/} is important
|
The distinction between @file{./} (the @dfn{build directory}) and
|
||||||
when using the @samp{--srcdir} option to @file{configure}. A rule of
|
@file{$(srcdir)/} (the @dfn{source directory}) is important because
|
||||||
the form:
|
users can build in a separate directory using the @samp{--srcdir} option
|
||||||
|
to @file{configure}. A rule of the form:
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
foo.1 : foo.man sedscript
|
foo.1 : foo.man sedscript
|
||||||
@@ -63,15 +78,14 @@ foo.1 : foo.man sedscript
|
|||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
will fail when the current directory is not the source directory,
|
will fail when the build directory is not the source directory, because
|
||||||
because @file{foo.man} and @file{sedscript} are not in the current
|
@file{foo.man} and @file{sedscript} are in the the source directory.
|
||||||
directory.
|
|
||||||
|
|
||||||
When using GNU @code{make}, relying on @samp{VPATH} to find the source
|
When using GNU @code{make}, relying on @samp{VPATH} to find the source
|
||||||
file will work in the case where there is a single dependency file,
|
file will work in the case where there is a single dependency file,
|
||||||
since the @file{make} automatic variable @samp{$<} will represent the
|
since the @code{make} automatic variable @samp{$<} will represent the
|
||||||
source file wherever it is. (Many versions of @code{make} set @samp{$<}
|
source file wherever it is. (Many versions of @code{make} set @samp{$<}
|
||||||
only in implicit rules.) A makefile target like
|
only in implicit rules.) A Makefile target like
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
foo.o : bar.c
|
foo.o : bar.c
|
||||||
@@ -97,6 +111,21 @@ foo.1 : foo.man sedscript
|
|||||||
sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@@
|
sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@@
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
|
GNU distributions usually contain some files which are not source
|
||||||
|
files---for example, Info files, and the output from Autoconf, Automake,
|
||||||
|
Bison or Flex. Since these files normally appear in the source
|
||||||
|
directory, they should always appear in the source directory, not in the
|
||||||
|
build directory. So Makefile rules to update them should put the
|
||||||
|
updated files in the source directory.
|
||||||
|
|
||||||
|
However, if a file does not appear in the distribution, then the
|
||||||
|
Makefile should not put it in the source directory, because building a
|
||||||
|
program in ordinary circumstances should not modify the source directory
|
||||||
|
in any way.
|
||||||
|
|
||||||
|
Try to make the build and installation targets, at least (and all their
|
||||||
|
subtargets) work correctly with a parallel @code{make}.
|
||||||
|
|
||||||
@node Utilities in Makefiles
|
@node Utilities in Makefiles
|
||||||
@section Utilities in Makefiles
|
@section Utilities in Makefiles
|
||||||
|
|
||||||
@@ -107,228 +136,61 @@ special features of @code{ksh} or @code{bash}.
|
|||||||
The @code{configure} script and the Makefile rules for building and
|
The @code{configure} script and the Makefile rules for building and
|
||||||
installation should not use any utilities directly except these:
|
installation should not use any utilities directly except these:
|
||||||
|
|
||||||
|
@c dd find
|
||||||
|
@c gunzip gzip md5sum
|
||||||
|
@c mkfifo mknod tee uname
|
||||||
|
|
||||||
@example
|
@example
|
||||||
cat cmp cp echo egrep expr grep
|
cat cmp cp diff echo egrep expr false grep install-info
|
||||||
ln mkdir mv pwd rm rmdir sed test touch
|
ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
|
The compression program @code{gzip} can be used in the @code{dist} rule.
|
||||||
|
|
||||||
Stick to the generally supported options for these programs. For
|
Stick to the generally supported options for these programs. For
|
||||||
example, don't use @samp{mkdir -p}, convenient as it may be, because
|
example, don't use @samp{mkdir -p}, convenient as it may be, because
|
||||||
most systems don't support it.
|
most systems don't support it.
|
||||||
|
|
||||||
|
It is a good idea to avoid creating symbolic links in makefiles, since a
|
||||||
|
few systems don't support them.
|
||||||
|
|
||||||
The Makefile rules for building and installation can also use compilers
|
The Makefile rules for building and installation can also use compilers
|
||||||
and related programs, but should do so via @code{make} variables so that the
|
and related programs, but should do so via @code{make} variables so that the
|
||||||
user can substitute alternatives. Here are some of the programs we
|
user can substitute alternatives. Here are some of the programs we
|
||||||
mean:
|
mean:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
ar bison cc flex install ld lex
|
ar bison cc flex install ld ldconfig lex
|
||||||
make makeinfo ranlib texi2dvi yacc
|
make makeinfo ranlib texi2dvi yacc
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Use the following @code{make} variables:
|
Use the following @code{make} variables to run those programs:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LEX)
|
$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX)
|
||||||
$(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC)
|
$(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC)
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
When you use @code{ranlib}, you should make sure nothing bad happens if
|
When you use @code{ranlib} or @code{ldconfig}, you should make sure
|
||||||
the system does not have @code{ranlib}. Arrange to ignore an error
|
nothing bad happens if the system does not have the program in question.
|
||||||
from that command, and print a message before the command to tell the
|
Arrange to ignore an error from that command, and print a message before
|
||||||
user that failure of the @code{ranlib} command does not mean a problem.
|
the command to tell the user that failure of this command does not mean
|
||||||
|
a problem. (The Autoconf @samp{AC_PROG_RANLIB} macro can help with
|
||||||
|
this.)
|
||||||
|
|
||||||
If you use symbolic links, you should implement a fallback for systems
|
If you use symbolic links, you should implement a fallback for systems
|
||||||
that don't have symbolic links.
|
that don't have symbolic links.
|
||||||
|
|
||||||
|
Additional utilities that can be used via Make variables are:
|
||||||
|
|
||||||
|
@example
|
||||||
|
chgrp chmod chown mknod
|
||||||
|
@end example
|
||||||
|
|
||||||
It is ok to use other utilities in Makefile portions (or scripts)
|
It is ok to use other utilities in Makefile portions (or scripts)
|
||||||
intended only for particular systems where you know those utilities to
|
intended only for particular systems where you know those utilities
|
||||||
exist.
|
exist.
|
||||||
|
|
||||||
@node Standard Targets
|
|
||||||
@section Standard Targets for Users
|
|
||||||
|
|
||||||
All GNU programs should have the following targets in their Makefiles:
|
|
||||||
|
|
||||||
@table @samp
|
|
||||||
@item all
|
|
||||||
Compile the entire program. This should be the default target. This
|
|
||||||
target need not rebuild any documentation files; Info files should
|
|
||||||
normally be included in the distribution, and DVI files should be made
|
|
||||||
only when explicitly asked for.
|
|
||||||
|
|
||||||
@item install
|
|
||||||
Compile the program and copy the executables, libraries, and so on to
|
|
||||||
the file names where they should reside for actual use. If there is a
|
|
||||||
simple test to verify that a program is properly installed, this target
|
|
||||||
should run that test.
|
|
||||||
|
|
||||||
The commands should create all the directories in which files are to be
|
|
||||||
installed, if they don't already exist. This includes the directories
|
|
||||||
specified as the values of the variables @code{prefix} and
|
|
||||||
@code{exec_prefix}, as well as all subdirectories that are needed.
|
|
||||||
One way to do this is by means of an @code{installdirs} target
|
|
||||||
as described below.
|
|
||||||
|
|
||||||
Use @samp{-} before any command for installing a man page, so that
|
|
||||||
@code{make} will ignore any errors. This is in case there are systems
|
|
||||||
that don't have the Unix man page documentation system installed.
|
|
||||||
|
|
||||||
The way to install Info files is to copy them into @file{$(infodir)}
|
|
||||||
with @code{$(INSTALL_DATA)} (@pxref{Command Variables}), and then run
|
|
||||||
the @code{install-info} program if it is present. @code{install-info}
|
|
||||||
is a script that edits the Info @file{dir} file to add or update the
|
|
||||||
menu entry for the given Info file; it will be part of the Texinfo package.
|
|
||||||
Here is a sample rule to install an Info file:
|
|
||||||
|
|
||||||
@comment This example has been carefully formatted for the Make manual.
|
|
||||||
@comment Please do not reformat it without talking to roland@gnu.ai.mit.edu.
|
|
||||||
@smallexample
|
|
||||||
$(infodir)/foo.info: foo.info
|
|
||||||
# There may be a newer info file in . than in srcdir.
|
|
||||||
-if test -f foo.info; then d=.; \
|
|
||||||
else d=$(srcdir); fi; \
|
|
||||||
$(INSTALL_DATA) $$d/foo.info $@@; \
|
|
||||||
# Run install-info only if it exists.
|
|
||||||
# Use `if' instead of just prepending `-' to the
|
|
||||||
# line so we notice real errors from install-info.
|
|
||||||
# We use `$(SHELL) -c' because some shells do not
|
|
||||||
# fail gracefully when there is an unknown command.
|
|
||||||
if $(SHELL) -c 'install-info --version' \
|
|
||||||
>/dev/null 2>&1; then \
|
|
||||||
install-info --infodir=$(infodir) $$d/foo.info; \
|
|
||||||
else true; fi
|
|
||||||
@end smallexample
|
|
||||||
|
|
||||||
@item uninstall
|
|
||||||
Delete all the installed files that the @samp{install} target would
|
|
||||||
create (but not the noninstalled files such as @samp{make all} would
|
|
||||||
create).
|
|
||||||
|
|
||||||
@comment The gratuitous blank line here is to make the table look better
|
|
||||||
@comment in the printed Make manual. Please leave it in.
|
|
||||||
@item clean
|
|
||||||
|
|
||||||
Delete all files from the current directory that are normally created by
|
|
||||||
building the program. Don't delete the files that record the
|
|
||||||
configuration. Also preserve files that could be made by building, but
|
|
||||||
normally aren't because the distribution comes with them.
|
|
||||||
|
|
||||||
Delete @file{.dvi} files here if they are not part of the distribution.
|
|
||||||
|
|
||||||
@item distclean
|
|
||||||
Delete all files from the current directory that are created by
|
|
||||||
configuring or building the program. If you have unpacked the source
|
|
||||||
and built the program without creating any other files, @samp{make
|
|
||||||
distclean} should leave only the files that were in the distribution.
|
|
||||||
|
|
||||||
@item mostlyclean
|
|
||||||
Like @samp{clean}, but may refrain from deleting a few files that people
|
|
||||||
normally don't want to recompile. For example, the @samp{mostlyclean}
|
|
||||||
target for GCC does not delete @file{libgcc.a}, because recompiling it
|
|
||||||
is rarely necessary and takes a lot of time.
|
|
||||||
|
|
||||||
@item realclean
|
|
||||||
Delete everything from the current directory that can be reconstructed
|
|
||||||
with this Makefile. This typically includes everything deleted by
|
|
||||||
@code{distclean}, plus more: C source files produced by Bison, tags tables,
|
|
||||||
Info files, and so on.
|
|
||||||
|
|
||||||
One exception, however: @samp{make realclean} should not delete
|
|
||||||
@file{configure} even if @file{configure} can be remade using a rule in
|
|
||||||
the Makefile. More generally, @samp{make realclean} should not delete
|
|
||||||
anything that needs to exist in order to run @file{configure}
|
|
||||||
and then begin to build the program.
|
|
||||||
|
|
||||||
@item TAGS
|
|
||||||
Update a tags table for this program.
|
|
||||||
|
|
||||||
@item info
|
|
||||||
Generate any Info files needed. The best way to write the rules is as
|
|
||||||
follows:
|
|
||||||
|
|
||||||
@smallexample
|
|
||||||
info: foo.info
|
|
||||||
|
|
||||||
foo.info: foo.texi chap1.texi chap2.texi
|
|
||||||
$(MAKEINFO) $(srcdir)/foo.texi
|
|
||||||
@end smallexample
|
|
||||||
|
|
||||||
@noindent
|
|
||||||
You must define the variable @code{MAKEINFO} in the Makefile. It should
|
|
||||||
run the @code{makeinfo} program, which is part of the Texinfo
|
|
||||||
distribution.
|
|
||||||
|
|
||||||
@item dvi
|
|
||||||
Generate DVI files for all TeXinfo documentation.
|
|
||||||
For example:
|
|
||||||
|
|
||||||
@smallexample
|
|
||||||
dvi: foo.dvi
|
|
||||||
|
|
||||||
foo.dvi: foo.texi chap1.texi chap2.texi
|
|
||||||
$(TEXI2DVI) $(srcdir)/foo.texi
|
|
||||||
@end smallexample
|
|
||||||
|
|
||||||
@noindent
|
|
||||||
You must define the variable @code{TEXI2DVI} in the Makefile. It should
|
|
||||||
run the program @code{texi2dvi}, which is part of the Texinfo
|
|
||||||
distribution. Alternatively, write just the dependencies, and allow GNU
|
|
||||||
Make to provide the command.
|
|
||||||
|
|
||||||
@item dist
|
|
||||||
Create a distribution tar file for this program. The tar file should be
|
|
||||||
set up so that the file names in the tar file start with a subdirectory
|
|
||||||
name which is the name of the package it is a distribution for. This
|
|
||||||
name can include the version number.
|
|
||||||
|
|
||||||
For example, the distribution tar file of GCC version 1.40 unpacks into
|
|
||||||
a subdirectory named @file{gcc-1.40}.
|
|
||||||
|
|
||||||
The easiest way to do this is to create a subdirectory appropriately
|
|
||||||
named, use @code{ln} or @code{cp} to install the proper files in it, and
|
|
||||||
then @code{tar} that subdirectory.
|
|
||||||
|
|
||||||
The @code{dist} target should explicitly depend on all non-source files
|
|
||||||
that are in the distribution, to make sure they are up to date in the
|
|
||||||
distribution.
|
|
||||||
@xref{Releases, , Making Releases, standards, GNU Coding Standards}.
|
|
||||||
|
|
||||||
@item check
|
|
||||||
Perform self-tests (if any). The user must build the program before
|
|
||||||
running the tests, but need not install the program; you should write
|
|
||||||
the self-tests so that they work when the program is built but not
|
|
||||||
installed.
|
|
||||||
@end table
|
|
||||||
|
|
||||||
The following targets are suggested as conventional names, for programs
|
|
||||||
in which they are useful.
|
|
||||||
|
|
||||||
@table @code
|
|
||||||
@item installcheck
|
|
||||||
Perform installation tests (if any). The user must build and install
|
|
||||||
the program before running the tests. You should not assume that
|
|
||||||
@file{$(bindir)} is in the search path.
|
|
||||||
|
|
||||||
@item installdirs
|
|
||||||
It's useful to add a target named @samp{installdirs} to create the
|
|
||||||
directories where files are installed, and their parent directories.
|
|
||||||
There is a script called @file{mkinstalldirs} which is convenient for
|
|
||||||
this; find it in the Texinfo package.@c It's in /gd/gnu/lib/mkinstalldirs.
|
|
||||||
You can use a rule like this:
|
|
||||||
|
|
||||||
@comment This has been carefully formatted to look decent in the Make manual.
|
|
||||||
@comment Please be sure not to make it extend any further to the right.--roland
|
|
||||||
@smallexample
|
|
||||||
# Make sure all installation directories (e.g. $(bindir))
|
|
||||||
# actually exist by making them if necessary.
|
|
||||||
installdirs: mkinstalldirs
|
|
||||||
$(srcdir)/mkinstalldirs $(bindir) $(datadir) \
|
|
||||||
$(libdir) $(infodir) \
|
|
||||||
$(mandir)
|
|
||||||
@end smallexample
|
|
||||||
@end table
|
|
||||||
|
|
||||||
@node Command Variables
|
@node Command Variables
|
||||||
@section Variables for Specifying Commands
|
@section Variables for Specifying Commands
|
||||||
|
|
||||||
@@ -377,6 +239,9 @@ Put @code{CFLAGS} last in the compilation command, after other variables
|
|||||||
containing compiler options, so the user can use @code{CFLAGS} to
|
containing compiler options, so the user can use @code{CFLAGS} to
|
||||||
override the others.
|
override the others.
|
||||||
|
|
||||||
|
@code{CFLAGS} should be used in every invocation of the C compiler,
|
||||||
|
both those which do compilation and those which do linking.
|
||||||
|
|
||||||
Every Makefile should define the variable @code{INSTALL}, which is the
|
Every Makefile should define the variable @code{INSTALL}, which is the
|
||||||
basic command for installing a file into the system.
|
basic command for installing a file into the system.
|
||||||
|
|
||||||
@@ -401,7 +266,9 @@ installed.
|
|||||||
|
|
||||||
Installation directories should always be named by variables, so it is
|
Installation directories should always be named by variables, so it is
|
||||||
easy to install in a nonstandard place. The standard names for these
|
easy to install in a nonstandard place. The standard names for these
|
||||||
variables are as follows.
|
variables are described below. They are based on a standard filesystem
|
||||||
|
layout; variants of it are used in SVR4, 4.4BSD, Linux, Ultrix v4, and
|
||||||
|
other modern operating systems.
|
||||||
|
|
||||||
These two variables set the root for the installation. All the other
|
These two variables set the root for the installation. All the other
|
||||||
installation directories should be subdirectories of one of these two,
|
installation directories should be subdirectories of one of these two,
|
||||||
@@ -410,13 +277,16 @@ and nothing should be directly installed into these two directories.
|
|||||||
@table @samp
|
@table @samp
|
||||||
@item prefix
|
@item prefix
|
||||||
A prefix used in constructing the default values of the variables listed
|
A prefix used in constructing the default values of the variables listed
|
||||||
below. The default value of @code{prefix} should be @file{/usr/local}
|
below. The default value of @code{prefix} should be @file{/usr/local}.
|
||||||
(at least for now).
|
When building the complete GNU system, the prefix will be empty and
|
||||||
|
@file{/usr} will be a symbolic link to @file{/}.
|
||||||
|
(If you are using Autoconf, write it as @samp{@@prefix@@}.)
|
||||||
|
|
||||||
@item exec_prefix
|
@item exec_prefix
|
||||||
A prefix used in constructing the default values of some of the
|
A prefix used in constructing the default values of some of the
|
||||||
variables listed below. The default value of @code{exec_prefix} should
|
variables listed below. The default value of @code{exec_prefix} should
|
||||||
be @code{$(prefix)}.
|
be @code{$(prefix)}.
|
||||||
|
(If you are using Autoconf, write it as @samp{@@exec_prefix@@}.)
|
||||||
|
|
||||||
Generally, @code{$(exec_prefix)} is used for directories that contain
|
Generally, @code{$(exec_prefix)} is used for directories that contain
|
||||||
machine-specific files (such as executables and subroutine libraries),
|
machine-specific files (such as executables and subroutine libraries),
|
||||||
@@ -430,18 +300,21 @@ Executable programs are installed in one of the following directories.
|
|||||||
The directory for installing executable programs that users can run.
|
The directory for installing executable programs that users can run.
|
||||||
This should normally be @file{/usr/local/bin}, but write it as
|
This should normally be @file{/usr/local/bin}, but write it as
|
||||||
@file{$(exec_prefix)/bin}.
|
@file{$(exec_prefix)/bin}.
|
||||||
|
(If you are using Autoconf, write it as @samp{@@bindir@@}.)
|
||||||
|
|
||||||
@item sbindir
|
@item sbindir
|
||||||
The directory for installing executable programs that can be run from
|
The directory for installing executable programs that can be run from
|
||||||
the shell, but are only generally useful to system administrators. This
|
the shell, but are only generally useful to system administrators. This
|
||||||
should normally be @file{/usr/local/sbin}, but write it as
|
should normally be @file{/usr/local/sbin}, but write it as
|
||||||
@file{$(exec_prefix)/sbin}.
|
@file{$(exec_prefix)/sbin}.
|
||||||
|
(If you are using Autoconf, write it as @samp{@@sbindir@@}.)
|
||||||
|
|
||||||
@item libexecdir
|
@item libexecdir
|
||||||
@comment This paragraph adjusted to avoid overfull hbox --roland 5jul94
|
@comment This paragraph adjusted to avoid overfull hbox --roland 5jul94
|
||||||
The directory for installing executable programs to be run by other
|
The directory for installing executable programs to be run by other
|
||||||
programs rather than by users. This directory should normally be
|
programs rather than by users. This directory should normally be
|
||||||
@file{/usr/local/libexec}, but write it as @file{$(exec_prefix)/libexec}.
|
@file{/usr/local/libexec}, but write it as @file{$(exec_prefix)/libexec}.
|
||||||
|
(If you are using Autoconf, write it as @samp{@@libexecdir@@}.)
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
Data files used by the program during its execution are divided into
|
Data files used by the program during its execution are divided into
|
||||||
@@ -460,18 +333,20 @@ be shared between two machines.
|
|||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
This makes for six different possibilities. However, we want to
|
This makes for six different possibilities. However, we want to
|
||||||
discourage the use of architecture-dependent files, aside from of object
|
discourage the use of architecture-dependent files, aside from object
|
||||||
files and libraries. It is much cleaner to make other data files
|
files and libraries. It is much cleaner to make other data files
|
||||||
architecture-independent, and it is generally not hard.
|
architecture-independent, and it is generally not hard.
|
||||||
|
|
||||||
Therefore, here are the variables makefiles should use to specify
|
Therefore, here are the variables Makefiles should use to specify
|
||||||
directories:
|
directories:
|
||||||
|
|
||||||
@table @samp
|
@table @samp
|
||||||
@item datadir
|
@item datadir
|
||||||
The directory for installing read-only architecture independent data
|
The directory for installing read-only architecture independent data
|
||||||
files. This should normally be @file{/usr/local/share}, but write it as
|
files. This should normally be @file{/usr/local/share}, but write it as
|
||||||
@file{$(prefix)/share}. As a special exception, see @file{$(infodir)}
|
@file{$(prefix)/share}.
|
||||||
|
(If you are using Autoconf, write it as @samp{@@datadir@@}.)
|
||||||
|
As a special exception, see @file{$(infodir)}
|
||||||
and @file{$(includedir)} below.
|
and @file{$(includedir)} below.
|
||||||
|
|
||||||
@item sysconfdir
|
@item sysconfdir
|
||||||
@@ -481,40 +356,56 @@ and network configuration files, @file{/etc/passwd}, and so forth belong
|
|||||||
here. All the files in this directory should be ordinary ASCII text
|
here. All the files in this directory should be ordinary ASCII text
|
||||||
files. This directory should normally be @file{/usr/local/etc}, but
|
files. This directory should normally be @file{/usr/local/etc}, but
|
||||||
write it as @file{$(prefix)/etc}.
|
write it as @file{$(prefix)/etc}.
|
||||||
|
(If you are using Autoconf, write it as @samp{@@sysconfdir@@}.)
|
||||||
|
|
||||||
@c rewritten to avoid overfull hbox --tower
|
Do not install executables here in this directory (they probably belong
|
||||||
Do not install executables
|
in @file{$(libexecdir)} or @file{$(sbindir)}). Also do not install
|
||||||
@c here
|
files that are modified in the normal course of their use (programs
|
||||||
in this directory (they probably
|
whose purpose is to change the configuration of the system excluded).
|
||||||
belong in @file{$(libexecdir)} or @file{$(sbindir))}. Also do not
|
Those probably belong in @file{$(localstatedir)}.
|
||||||
install files that are modified in the normal course of their use
|
|
||||||
(programs whose purpose is to change the configuration of the system
|
|
||||||
excluded). Those probably belong in @file{$(localstatedir)}.
|
|
||||||
|
|
||||||
@item sharedstatedir
|
@item sharedstatedir
|
||||||
The directory for installing architecture-independent data files which
|
The directory for installing architecture-independent data files which
|
||||||
the programs modify while they run. This should normally be
|
the programs modify while they run. This should normally be
|
||||||
@file{/usr/local/com}, but write it as @file{$(prefix)/com}.
|
@file{/usr/local/com}, but write it as @file{$(prefix)/com}.
|
||||||
|
(If you are using Autoconf, write it as @samp{@@sharedstatedir@@}.)
|
||||||
|
|
||||||
@item localstatedir
|
@item localstatedir
|
||||||
The directory for installing data files which the programs modify while
|
The directory for installing data files which the programs modify while
|
||||||
they run, and that pertain to one specific machine. Users should never
|
they run, and that pertain to one specific machine. Users should never
|
||||||
need to modify files in this directory to configure the package's
|
need to modify files in this directory to configure the package's
|
||||||
operation; put such configuration information in separate files that go
|
operation; put such configuration information in separate files that go
|
||||||
in @file{datadir} or @file{$(sysconfdir)}. @file{$(localstatedir)}
|
in @file{$(datadir)} or @file{$(sysconfdir)}. @file{$(localstatedir)}
|
||||||
should normally be @file{/usr/local/var}, but write it as
|
should normally be @file{/usr/local/var}, but write it as
|
||||||
@file{$(prefix)/var}.
|
@file{$(prefix)/var}.
|
||||||
|
(If you are using Autoconf, write it as @samp{@@localstatedir@@}.)
|
||||||
|
|
||||||
@item libdir
|
@item libdir
|
||||||
The directory for object files and libraries of object code. Do not
|
The directory for object files and libraries of object code. Do not
|
||||||
install executables here, they probably belong in @file{$(libexecdir)}
|
install executables here, they probably ought to go in @file{$(libexecdir)}
|
||||||
instead. The value of @code{libdir} should normally be
|
instead. The value of @code{libdir} should normally be
|
||||||
@file{/usr/local/lib}, but write it as @file{$(exec_prefix)/lib}.
|
@file{/usr/local/lib}, but write it as @file{$(exec_prefix)/lib}.
|
||||||
|
(If you are using Autoconf, write it as @samp{@@libdir@@}.)
|
||||||
|
|
||||||
@item infodir
|
@item infodir
|
||||||
The directory for installing the Info files for this package. By
|
The directory for installing the Info files for this package. By
|
||||||
default, it should be @file{/usr/local/info}, but it should be written
|
default, it should be @file{/usr/local/info}, but it should be written
|
||||||
as @file{$(prefix)/info}.
|
as @file{$(prefix)/info}.
|
||||||
|
(If you are using Autoconf, write it as @samp{@@infodir@@}.)
|
||||||
|
|
||||||
|
@item lispdir
|
||||||
|
The directory for installing any Emacs Lisp files in this package. By
|
||||||
|
default, it should be @file{/usr/local/share/emacs/site-lisp}, but it
|
||||||
|
should be written as @file{$(prefix)/share/emacs/site-lisp}.
|
||||||
|
|
||||||
|
If you are using Autoconf, write the default as @samp{@@lispdir@@}.
|
||||||
|
In order to make @samp{@@lispdir@@} work, you need the following lines
|
||||||
|
in your @file{configure.in} file:
|
||||||
|
|
||||||
|
@example
|
||||||
|
lispdir='$@{datadir@}/emacs/site-lisp'
|
||||||
|
AC_SUBST(lispdir)
|
||||||
|
@end example
|
||||||
|
|
||||||
@item includedir
|
@item includedir
|
||||||
@c rewritten to avoid overfull hbox --roland
|
@c rewritten to avoid overfull hbox --roland
|
||||||
@@ -522,8 +413,9 @@ The directory for installing header files to be included by user
|
|||||||
programs with the C @samp{#include} preprocessor directive. This
|
programs with the C @samp{#include} preprocessor directive. This
|
||||||
should normally be @file{/usr/local/include}, but write it as
|
should normally be @file{/usr/local/include}, but write it as
|
||||||
@file{$(prefix)/include}.
|
@file{$(prefix)/include}.
|
||||||
|
(If you are using Autoconf, write it as @samp{@@includedir@@}.)
|
||||||
|
|
||||||
Most compilers other than GCC do not look for header files in
|
Most compilers other than GCC do not look for header files in directory
|
||||||
@file{/usr/local/include}. So installing the header files this way is
|
@file{/usr/local/include}. So installing the header files this way is
|
||||||
only useful with GCC. Sometimes this is not a problem because some
|
only useful with GCC. Sometimes this is not a problem because some
|
||||||
libraries are only really intended to work with GCC. But some libraries
|
libraries are only really intended to work with GCC. But some libraries
|
||||||
@@ -534,6 +426,7 @@ specified by @code{oldincludedir}.
|
|||||||
@item oldincludedir
|
@item oldincludedir
|
||||||
The directory for installing @samp{#include} header files for use with
|
The directory for installing @samp{#include} header files for use with
|
||||||
compilers other than GCC. This should normally be @file{/usr/include}.
|
compilers other than GCC. This should normally be @file{/usr/include}.
|
||||||
|
(If you are using Autoconf, you can write it as @samp{@@oldincludedir@@}.)
|
||||||
|
|
||||||
The Makefile commands should check whether the value of
|
The Makefile commands should check whether the value of
|
||||||
@code{oldincludedir} is empty. If it is, they should not try to use
|
@code{oldincludedir} is empty. If it is, they should not try to use
|
||||||
@@ -547,26 +440,25 @@ file in the @code{oldincludedir} directory if either (1) there is no
|
|||||||
package.
|
package.
|
||||||
|
|
||||||
To tell whether @file{foo.h} came from the Foo package, put a magic
|
To tell whether @file{foo.h} came from the Foo package, put a magic
|
||||||
string in the file---part of a comment---and grep for that string.
|
string in the file---part of a comment---and @code{grep} for that string.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
Unix-style man pages are installed in one of the following:
|
Unix-style man pages are installed in one of the following:
|
||||||
|
|
||||||
@table @samp
|
@table @samp
|
||||||
@item mandir
|
@item mandir
|
||||||
The directory for installing the man pages (if any) for this package.
|
The top-level directory for installing the man pages (if any) for this
|
||||||
It should include the suffix for the proper section of the
|
package. It will normally be @file{/usr/local/man}, but you should
|
||||||
manual---usually @samp{1} for a utility. It will normally be
|
write it as @file{$(prefix)/man}.
|
||||||
@file{/usr/local/man/man1}, but you should write it as
|
(If you are using Autoconf, write it as @samp{@@mandir@@}.)
|
||||||
@file{$(prefix)/man/man1}.
|
|
||||||
|
|
||||||
@item man1dir
|
@item man1dir
|
||||||
The directory for installing section 1 man pages.
|
The directory for installing section 1 man pages. Write it as
|
||||||
|
@file{$(mandir)/man1}.
|
||||||
@item man2dir
|
@item man2dir
|
||||||
The directory for installing section 2 man pages.
|
The directory for installing section 2 man pages. Write it as
|
||||||
|
@file{$(mandir)/man2}
|
||||||
@item @dots{}
|
@item @dots{}
|
||||||
Use these names instead of @samp{mandir} if the package needs to install man
|
|
||||||
pages in more than one section of the manual.
|
|
||||||
|
|
||||||
@strong{Don't make the primary documentation for any GNU software be a
|
@strong{Don't make the primary documentation for any GNU software be a
|
||||||
man page. Write a manual in Texinfo instead. Man pages are just for
|
man page. Write a manual in Texinfo instead. Man pages are just for
|
||||||
@@ -592,6 +484,7 @@ And finally, you should set the following variable:
|
|||||||
@item srcdir
|
@item srcdir
|
||||||
The directory for the sources being compiled. The value of this
|
The directory for the sources being compiled. The value of this
|
||||||
variable is normally inserted by the @code{configure} shell script.
|
variable is normally inserted by the @code{configure} shell script.
|
||||||
|
(If you are using Autconf, use @samp{srcdir = @@srcdir@@}.)
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
@@ -623,3 +516,378 @@ specify the exact same values for several different GNU packages. In
|
|||||||
order for this to be useful, all the packages must be designed so that
|
order for this to be useful, all the packages must be designed so that
|
||||||
they will work sensibly when the user does so.
|
they will work sensibly when the user does so.
|
||||||
|
|
||||||
|
@node Standard Targets
|
||||||
|
@section Standard Targets for Users
|
||||||
|
|
||||||
|
All GNU programs should have the following targets in their Makefiles:
|
||||||
|
|
||||||
|
@table @samp
|
||||||
|
@item all
|
||||||
|
Compile the entire program. This should be the default target. This
|
||||||
|
target need not rebuild any documentation files; Info files should
|
||||||
|
normally be included in the distribution, and DVI files should be made
|
||||||
|
only when explicitly asked for.
|
||||||
|
|
||||||
|
By default, the Make rules should compile and link with @samp{-g}, so
|
||||||
|
that executable programs have debugging symbols. Users who don't mind
|
||||||
|
being helpless can strip the executables later if they wish.
|
||||||
|
|
||||||
|
@item install
|
||||||
|
Compile the program and copy the executables, libraries, and so on to
|
||||||
|
the file names where they should reside for actual use. If there is a
|
||||||
|
simple test to verify that a program is properly installed, this target
|
||||||
|
should run that test.
|
||||||
|
|
||||||
|
Do not strip executables when installing them. Devil-may-care users can
|
||||||
|
use the @code{install-strip} target to do that.
|
||||||
|
|
||||||
|
If possible, write the @code{install} target rule so that it does not
|
||||||
|
modify anything in the directory where the program was built, provided
|
||||||
|
@samp{make all} has just been done. This is convenient for building the
|
||||||
|
program under one user name and installing it under another.
|
||||||
|
|
||||||
|
The commands should create all the directories in which files are to be
|
||||||
|
installed, if they don't already exist. This includes the directories
|
||||||
|
specified as the values of the variables @code{prefix} and
|
||||||
|
@code{exec_prefix}, as well as all subdirectories that are needed.
|
||||||
|
One way to do this is by means of an @code{installdirs} target
|
||||||
|
as described below.
|
||||||
|
|
||||||
|
Use @samp{-} before any command for installing a man page, so that
|
||||||
|
@code{make} will ignore any errors. This is in case there are systems
|
||||||
|
that don't have the Unix man page documentation system installed.
|
||||||
|
|
||||||
|
The way to install Info files is to copy them into @file{$(infodir)}
|
||||||
|
with @code{$(INSTALL_DATA)} (@pxref{Command Variables}), and then run
|
||||||
|
the @code{install-info} program if it is present. @code{install-info}
|
||||||
|
is a program that edits the Info @file{dir} file to add or update the
|
||||||
|
menu entry for the given Info file; it is part of the Texinfo package.
|
||||||
|
Here is a sample rule to install an Info file:
|
||||||
|
|
||||||
|
@comment This example has been carefully formatted for the Make manual.
|
||||||
|
@comment Please do not reformat it without talking to roland@gnu.ai.mit.edu.
|
||||||
|
@smallexample
|
||||||
|
$(infodir)/foo.info: foo.info
|
||||||
|
$(POST_INSTALL)
|
||||||
|
# There may be a newer info file in . than in srcdir.
|
||||||
|
-if test -f foo.info; then d=.; \
|
||||||
|
else d=$(srcdir); fi; \
|
||||||
|
$(INSTALL_DATA) $$d/foo.info $@@; \
|
||||||
|
# Run install-info only if it exists.
|
||||||
|
# Use `if' instead of just prepending `-' to the
|
||||||
|
# line so we notice real errors from install-info.
|
||||||
|
# We use `$(SHELL) -c' because some shells do not
|
||||||
|
# fail gracefully when there is an unknown command.
|
||||||
|
if $(SHELL) -c 'install-info --version' \
|
||||||
|
>/dev/null 2>&1; then \
|
||||||
|
install-info --dir-file=$(infodir)/dir \
|
||||||
|
$(infodir)/foo.info; \
|
||||||
|
else true; fi
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
When writing the @code{install} target, you must classify all the
|
||||||
|
commands into three categories: normal ones, @dfn{pre-installation}
|
||||||
|
commands and @dfn{post-installation} commands. @xref{Install Command
|
||||||
|
Categories}.
|
||||||
|
|
||||||
|
@item uninstall
|
||||||
|
Delete all the installed files---the copies that the @samp{install}
|
||||||
|
target creates.
|
||||||
|
|
||||||
|
This rule should not modify the directories where compilation is done,
|
||||||
|
only the directories where files are installed.
|
||||||
|
|
||||||
|
The uninstallation commands are divided into three categories, just like
|
||||||
|
the installation commands. @xref{Install Command Categories}.
|
||||||
|
|
||||||
|
@item install-strip
|
||||||
|
Like @code{install}, but strip the executable files while installing
|
||||||
|
them. In many cases, the definition of this target can be very simple:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
install-strip:
|
||||||
|
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \
|
||||||
|
install
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
Normally we do not recommend stripping an executable unless you are sure
|
||||||
|
the program has no bugs. However, it can be reasonable to install a
|
||||||
|
stripped executable for actual execution while saving the unstripped
|
||||||
|
executable elsewhere in case there is a bug.
|
||||||
|
|
||||||
|
@comment The gratuitous blank line here is to make the table look better
|
||||||
|
@comment in the printed Make manual. Please leave it in.
|
||||||
|
@item clean
|
||||||
|
|
||||||
|
Delete all files from the current directory that are normally created by
|
||||||
|
building the program. Don't delete the files that record the
|
||||||
|
configuration. Also preserve files that could be made by building, but
|
||||||
|
normally aren't because the distribution comes with them.
|
||||||
|
|
||||||
|
Delete @file{.dvi} files here if they are not part of the distribution.
|
||||||
|
|
||||||
|
@item distclean
|
||||||
|
Delete all files from the current directory that are created by
|
||||||
|
configuring or building the program. If you have unpacked the source
|
||||||
|
and built the program without creating any other files, @samp{make
|
||||||
|
distclean} should leave only the files that were in the distribution.
|
||||||
|
|
||||||
|
@item mostlyclean
|
||||||
|
Like @samp{clean}, but may refrain from deleting a few files that people
|
||||||
|
normally don't want to recompile. For example, the @samp{mostlyclean}
|
||||||
|
target for GCC does not delete @file{libgcc.a}, because recompiling it
|
||||||
|
is rarely necessary and takes a lot of time.
|
||||||
|
|
||||||
|
@item maintainer-clean
|
||||||
|
Delete almost everything from the current directory that can be
|
||||||
|
reconstructed with this Makefile. This typically includes everything
|
||||||
|
deleted by @code{distclean}, plus more: C source files produced by
|
||||||
|
Bison, tags tables, Info files, and so on.
|
||||||
|
|
||||||
|
The reason we say ``almost everything'' is that running the command
|
||||||
|
@samp{make maintainer-clean} should not delete @file{configure} even if
|
||||||
|
@file{configure} can be remade using a rule in the Makefile. More generally,
|
||||||
|
@samp{make maintainer-clean} should not delete anything that needs to
|
||||||
|
exist in order to run @file{configure} and then begin to build the
|
||||||
|
program. This is the only exception; @code{maintainer-clean} should
|
||||||
|
delete everything else that can be rebuilt.
|
||||||
|
|
||||||
|
The @samp{maintainer-clean} target is intended to be used by a maintainer of
|
||||||
|
the package, not by ordinary users. You may need special tools to
|
||||||
|
reconstruct some of the files that @samp{make maintainer-clean} deletes.
|
||||||
|
Since these files are normally included in the distribution, we don't
|
||||||
|
take care to make them easy to reconstruct. If you find you need to
|
||||||
|
unpack the full distribution again, don't blame us.
|
||||||
|
|
||||||
|
To help make users aware of this, the commands for the special
|
||||||
|
@code{maintainer-clean} target should start with these two:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
@@echo 'This command is intended for maintainers to use; it'
|
||||||
|
@@echo 'deletes files that may need special tools to rebuild.'
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
@item TAGS
|
||||||
|
Update a tags table for this program.
|
||||||
|
@c ADR: how?
|
||||||
|
|
||||||
|
@item info
|
||||||
|
Generate any Info files needed. The best way to write the rules is as
|
||||||
|
follows:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
info: foo.info
|
||||||
|
|
||||||
|
foo.info: foo.texi chap1.texi chap2.texi
|
||||||
|
$(MAKEINFO) $(srcdir)/foo.texi
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
@noindent
|
||||||
|
You must define the variable @code{MAKEINFO} in the Makefile. It should
|
||||||
|
run the @code{makeinfo} program, which is part of the Texinfo
|
||||||
|
distribution.
|
||||||
|
|
||||||
|
Normally a GNU distribution comes with Info files, and that means the
|
||||||
|
Info files are present in the source directory. Therefore, the Make
|
||||||
|
rule for an info file should update it in the source directory. When
|
||||||
|
users build the package, ordinarily Make will not update the Info files
|
||||||
|
because they will already be up to date.
|
||||||
|
|
||||||
|
@item dvi
|
||||||
|
Generate DVI files for all Texinfo documentation.
|
||||||
|
For example:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
dvi: foo.dvi
|
||||||
|
|
||||||
|
foo.dvi: foo.texi chap1.texi chap2.texi
|
||||||
|
$(TEXI2DVI) $(srcdir)/foo.texi
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
@noindent
|
||||||
|
You must define the variable @code{TEXI2DVI} in the Makefile. It should
|
||||||
|
run the program @code{texi2dvi}, which is part of the Texinfo
|
||||||
|
distribution.@footnote{@code{texi2dvi} uses @TeX{} to do the real work
|
||||||
|
of formatting. @TeX{} is not distributed with Texinfo.} Alternatively,
|
||||||
|
write just the dependencies, and allow GNU @code{make} to provide the command.
|
||||||
|
|
||||||
|
@item dist
|
||||||
|
Create a distribution tar file for this program. The tar file should be
|
||||||
|
set up so that the file names in the tar file start with a subdirectory
|
||||||
|
name which is the name of the package it is a distribution for. This
|
||||||
|
name can include the version number.
|
||||||
|
|
||||||
|
For example, the distribution tar file of GCC version 1.40 unpacks into
|
||||||
|
a subdirectory named @file{gcc-1.40}.
|
||||||
|
|
||||||
|
The easiest way to do this is to create a subdirectory appropriately
|
||||||
|
named, use @code{ln} or @code{cp} to install the proper files in it, and
|
||||||
|
then @code{tar} that subdirectory.
|
||||||
|
|
||||||
|
Compress the tar file file with @code{gzip}. For example, the actual
|
||||||
|
distribution file for GCC version 1.40 is called @file{gcc-1.40.tar.gz}.
|
||||||
|
|
||||||
|
The @code{dist} target should explicitly depend on all non-source files
|
||||||
|
that are in the distribution, to make sure they are up to date in the
|
||||||
|
distribution.
|
||||||
|
@ifset CODESTD
|
||||||
|
@xref{Releases, , Making Releases}.
|
||||||
|
@end ifset
|
||||||
|
@ifclear CODESTD
|
||||||
|
@xref{Releases, , Making Releases, standards, GNU Coding Standards}.
|
||||||
|
@end ifclear
|
||||||
|
|
||||||
|
@item check
|
||||||
|
Perform self-tests (if any). The user must build the program before
|
||||||
|
running the tests, but need not install the program; you should write
|
||||||
|
the self-tests so that they work when the program is built but not
|
||||||
|
installed.
|
||||||
|
@end table
|
||||||
|
|
||||||
|
The following targets are suggested as conventional names, for programs
|
||||||
|
in which they are useful.
|
||||||
|
|
||||||
|
@table @code
|
||||||
|
@item installcheck
|
||||||
|
Perform installation tests (if any). The user must build and install
|
||||||
|
the program before running the tests. You should not assume that
|
||||||
|
@file{$(bindir)} is in the search path.
|
||||||
|
|
||||||
|
@item installdirs
|
||||||
|
It's useful to add a target named @samp{installdirs} to create the
|
||||||
|
directories where files are installed, and their parent directories.
|
||||||
|
There is a script called @file{mkinstalldirs} which is convenient for
|
||||||
|
this; you can find it in the Texinfo package.
|
||||||
|
@c It's in /gd/gnu/lib/mkinstalldirs.
|
||||||
|
You can use a rule like this:
|
||||||
|
|
||||||
|
@comment This has been carefully formatted to look decent in the Make manual.
|
||||||
|
@comment Please be sure not to make it extend any further to the right.--roland
|
||||||
|
@smallexample
|
||||||
|
# Make sure all installation directories (e.g. $(bindir))
|
||||||
|
# actually exist by making them if necessary.
|
||||||
|
installdirs: mkinstalldirs
|
||||||
|
$(srcdir)/mkinstalldirs $(bindir) $(datadir) \
|
||||||
|
$(libdir) $(infodir) \
|
||||||
|
$(mandir)
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
This rule should not modify the directories where compilation is done.
|
||||||
|
It should do nothing but create installation directories.
|
||||||
|
@end table
|
||||||
|
|
||||||
|
@node Install Command Categories
|
||||||
|
@section Install Command Categories
|
||||||
|
|
||||||
|
@cindex pre-installation commands
|
||||||
|
@cindex post-installation commands
|
||||||
|
When writing the @code{install} target, you must classify all the
|
||||||
|
commands into three categories: normal ones, @dfn{pre-installation}
|
||||||
|
commands and @dfn{post-installation} commands.
|
||||||
|
|
||||||
|
Normal commands move files into their proper places, and set their
|
||||||
|
modes. They may not alter any files except the ones that come entirely
|
||||||
|
from the package they belong to.
|
||||||
|
|
||||||
|
Pre-installation and post-installation commands may alter other files;
|
||||||
|
in particular, they can edit global configuration files or data bases.
|
||||||
|
|
||||||
|
Pre-installation commands are typically executed before the normal
|
||||||
|
commands, and post-installation commands are typically run after the
|
||||||
|
normal commands.
|
||||||
|
|
||||||
|
The most common use for a post-installation command is to run
|
||||||
|
@code{install-info}. This cannot be done with a normal command, since
|
||||||
|
it alters a file (the Info directory) which does not come entirely and
|
||||||
|
solely from the package being installed. It is a post-installation
|
||||||
|
command because it needs to be done after the normal command which
|
||||||
|
installs the package's Info files.
|
||||||
|
|
||||||
|
Most programs don't need any pre-installation commands, but we have the
|
||||||
|
feature just in case it is needed.
|
||||||
|
|
||||||
|
To classify the commands in the @code{install} rule into these three
|
||||||
|
categories, insert @dfn{category lines} among them. A category line
|
||||||
|
specifies the category for the commands that follow.
|
||||||
|
|
||||||
|
A category line consists of a tab and a reference to a special Make
|
||||||
|
variable, plus an optional comment at the end. There are three
|
||||||
|
variables you can use, one for each category; the variable name
|
||||||
|
specifies the category. Category lines are no-ops in ordinary execution
|
||||||
|
because these three Make variables are normally undefined (and you
|
||||||
|
@emph{should not} define them in the makefile).
|
||||||
|
|
||||||
|
Here are the three possible category lines, each with a comment that
|
||||||
|
explains what it means:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
$(PRE_INSTALL) # @r{Pre-install commands follow.}
|
||||||
|
$(POST_INSTALL) # @r{Post-install commands follow.}
|
||||||
|
$(NORMAL_INSTALL) # @r{Normal commands follow.}
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
If you don't use a category line at the beginning of the @code{install}
|
||||||
|
rule, all the commands are classified as normal until the first category
|
||||||
|
line. If you don't use any category lines, all the commands are
|
||||||
|
classified as normal.
|
||||||
|
|
||||||
|
These are the category lines for @code{uninstall}:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
$(PRE_UNINSTALL) # @r{Pre-uninstall commands follow.}
|
||||||
|
$(POST_UNINSTALL) # @r{Post-uninstall commands follow.}
|
||||||
|
$(NORMAL_UNINSTALL) # @r{Normal commands follow.}
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
Typically, a pre-uninstall command would be used for deleting entries
|
||||||
|
from the Info directory.
|
||||||
|
|
||||||
|
If the @code{install} or @code{uninstall} target has any dependencies
|
||||||
|
which act as subroutines of installation, then you should start
|
||||||
|
@emph{each} dependency's commands with a category line, and start the
|
||||||
|
main target's commands with a category line also. This way, you can
|
||||||
|
ensure that each command is placed in the right category regardless of
|
||||||
|
which of the dependencies actually run.
|
||||||
|
|
||||||
|
Pre-installation and post-installation commands should not run any
|
||||||
|
programs except for these:
|
||||||
|
|
||||||
|
@example
|
||||||
|
[ basename bash cat chgrp chmod chown cmp cp dd diff echo
|
||||||
|
egrep expand expr false fgrep find getopt grep gunzip gzip
|
||||||
|
hostname install install-info kill ldconfig ln ls md5sum
|
||||||
|
mkdir mkfifo mknod mv printenv pwd rm rmdir sed sort tee
|
||||||
|
test touch true uname xargs yes
|
||||||
|
@end example
|
||||||
|
|
||||||
|
@cindex binary packages
|
||||||
|
The reason for distinguishing the commands in this way is for the sake
|
||||||
|
of making binary packages. Typically a binary package contains all the
|
||||||
|
executables and other files that need to be installed, and has its own
|
||||||
|
method of installing them---so it does not need to run the normal
|
||||||
|
installation commands. But installing the binary package does need to
|
||||||
|
execute the pre-installation and post-installation commands.
|
||||||
|
|
||||||
|
Programs to build binary packages work by extracting the
|
||||||
|
pre-installation and post-installation commands. Here is one way of
|
||||||
|
extracting the pre-installation commands:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
make -n install -o all \
|
||||||
|
PRE_INSTALL=pre-install \
|
||||||
|
POST_INSTALL=post-install \
|
||||||
|
NORMAL_INSTALL=normal-install \
|
||||||
|
| gawk -f pre-install.awk
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
@noindent
|
||||||
|
where the file @file{pre-install.awk} could contain this:
|
||||||
|
|
||||||
|
@smallexample
|
||||||
|
$0 ~ /^\t[ \t]*(normal_install|post_install)[ \t]*$/ @{on = 0@}
|
||||||
|
on @{print $0@}
|
||||||
|
$0 ~ /^\t[ \t]*pre_install[ \t]*$/ @{on = 1@}
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
The resulting file of pre-installation commands is executed as a shell
|
||||||
|
script as part of installing the binary package.
|
||||||
|
|||||||
2
make.1
2
make.1
@@ -8,7 +8,7 @@ make \- GNU make utility to maintain groups of programs
|
|||||||
makefile ] [ option ] ...
|
makefile ] [ option ] ...
|
||||||
target ...
|
target ...
|
||||||
.SH WARNING
|
.SH WARNING
|
||||||
This man paage is an extract of the documentation of
|
This man page is an extract of the documentation of
|
||||||
.I GNU make .
|
.I GNU make .
|
||||||
It is updated only occasionally, because the GNU project does not use nroff.
|
It is updated only occasionally, because the GNU project does not use nroff.
|
||||||
For complete, current documentation, refer to the Info file
|
For complete, current documentation, refer to the Info file
|
||||||
|
|||||||
193
make.h
193
make.h
@@ -1,5 +1,5 @@
|
|||||||
/* Miscellaneous global declarations and portability cruft for GNU Make.
|
/* Miscellaneous global declarations and portability cruft for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -28,6 +28,17 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#undef HAVE_CONFIG_H
|
#undef HAVE_CONFIG_H
|
||||||
#define HAVE_CONFIG_H
|
#define HAVE_CONFIG_H
|
||||||
|
|
||||||
|
|
||||||
|
/* Use prototypes if available. */
|
||||||
|
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
||||||
|
#undef PARAMS
|
||||||
|
#define PARAMS(protos) protos
|
||||||
|
#else /* Not C++ or ANSI C. */
|
||||||
|
#undef PARAMS
|
||||||
|
#define PARAMS(protos) ()
|
||||||
|
#endif /* C++ or ANSI C. */
|
||||||
|
|
||||||
|
|
||||||
#ifdef CRAY
|
#ifdef CRAY
|
||||||
/* This must happen before #include <signal.h> so
|
/* This must happen before #include <signal.h> so
|
||||||
that the declaration therein is changed. */
|
that the declaration therein is changed. */
|
||||||
@@ -61,15 +72,13 @@ extern int errno;
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
|
/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
|
||||||
POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself! */
|
POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself! */
|
||||||
#if defined (_POSIX_VERSION) && !defined (ultrix)
|
#if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS)
|
||||||
#define POSIX
|
#define POSIX
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Some systems define _POSIX_VERSION but are not really POSIX.1. */
|
/* Some systems define _POSIX_VERSION but are not really POSIX.1. */
|
||||||
#if (defined (butterfly) || defined (__arm) || \
|
#if (defined (butterfly) || defined (__arm) || (defined (__mips) && defined (_SYSTYPE_SVR3)) || (defined (sequent) && defined (i386)))
|
||||||
(defined (__mips) && defined (_SYSTYPE_SVR3)) || \
|
|
||||||
(defined (sequent) && defined (i386)))
|
|
||||||
#undef POSIX
|
#undef POSIX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -77,15 +86,6 @@ extern int errno;
|
|||||||
#define POSIX
|
#define POSIX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined (HAVE_SYS_SIGLIST) && defined (HAVE__SYS_SIGLIST)
|
|
||||||
#define sys_siglist _sys_siglist
|
|
||||||
#define HAVE_SYS_SIGLIST /* Now we have it. */
|
|
||||||
|
|
||||||
/* It was declared in <signal.h>, with who knows what type.
|
|
||||||
Don't declare it again and risk conflicting. */
|
|
||||||
#define SYS_SIGLIST_DECLARED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_SYS_SIGLIST
|
#ifdef HAVE_SYS_SIGLIST
|
||||||
#ifndef SYS_SIGLIST_DECLARED
|
#ifndef SYS_SIGLIST_DECLARED
|
||||||
extern char *sys_siglist[];
|
extern char *sys_siglist[];
|
||||||
@@ -132,11 +132,24 @@ extern char *sys_siglist[];
|
|||||||
#define PATH_VAR(var) char var[PATH_MAX]
|
#define PATH_VAR(var) char var[PATH_MAX]
|
||||||
#else
|
#else
|
||||||
#define NEED_GET_PATH_MAX
|
#define NEED_GET_PATH_MAX
|
||||||
extern unsigned int get_path_max ();
|
extern unsigned int get_path_max PARAMS ((void));
|
||||||
#define GET_PATH_MAX (get_path_max ())
|
#define GET_PATH_MAX (get_path_max ())
|
||||||
#define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX)
|
#define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CHAR_BIT
|
||||||
|
#define CHAR_BIT 8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Nonzero if the integer type T is signed. */
|
||||||
|
#define INTEGER_TYPE_SIGNED(t) ((t) -1 < 0)
|
||||||
|
|
||||||
|
/* The minimum and maximum values for the integer type T.
|
||||||
|
Use ~ (t) 0, not -1, for portability to 1's complement hosts. */
|
||||||
|
#define INTEGER_TYPE_MINIMUM(t) \
|
||||||
|
(! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))
|
||||||
|
#define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t))
|
||||||
|
|
||||||
#ifdef STAT_MACROS_BROKEN
|
#ifdef STAT_MACROS_BROKEN
|
||||||
#ifdef S_ISREG
|
#ifdef S_ISREG
|
||||||
#undef S_ISREG
|
#undef S_ISREG
|
||||||
@@ -153,8 +166,16 @@ extern unsigned int get_path_max ();
|
|||||||
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
|
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <types.h>
|
||||||
|
#include <unixlib.h>
|
||||||
|
#include <unixio.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <perror.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (defined (STDC_HEADERS) || defined (__GNU_LIBRARY__))
|
#if (defined (STDC_HEADERS) || defined (__GNU_LIBRARY__) || defined(VMS))
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#define ANSI_STRING
|
#define ANSI_STRING
|
||||||
@@ -170,11 +191,12 @@ extern unsigned int get_path_max ();
|
|||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern char *malloc (), *realloc ();
|
extern char *malloc PARAMS ((int));
|
||||||
extern void free ();
|
extern char *realloc PARAMS ((char *, int));
|
||||||
|
extern void free PARAMS ((char *));
|
||||||
|
|
||||||
extern void qsort ();
|
extern void abort PARAMS ((void));
|
||||||
extern void abort (), exit ();
|
extern void exit PARAMS ((int));
|
||||||
|
|
||||||
#endif /* Standard headers. */
|
#endif /* Standard headers. */
|
||||||
|
|
||||||
@@ -193,8 +215,8 @@ extern void abort (), exit ();
|
|||||||
#ifndef bzero
|
#ifndef bzero
|
||||||
#define bzero(s, n) memset ((s), 0, (n))
|
#define bzero(s, n) memset ((s), 0, (n))
|
||||||
#endif
|
#endif
|
||||||
#ifndef bcopy
|
#if defined(HAVE_MEMMOVE) && !defined(bcopy)
|
||||||
#define bcopy(s, d, n) memcpy ((d), (s), (n))
|
#define bcopy(s, d, n) memmove ((d), (s), (n))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else /* Not ANSI_STRING. */
|
#else /* Not ANSI_STRING. */
|
||||||
@@ -215,8 +237,8 @@ extern void bcopy ();
|
|||||||
/* SCO Xenix has a buggy macro definition in <string.h>. */
|
/* SCO Xenix has a buggy macro definition in <string.h>. */
|
||||||
#undef strerror
|
#undef strerror
|
||||||
|
|
||||||
#ifndef ANSI_STRING
|
#if !defined(ANSI_STRING) && !defined(__DECC)
|
||||||
extern char *strerror ();
|
extern char *strerror PARAMS ((int errnum));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -237,14 +259,30 @@ extern char *alloca ();
|
|||||||
#define streq(a, b) \
|
#define streq(a, b) \
|
||||||
((a) == (b) || \
|
((a) == (b) || \
|
||||||
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
|
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
|
||||||
|
#ifdef _AMIGA
|
||||||
|
#define strieq(a, b) \
|
||||||
|
((a) == (b) || \
|
||||||
|
(tolower(*(a)) == tolower(*(b)) && (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1))))
|
||||||
|
#else
|
||||||
|
#define strieq(a, b) \
|
||||||
|
((a) == (b) || \
|
||||||
|
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
/* Buggy compiler can't handle this. */
|
/* Buggy compiler can't handle this. */
|
||||||
#define streq(a, b) (strcmp ((a), (b)) == 0)
|
#define streq(a, b) (strcmp ((a), (b)) == 0)
|
||||||
|
#define strieq(a, b) (strcmp ((a), (b)) == 0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Add to VAR the hashing value of C, one character in a name. */
|
/* Add to VAR the hashing value of C, one character in a name. */
|
||||||
#define HASH(var, c) \
|
#define HASH(var, c) \
|
||||||
((var += (c)), (var = ((var) << 7) + ((var) >> 20)))
|
((var += (c)), (var = ((var) << 7) + ((var) >> 20)))
|
||||||
|
#ifdef _AMIGA /* Fold filenames on #amiga */
|
||||||
|
#define HASHI(var, c) \
|
||||||
|
((var += tolower((c))), (var = ((var) << 7) + ((var) >> 20)))
|
||||||
|
#else
|
||||||
|
#define HASHI(var, c) HASH(var,c)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) || defined(ENUM_BITFIELDS)
|
#if defined(__GNUC__) || defined(ENUM_BITFIELDS)
|
||||||
#define ENUM_BITFIELD(bits) :bits
|
#define ENUM_BITFIELD(bits) :bits
|
||||||
@@ -252,25 +290,53 @@ extern char *alloca ();
|
|||||||
#define ENUM_BITFIELD(bits)
|
#define ENUM_BITFIELD(bits)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __MSDOS__
|
#if defined(__MSDOS__) || defined(WINDOWS32)
|
||||||
#define PATH_SEPARATOR_CHAR ';'
|
#define PATH_SEPARATOR_CHAR ';'
|
||||||
#else
|
#else
|
||||||
|
#if defined(VMS)
|
||||||
|
#define PATH_SEPARATOR_CHAR ','
|
||||||
|
#else
|
||||||
#define PATH_SEPARATOR_CHAR ':'
|
#define PATH_SEPARATOR_CHAR ':'
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#define pipe(p) _pipe(p, 512, O_BINARY)
|
||||||
|
#define kill(pid,sig) w32_kill(pid,sig)
|
||||||
|
|
||||||
|
extern void sync_Path_environment(void);
|
||||||
|
extern int kill(int pid, int sig);
|
||||||
|
extern int safe_stat(char *file, struct stat *sb);
|
||||||
|
extern char *end_of_token_w32();
|
||||||
|
#endif
|
||||||
|
|
||||||
extern void die ();
|
extern void die ();
|
||||||
extern void message (), fatal (), error ();
|
extern void message ();
|
||||||
extern void makefile_error (), makefile_fatal ();
|
extern void fatal ();
|
||||||
extern void pfatal_with_name (), perror_with_name ();
|
extern void error ();
|
||||||
extern char *savestring (), *concat ();
|
extern void log_working_directory ();
|
||||||
extern char *xmalloc (), *xrealloc ();
|
extern void makefile_error ();
|
||||||
extern char *find_next_token (), *next_token (), *end_of_token ();
|
extern void makefile_fatal ();
|
||||||
extern void collapse_continuations (), remove_comments ();
|
extern void pfatal_with_name ();
|
||||||
extern char *sindex (), *lindex ();
|
extern void perror_with_name ();
|
||||||
|
extern char *savestring ();
|
||||||
|
extern char *concat ();
|
||||||
|
extern char *xmalloc ();
|
||||||
|
extern char *xrealloc ();
|
||||||
|
extern char *find_next_token ();
|
||||||
|
extern char *next_token ();
|
||||||
|
extern char *end_of_token ();
|
||||||
|
extern void collapse_continuations ();
|
||||||
|
extern void remove_comments ();
|
||||||
|
extern char *sindex ();
|
||||||
|
extern char *lindex ();
|
||||||
extern int alpha_compare ();
|
extern int alpha_compare ();
|
||||||
extern void print_spaces ();
|
extern void print_spaces ();
|
||||||
extern struct dep *copy_dep_chain ();
|
extern struct dep *copy_dep_chain ();
|
||||||
extern char *find_char_unquote (), *find_percent ();
|
extern char *find_char_unquote ();
|
||||||
|
extern char *find_percent ();
|
||||||
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
extern int ar_name ();
|
extern int ar_name ();
|
||||||
@@ -280,17 +346,24 @@ extern time_t ar_member_date ();
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void dir_load ();
|
extern void dir_load ();
|
||||||
extern int dir_file_exists_p (), file_exists_p (), file_impossible_p ();
|
extern int dir_file_exists_p ();
|
||||||
|
extern int file_exists_p ();
|
||||||
|
extern int file_impossible_p ();
|
||||||
extern void file_impossible ();
|
extern void file_impossible ();
|
||||||
extern char *dir_name ();
|
extern char *dir_name ();
|
||||||
|
|
||||||
extern void define_default_variables ();
|
extern void define_default_variables ();
|
||||||
extern void set_default_suffixes (), install_default_suffix_rules ();
|
extern void set_default_suffixes ();
|
||||||
extern void install_default_implicit_rules (), count_implicit_rule_limits ();
|
extern void install_default_suffix_rules ();
|
||||||
extern void convert_to_pattern (), create_pattern_rule ();
|
extern void install_default_implicit_rules ();
|
||||||
|
extern void count_implicit_rule_limits ();
|
||||||
|
extern void convert_to_pattern ();
|
||||||
|
extern void create_pattern_rule ();
|
||||||
|
|
||||||
extern void build_vpath_lists (), construct_vpath_list ();
|
extern void build_vpath_lists ();
|
||||||
|
extern void construct_vpath_list ();
|
||||||
extern int vpath_search ();
|
extern int vpath_search ();
|
||||||
|
extern int gpath_search ();
|
||||||
|
|
||||||
extern void construct_include_path ();
|
extern void construct_include_path ();
|
||||||
extern void uniquize_deps ();
|
extern void uniquize_deps ();
|
||||||
@@ -298,25 +371,31 @@ extern void uniquize_deps ();
|
|||||||
extern int update_goal_chain ();
|
extern int update_goal_chain ();
|
||||||
extern void notice_finished_file ();
|
extern void notice_finished_file ();
|
||||||
|
|
||||||
extern void user_access (), make_access (), child_access ();
|
extern void user_access ();
|
||||||
|
extern void make_access ();
|
||||||
|
extern void child_access ();
|
||||||
|
|
||||||
#ifdef HAVE_VFORK_H
|
#ifdef HAVE_VFORK_H
|
||||||
#include <vfork.h>
|
#include <vfork.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
|
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
|
||||||
because such systems often declare the in header files anyway. */
|
because such systems often declare them in header files anyway. */
|
||||||
|
|
||||||
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION)
|
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32)
|
||||||
|
|
||||||
extern long int atol ();
|
extern long int atol ();
|
||||||
|
#ifndef VMS
|
||||||
extern long int lseek ();
|
extern long int lseek ();
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* Not GNU C library or POSIX. */
|
#endif /* Not GNU C library or POSIX. */
|
||||||
|
|
||||||
#ifdef HAVE_GETCWD
|
#ifdef HAVE_GETCWD
|
||||||
extern char *getcwd ();
|
extern char *getcwd ();
|
||||||
|
#ifdef VMS
|
||||||
|
extern char *getwd PARAMS ((char *));
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
extern char *getwd ();
|
extern char *getwd ();
|
||||||
#define getcwd(buf, len) getwd (buf)
|
#define getcwd(buf, len) getwd (buf)
|
||||||
@@ -332,9 +411,14 @@ extern int debug_flag, print_data_base_flag, question_flag, touch_flag;
|
|||||||
extern int env_overrides, no_builtin_rules_flag, print_version_flag;
|
extern int env_overrides, no_builtin_rules_flag, print_version_flag;
|
||||||
extern int print_directory_flag, warn_undefined_variables_flag;
|
extern int print_directory_flag, warn_undefined_variables_flag;
|
||||||
extern int posix_pedantic;
|
extern int posix_pedantic;
|
||||||
|
extern int clock_skew_detected;
|
||||||
|
|
||||||
extern unsigned int job_slots;
|
extern unsigned int job_slots;
|
||||||
|
#ifndef NO_FLOAT
|
||||||
extern double max_load_average;
|
extern double max_load_average;
|
||||||
|
#else
|
||||||
|
extern int max_load_average;
|
||||||
|
#endif
|
||||||
|
|
||||||
extern char *program;
|
extern char *program;
|
||||||
extern char *starting_directory;
|
extern char *starting_directory;
|
||||||
@@ -349,3 +433,26 @@ extern int handling_fatal_signal;
|
|||||||
#define DEBUGPR(msg) \
|
#define DEBUGPR(msg) \
|
||||||
do if (debug_flag) { print_spaces (depth); printf (msg, file->name); \
|
do if (debug_flag) { print_spaces (depth); printf (msg, file->name); \
|
||||||
fflush (stdout); } while (0)
|
fflush (stdout); } while (0)
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
# ifndef EXIT_FAILURE
|
||||||
|
# define EXIT_FAILURE 3
|
||||||
|
# endif
|
||||||
|
# ifndef EXIT_SUCCESS
|
||||||
|
# define EXIT_SUCCESS 1
|
||||||
|
# endif
|
||||||
|
# ifndef EXIT_TROUBLE
|
||||||
|
# define EXIT_TROUBLE 2
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# ifndef EXIT_FAILURE
|
||||||
|
# define EXIT_FAILURE 2
|
||||||
|
# endif
|
||||||
|
# ifndef EXIT_SUCCESS
|
||||||
|
# define EXIT_SUCCESS 0
|
||||||
|
# endif
|
||||||
|
# ifndef EXIT_TROUBLE
|
||||||
|
# define EXIT_TROUBLE 1
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|||||||
5
make.lnk
Normal file
5
make.lnk
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
FROM LIB:cres.o "commands.o"+"job.o"+"dir.o"+"file.o"+"misc.o"+"main.o"+"read.o"+"remake.o"+"rule.o"+"implicit.o"+"default.o"+"variable.o"+"expand.o"+"function.o"+"vpath.o"+"version.o"+"ar.o"+"arscan.o"+"signame.o"+"remote-stub.o"+"getopt.o"+"getopt1.o"+"alloca.o"+"amiga.o"
|
||||||
|
TO "make.new"
|
||||||
|
LIB glob/glob.lib LIB:sc.lib LIB:amiga.lib
|
||||||
|
QUIET
|
||||||
|
|
||||||
518
make.texinfo
518
make.texinfo
@@ -8,11 +8,12 @@
|
|||||||
@c FSF publishers: format makebook.texi instead of using this file directly.
|
@c FSF publishers: format makebook.texi instead of using this file directly.
|
||||||
|
|
||||||
@set RCSID $Id$
|
@set RCSID $Id$
|
||||||
@set EDITION 0.47
|
@set EDITION 0.51
|
||||||
@set VERSION 3.72 Beta
|
@set VERSION 3.76 Beta
|
||||||
@set UPDATED 1 November 1994
|
@set UPDATED 26 Aug 1997
|
||||||
@set UPDATE-MONTH November 1994
|
@set UPDATE-MONTH Aug 1997
|
||||||
@set ISBN 1-882114-50-7
|
@comment The ISBN number might need to change on next publication.
|
||||||
|
@set ISBN 1-882114-78-7 @c CHANGE THIS BEFORE PRINTING AGAIN! --roland 9may96
|
||||||
|
|
||||||
@c finalout
|
@c finalout
|
||||||
|
|
||||||
@@ -24,6 +25,11 @@
|
|||||||
@syncodeindex pg cp
|
@syncodeindex pg cp
|
||||||
|
|
||||||
@ifinfo
|
@ifinfo
|
||||||
|
@dircategory The GNU make utility
|
||||||
|
@direntry
|
||||||
|
* GNU make: (make.info). The GNU make utility.
|
||||||
|
@end direntry
|
||||||
|
|
||||||
This file documents the GNU Make utility, which determines
|
This file documents the GNU Make utility, which determines
|
||||||
automatically which pieces of a large program need to be recompiled,
|
automatically which pieces of a large program need to be recompiled,
|
||||||
and issues the commands to recompile them.
|
and issues the commands to recompile them.
|
||||||
@@ -31,7 +37,8 @@ and issues the commands to recompile them.
|
|||||||
This is Edition @value{EDITION}, last updated @value{UPDATED},
|
This is Edition @value{EDITION}, last updated @value{UPDATED},
|
||||||
of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}.
|
of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}.
|
||||||
|
|
||||||
Copyright (C) 1988, '89, '90, '91, '92, '93, '94 Free Software Foundation, Inc.
|
Copyright (C) 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97
|
||||||
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
Permission is granted to make and distribute verbatim copies of
|
Permission is granted to make and distribute verbatim copies of
|
||||||
this manual provided the copyright notice and this permission notice
|
this manual provided the copyright notice and this permission notice
|
||||||
@@ -66,11 +73,11 @@ by the Free Software Foundation.
|
|||||||
@author Richard M. Stallman and Roland McGrath
|
@author Richard M. Stallman and Roland McGrath
|
||||||
@page
|
@page
|
||||||
@vskip 0pt plus 1filll
|
@vskip 0pt plus 1filll
|
||||||
Copyright @copyright{} 1988, '89, '90, '91, '92, '93, '94 Free Software Foundation, Inc.
|
Copyright @copyright{} 1988, '89, '90, '91, '92, '93, '94, '95, '96, '97 Free Software Foundation, Inc.
|
||||||
@sp 2
|
@sp 2
|
||||||
Published by the Free Software Foundation @*
|
Published by the Free Software Foundation @*
|
||||||
675 Massachusetts Avenue, @*
|
59 Temple Place -- Suite 330, @*
|
||||||
Cambridge, MA 02139 USA @*
|
Boston, MA 02111-1307 USA @*
|
||||||
Printed copies are available for $20 each. @*
|
Printed copies are available for $20 each. @*
|
||||||
ISBN @value{ISBN} @*
|
ISBN @value{ISBN} @*
|
||||||
|
|
||||||
@@ -93,7 +100,7 @@ Cover art by Etienne Suvasa.
|
|||||||
@page
|
@page
|
||||||
|
|
||||||
@ifinfo
|
@ifinfo
|
||||||
@node Top, Overview, (dir), (dir)
|
@node Top, Overview, , (dir)
|
||||||
@top Make
|
@top Make
|
||||||
|
|
||||||
The GNU @code{make} utility automatically determines which pieces of a
|
The GNU @code{make} utility automatically determines which pieces of a
|
||||||
@@ -194,6 +201,7 @@ Searching Directories for Dependencies
|
|||||||
to every dependency.
|
to every dependency.
|
||||||
* Selective Search:: Specifying a search path
|
* Selective Search:: Specifying a search path
|
||||||
for a specified class of names.
|
for a specified class of names.
|
||||||
|
* Search Algorithm:: When and how search paths are applied.
|
||||||
* Commands/Search:: How to write shell commands that work together
|
* Commands/Search:: How to write shell commands that work together
|
||||||
with search paths.
|
with search paths.
|
||||||
* Implicit/Search:: How search paths affect implicit rules.
|
* Implicit/Search:: How search paths affect implicit rules.
|
||||||
@@ -237,6 +245,8 @@ How to Use Variables
|
|||||||
* Defining:: An alternate way to set a variable
|
* Defining:: An alternate way to set a variable
|
||||||
to a verbatim string.
|
to a verbatim string.
|
||||||
* Environment:: Variable values can come from the environment.
|
* Environment:: Variable values can come from the environment.
|
||||||
|
* Automatic:: Some special variables have predefined
|
||||||
|
meanings for use with implicit rules.
|
||||||
|
|
||||||
Advanced Features for Reference to Variables
|
Advanced Features for Reference to Variables
|
||||||
|
|
||||||
@@ -254,7 +264,7 @@ Functions for Transforming Text
|
|||||||
|
|
||||||
* Syntax of Functions:: How to write a function call.
|
* Syntax of Functions:: How to write a function call.
|
||||||
* Text Functions:: General-purpose text manipulation functions.
|
* Text Functions:: General-purpose text manipulation functions.
|
||||||
* Filename Functions:: Functions for manipulating file names.
|
* File Name Functions:: Functions for manipulating file names.
|
||||||
* Foreach Function:: Repeat some text with controlled variation.
|
* Foreach Function:: Repeat some text with controlled variation.
|
||||||
* Origin Function:: Find where a variable got its value.
|
* Origin Function:: Find where a variable got its value.
|
||||||
* Shell Function:: Substitute the output of a shell command.
|
* Shell Function:: Substitute the output of a shell command.
|
||||||
@@ -286,7 +296,7 @@ Using Implicit Rules
|
|||||||
* Last Resort:: How to defining commands for rules
|
* Last Resort:: How to defining commands for rules
|
||||||
which cannot find any.
|
which cannot find any.
|
||||||
* Suffix Rules:: The old-fashioned style of implicit rule.
|
* Suffix Rules:: The old-fashioned style of implicit rule.
|
||||||
* Search Algorithm:: The precise algorithm for applying
|
* Implicit Rule Search:: The precise algorithm for applying
|
||||||
implicit rules.
|
implicit rules.
|
||||||
|
|
||||||
Defining and Redefining Pattern Rules
|
Defining and Redefining Pattern Rules
|
||||||
@@ -305,6 +315,7 @@ Using @code{make} to Update Archive Files
|
|||||||
|
|
||||||
* Archive Members:: Archive members as targets.
|
* Archive Members:: Archive members as targets.
|
||||||
* Archive Update:: The implicit rule for archive member targets.
|
* Archive Update:: The implicit rule for archive member targets.
|
||||||
|
* Archive Pitfalls:: Dangers to watch out for when using archives.
|
||||||
* Archive Suffix Rules:: You can write a special kind of suffix rule
|
* Archive Suffix Rules:: You can write a special kind of suffix rule
|
||||||
for updating archives.
|
for updating archives.
|
||||||
|
|
||||||
@@ -434,14 +445,6 @@ Be sure also to include the type of machine and operating system you are
|
|||||||
using. If possible, include the contents of the file @file{config.h}
|
using. If possible, include the contents of the file @file{config.h}
|
||||||
that is generated by the configuration process.
|
that is generated by the configuration process.
|
||||||
|
|
||||||
Non-bug suggestions are always welcome as well. If you have questions
|
|
||||||
about things that are unclear in the documentation or are just obscure
|
|
||||||
features, send a message to the bug reporting address. We cannot
|
|
||||||
guarantee you'll get help with your problem, but many seasoned
|
|
||||||
@code{make} users read the mailing list and they will probably try to
|
|
||||||
help you out. The maintainers sometimes answer such questions as well,
|
|
||||||
when time permits.
|
|
||||||
|
|
||||||
@node Introduction, Makefiles, Overview, Top
|
@node Introduction, Makefiles, Overview, Top
|
||||||
@comment node-name, next, previous, up
|
@comment node-name, next, previous, up
|
||||||
@chapter An Introduction to Makefiles
|
@chapter An Introduction to Makefiles
|
||||||
@@ -638,11 +641,10 @@ from @code{rm} or any other command.
|
|||||||
@cindex processing a makefile
|
@cindex processing a makefile
|
||||||
@cindex makefile, how @code{make} processes
|
@cindex makefile, how @code{make} processes
|
||||||
|
|
||||||
By default, @code{make} starts with the first rule (not counting rules
|
By default, @code{make} starts with the first target (not targets whose
|
||||||
whose target names start with @samp{.}). This is called the
|
names start with @samp{.}). This is called the @dfn{default goal}.
|
||||||
@dfn{default goal}. (@dfn{Goals} are the targets that @code{make}
|
(@dfn{Goals} are the targets that @code{make} strives ultimately to
|
||||||
strives ultimately to update. @xref{Goals, , Arguments to Specify the
|
update. @xref{Goals, , Arguments to Specify the Goals}.)
|
||||||
Goals}.)
|
|
||||||
@cindex default goal
|
@cindex default goal
|
||||||
@cindex goal, default
|
@cindex goal, default
|
||||||
@cindex goal
|
@cindex goal
|
||||||
@@ -1100,6 +1102,8 @@ makefile as has been traditionally done with other versions of
|
|||||||
|
|
||||||
@cindex @code{-I}
|
@cindex @code{-I}
|
||||||
@cindex @code{--include-dir}
|
@cindex @code{--include-dir}
|
||||||
|
@cindex included makefiles, default directries
|
||||||
|
@cindex default directries for included makefiles
|
||||||
@findex /usr/gnu/include
|
@findex /usr/gnu/include
|
||||||
@findex /usr/local/include
|
@findex /usr/local/include
|
||||||
@findex /usr/include
|
@findex /usr/include
|
||||||
@@ -1110,7 +1114,10 @@ First, any directories you have specified with the @samp{-I} or
|
|||||||
(@pxref{Options Summary, ,Summary of Options}).
|
(@pxref{Options Summary, ,Summary of Options}).
|
||||||
Then the following directories (if they exist)
|
Then the following directories (if they exist)
|
||||||
are searched, in this order:
|
are searched, in this order:
|
||||||
@file{@var{prefix}/include} (normally @file{/usr/local/include})
|
@file{@var{prefix}/include} (normally @file{/usr/local/include}
|
||||||
|
@footnote{GNU Make compiled for MS-DOS and MS-Windows behaves as if
|
||||||
|
@var{prefix} has been defined to be the root of the DJGPP tree
|
||||||
|
hierarchy.})
|
||||||
@file{/usr/gnu/include},
|
@file{/usr/gnu/include},
|
||||||
@file{/usr/local/include}, @file{/usr/include}.
|
@file{/usr/local/include}, @file{/usr/include}.
|
||||||
|
|
||||||
@@ -1133,6 +1140,8 @@ directive instead of @code{include}, like this:
|
|||||||
|
|
||||||
This is acts like @code{include} in every way except that there is no
|
This is acts like @code{include} in every way except that there is no
|
||||||
error (not even a warning) if any of the @var{filenames} do not exist.
|
error (not even a warning) if any of the @var{filenames} do not exist.
|
||||||
|
For compatibility with some other @code{make} implementations,
|
||||||
|
@code{sinclude} is another name for @w{@code{-include}}.
|
||||||
|
|
||||||
@node MAKEFILES Variable, Remaking Makefiles, Include, Makefiles
|
@node MAKEFILES Variable, Remaking Makefiles, Include, Makefiles
|
||||||
@section The Variable @code{MAKEFILES}
|
@section The Variable @code{MAKEFILES}
|
||||||
@@ -1460,7 +1469,10 @@ significance. If alone, or followed by a slash, it represents your home
|
|||||||
directory. For example @file{~/bin} expands to @file{/home/you/bin}.
|
directory. For example @file{~/bin} expands to @file{/home/you/bin}.
|
||||||
If the @samp{~} is followed by a word, the string represents the home
|
If the @samp{~} is followed by a word, the string represents the home
|
||||||
directory of the user named by that word. For example @file{~john/bin}
|
directory of the user named by that word. For example @file{~john/bin}
|
||||||
expands to @file{/home/john/bin}.@refill
|
expands to @file{/home/john/bin}. On systems which don't have a home
|
||||||
|
directory for each user (such as MS-DOS or MS-Windows), this
|
||||||
|
functionality can be simulated by setting the environment variable
|
||||||
|
@var{HOME}.@refill
|
||||||
|
|
||||||
Wildcard expansion happens automatically in targets, in dependencies,
|
Wildcard expansion happens automatically in targets, in dependencies,
|
||||||
and in commands (where the shell does the expansion). In other
|
and in commands (where the shell does the expansion). In other
|
||||||
@@ -1574,6 +1586,24 @@ expansion, but you need more sophisticated techniques, including the
|
|||||||
These are described in the following section.
|
These are described in the following section.
|
||||||
@end iftex
|
@end iftex
|
||||||
|
|
||||||
|
@cindex wildcards and MS-DOS/MS-Windows backslashes
|
||||||
|
@cindex backslashes in pathnames and wildcard expansion
|
||||||
|
|
||||||
|
Microsoft operating systems (MS-DOS and MS-Windows) use backslashes to
|
||||||
|
separate directories in pathnames, like so:
|
||||||
|
|
||||||
|
@example
|
||||||
|
c:\foo\bar\baz.c
|
||||||
|
@end example
|
||||||
|
|
||||||
|
This is equivalent to the Unix-style @file{c:/foo/bar/baz.c} (the
|
||||||
|
@file{c:} part is the so-called drive letter). When @code{make} runs on
|
||||||
|
these systems, it supports backslashes as well as the Unix-style forward
|
||||||
|
slashes in pathnames. However, this support does @emph{not} include the
|
||||||
|
wildcard expansion, where backslash is a quote character. Therefore,
|
||||||
|
you @emph{must} use Unix-style slashes in these cases.
|
||||||
|
|
||||||
|
|
||||||
@node Wildcard Function, , Wildcard Pitfall, Wildcards
|
@node Wildcard Function, , Wildcard Pitfall, Wildcards
|
||||||
@subsection The Function @code{wildcard}
|
@subsection The Function @code{wildcard}
|
||||||
@findex wildcard
|
@findex wildcard
|
||||||
@@ -1604,7 +1634,7 @@ $(wildcard *.c)
|
|||||||
@end example
|
@end example
|
||||||
|
|
||||||
We can change the list of C source files into a list of object files by
|
We can change the list of C source files into a list of object files by
|
||||||
replacing the @samp{.o} suffix with @samp{.c} in the result, like this:
|
replacing the @samp{.c} suffix with @samp{.o} in the result, like this:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
$(patsubst %.c,%.o,$(wildcard *.c))
|
$(patsubst %.c,%.o,$(wildcard *.c))
|
||||||
@@ -1650,6 +1680,7 @@ just the search paths.
|
|||||||
to every dependency.
|
to every dependency.
|
||||||
* Selective Search:: Specifying a search path
|
* Selective Search:: Specifying a search path
|
||||||
for a specified class of names.
|
for a specified class of names.
|
||||||
|
* Search Algorithm:: When and how search paths are applied.
|
||||||
* Commands/Search:: How to write shell commands that work together
|
* Commands/Search:: How to write shell commands that work together
|
||||||
with search paths.
|
with search paths.
|
||||||
* Implicit/Search:: How search paths affect implicit rules.
|
* Implicit/Search:: How search paths affect implicit rules.
|
||||||
@@ -1670,14 +1701,16 @@ rules.
|
|||||||
Thus, if a file that is listed as a target or dependency does not exist
|
Thus, if a file that is listed as a target or dependency does not exist
|
||||||
in the current directory, @code{make} searches the directories listed in
|
in the current directory, @code{make} searches the directories listed in
|
||||||
@code{VPATH} for a file with that name. If a file is found in one of
|
@code{VPATH} for a file with that name. If a file is found in one of
|
||||||
them, that file becomes the dependency. Rules may then specify the
|
them, that file may become the dependency (see below). Rules may then
|
||||||
names of source files in the dependencies as if they all existed in the
|
specify the names of files in the dependency list as if they all
|
||||||
current directory. @xref{Commands/Search, ,Writing Shell Commands with
|
existed in the current directory. @xref{Commands/Search, ,Writing Shell
|
||||||
Directory Search}.
|
Commands with Directory Search}.
|
||||||
|
|
||||||
In the @code{VPATH} variable, directory names are separated by colons or
|
In the @code{VPATH} variable, directory names are separated by colons or
|
||||||
blanks. The order in which directories are listed is the order followed
|
blanks. The order in which directories are listed is the order followed
|
||||||
by @code{make} in its search.
|
by @code{make} in its search. (On MS-DOS and MS-Windows, semi-colons
|
||||||
|
are used as separators of directory names in @code{VPATH}, since the
|
||||||
|
colon can be used in the pathname itself, after the drive letter.)
|
||||||
|
|
||||||
For example,
|
For example,
|
||||||
|
|
||||||
@@ -1706,15 +1739,16 @@ foo.o : src/foo.c
|
|||||||
assuming the file @file{foo.c} does not exist in the current directory but
|
assuming the file @file{foo.c} does not exist in the current directory but
|
||||||
is found in the directory @file{src}.
|
is found in the directory @file{src}.
|
||||||
|
|
||||||
@node Selective Search, Commands/Search, General Search, Directory Search
|
@node Selective Search, Search Algorithm, General Search, Directory Search
|
||||||
@subsection The @code{vpath} Directive
|
@subsection The @code{vpath} Directive
|
||||||
@findex vpath
|
@findex vpath
|
||||||
|
|
||||||
Similar to the @code{VPATH} variable but more selective is the @code{vpath}
|
Similar to the @code{VPATH} variable, but more selective, is the
|
||||||
directive (note lower case), which allows you to specify a search path for a particular class
|
@code{vpath} directive (note lower case), which allows you to specify a
|
||||||
of file names, those that match a particular pattern. Thus you can supply
|
search path for a particular class of file names: those that match a
|
||||||
certain search directories for one class of file names and other directories
|
particular pattern. Thus you can supply certain search directories for
|
||||||
(or none) for other file names.
|
one class of file names and other directories (or none) for other file
|
||||||
|
names.
|
||||||
|
|
||||||
There are three forms of the @code{vpath} directive:
|
There are three forms of the @code{vpath} directive:
|
||||||
|
|
||||||
@@ -1724,8 +1758,8 @@ Specify the search path @var{directories} for file names that match
|
|||||||
@var{pattern}.
|
@var{pattern}.
|
||||||
|
|
||||||
The search path, @var{directories}, is a list of directories to be
|
The search path, @var{directories}, is a list of directories to be
|
||||||
searched, separated by colons or blanks, just like the search path used
|
searched, separated by colons (semi-colons on MS-DOS and MS-Windows) or
|
||||||
in the @code{VPATH} variable.
|
blanks, just like the search path used in the @code{VPATH} variable.
|
||||||
|
|
||||||
@item vpath @var{pattern}
|
@item vpath @var{pattern}
|
||||||
Clear out the search path associated with @var{pattern}.
|
Clear out the search path associated with @var{pattern}.
|
||||||
@@ -1805,7 +1839,74 @@ vpath % blish
|
|||||||
will look for a file ending in @samp{.c} in @file{foo}, then
|
will look for a file ending in @samp{.c} in @file{foo}, then
|
||||||
@file{bar}, then @file{blish}.
|
@file{bar}, then @file{blish}.
|
||||||
|
|
||||||
@node Commands/Search, Implicit/Search, Selective Search, Directory Search
|
@node Search Algorithm, Commands/Search, Selective Search, Directory Search
|
||||||
|
@subsection How Directory Searches are Performed
|
||||||
|
@cindex algorithm for directory search
|
||||||
|
@cindex directory search algorithm
|
||||||
|
|
||||||
|
When a dependency is found through directory search, regardless of type
|
||||||
|
(general or selective), the pathname located may not be the one that
|
||||||
|
@code{make} actually provides you in the dependency list. Sometimes
|
||||||
|
the path discovered through directory search is thrown away.
|
||||||
|
|
||||||
|
The algorithm @code{make} uses to decide whether to keep or abandon a
|
||||||
|
path found via directory search is as follows:
|
||||||
|
|
||||||
|
@enumerate
|
||||||
|
@item
|
||||||
|
If a target file does not exist at the path specified in the makefile,
|
||||||
|
directory search is performed.
|
||||||
|
|
||||||
|
@item
|
||||||
|
If the directory search is successful, that path is kept and this file
|
||||||
|
is tentatively stored as the target.
|
||||||
|
|
||||||
|
@item
|
||||||
|
All dependencies of this target are examined using this same method.
|
||||||
|
|
||||||
|
@item
|
||||||
|
After processing the dependencies, the target may or may not need to be
|
||||||
|
rebuilt:
|
||||||
|
|
||||||
|
@enumerate a
|
||||||
|
@item
|
||||||
|
If the target does @emph{not} need to be rebuilt, the path to the file
|
||||||
|
found during directory search is used for any dependency lists which
|
||||||
|
contain this target. In short, if @code{make} doesn't need to rebuild
|
||||||
|
the target then you use the path found via directory search.
|
||||||
|
|
||||||
|
@item
|
||||||
|
If the target @emph{does} need to be rebuilt (is out-of-date), the
|
||||||
|
pathname found during directory search is @emph{thrown away}, and the
|
||||||
|
target is rebuilt using the file name specified in the makefile. In
|
||||||
|
short, if @code{make} must rebuild, then the target is rebuilt locally,
|
||||||
|
not in the directory found via directory search.
|
||||||
|
@end enumerate
|
||||||
|
@end enumerate
|
||||||
|
|
||||||
|
This algorithm may seem complex, but in practice it is quite often
|
||||||
|
exactly what you want.
|
||||||
|
|
||||||
|
@cindex traditional directory search
|
||||||
|
@cindex directory search, traditional
|
||||||
|
Other versions of @code{make} use a simpler algorithm: if the file does
|
||||||
|
not exist, and it is found via directory search, then that pathname is
|
||||||
|
always used whether or not the target needs to be built. Thus, if the
|
||||||
|
target is rebuilt it is created at the pathname discovered during
|
||||||
|
directory search.
|
||||||
|
|
||||||
|
@vindex GPATH
|
||||||
|
If, in fact, this is the behavior you want for some or all of your
|
||||||
|
directories, you can use the @code{GPATH} variable to indicate this to
|
||||||
|
@code{make}.
|
||||||
|
|
||||||
|
@code{GPATH} has the same syntax and format as @code{VPATH} (that is, a
|
||||||
|
space- or colon-delimited list of pathnames). If an out-of-date target
|
||||||
|
is found by directory search in a directory that also appears in
|
||||||
|
@code{GPATH}, then that pathname is not thrown away. The target is
|
||||||
|
rebuilt using the expanded path.
|
||||||
|
|
||||||
|
@node Commands/Search, Implicit/Search, Search Algorithm, Directory Search
|
||||||
@subsection Writing Shell Commands with Directory Search
|
@subsection Writing Shell Commands with Directory Search
|
||||||
@cindex shell command, and directory search
|
@cindex shell command, and directory search
|
||||||
@cindex directory search (@code{VPATH}), and shell commands
|
@cindex directory search (@code{VPATH}), and shell commands
|
||||||
@@ -1889,7 +1990,9 @@ handles it specially by searching for the file @file{lib@var{name}.a} in
|
|||||||
the current directory, in directories specified by matching @code{vpath}
|
the current directory, in directories specified by matching @code{vpath}
|
||||||
search paths and the @code{VPATH} search path, and then in the
|
search paths and the @code{VPATH} search path, and then in the
|
||||||
directories @file{/lib}, @file{/usr/lib}, and @file{@var{prefix}/lib}
|
directories @file{/lib}, @file{/usr/lib}, and @file{@var{prefix}/lib}
|
||||||
(normally @file{/usr/local/lib}).
|
(normally @file{/usr/local/lib}, but MS-DOS/MS-Windows versions of
|
||||||
|
@code{make} behave as if @var{prefix} is defined to be the root of the
|
||||||
|
DJGPP installation tree).
|
||||||
|
|
||||||
For example,
|
For example,
|
||||||
|
|
||||||
@@ -2117,7 +2220,7 @@ The commands specified for @code{.DEFAULT} are used for any target for
|
|||||||
which no rules are found (either explicit rules or implicit rules).
|
which no rules are found (either explicit rules or implicit rules).
|
||||||
@xref{Last Resort}. If @code{.DEFAULT} commands are specified, every
|
@xref{Last Resort}. If @code{.DEFAULT} commands are specified, every
|
||||||
file mentioned as a dependency, but not as a target in a rule, will have
|
file mentioned as a dependency, but not as a target in a rule, will have
|
||||||
these commands executed on its behalf. @xref{Search Algorithm,
|
these commands executed on its behalf. @xref{Implicit Rule Search,
|
||||||
,Implicit Rule Search Algorithm}.
|
,Implicit Rule Search Algorithm}.
|
||||||
|
|
||||||
@findex .PRECIOUS
|
@findex .PRECIOUS
|
||||||
@@ -2138,6 +2241,27 @@ You can also list the target pattern of an implicit rule (such as
|
|||||||
to preserve intermediate files created by rules whose target patterns
|
to preserve intermediate files created by rules whose target patterns
|
||||||
match that file's name.
|
match that file's name.
|
||||||
|
|
||||||
|
@findex .INTERMEDIATE
|
||||||
|
@item .INTERMEDIATE
|
||||||
|
@cindex intermediate targets, explicit
|
||||||
|
|
||||||
|
The targets which @code{.INTERMEDIATE} depends on are treated as
|
||||||
|
intermediate files. @xref{Chained Rules, ,Chains of Implicit Rules}.
|
||||||
|
@code{.INTERMEDIATE} with no dependencies marks all file targets
|
||||||
|
mentioned in the makefile as intermediate.
|
||||||
|
|
||||||
|
@findex .SECONDARY
|
||||||
|
@item .SECONDARY
|
||||||
|
@cindex secondary targets
|
||||||
|
@cindex preserving with @code{.SECONDARY}
|
||||||
|
|
||||||
|
The targets which @code{.SECONDARY} depends on are treated as
|
||||||
|
intermediate files, except that they are never automatically deleted.
|
||||||
|
@xref{Chained Rules, ,Chains of Implicit Rules}.
|
||||||
|
|
||||||
|
@code{.SECONDARY} with no dependencies marks all file targets mentioned
|
||||||
|
in the makefile as secondary.
|
||||||
|
|
||||||
@findex .IGNORE
|
@findex .IGNORE
|
||||||
@item .IGNORE
|
@item .IGNORE
|
||||||
|
|
||||||
@@ -2393,6 +2517,8 @@ from the corresponding @file{.c} file:
|
|||||||
@group
|
@group
|
||||||
objects = foo.o bar.o
|
objects = foo.o bar.o
|
||||||
|
|
||||||
|
all: $(objects)
|
||||||
|
|
||||||
$(objects): %.o: %.c
|
$(objects): %.o: %.c
|
||||||
$(CC) -c $(CFLAGS) $< -o $@@
|
$(CC) -c $(CFLAGS) $< -o $@@
|
||||||
@end group
|
@end group
|
||||||
@@ -2583,13 +2709,14 @@ the new dependencies.
|
|||||||
Here is the pattern rule to generate a file of dependencies (i.e., a makefile)
|
Here is the pattern rule to generate a file of dependencies (i.e., a makefile)
|
||||||
called @file{@var{name}.d} from a C source file called @file{@var{name}.c}:
|
called @file{@var{name}.d} from a C source file called @file{@var{name}.c}:
|
||||||
|
|
||||||
@example
|
@smallexample
|
||||||
@group
|
@group
|
||||||
%.d: %.c
|
%.d: %.c
|
||||||
$(SHELL) -ec '$(CC) -M $(CPPFLAGS) $< \
|
$(SHELL) -ec '$(CC) -M $(CPPFLAGS) $< \
|
||||||
| sed '\''s/$*\\.o[ :]*/& $@@/g'\'' > $@@'
|
| sed '\''s/\($*\)\.o[ :]*/\1.o $@@ : /g'\'' > $@@; \
|
||||||
|
[ -s $@@ ] || rm -f $@@'
|
||||||
@end group
|
@end group
|
||||||
@end example
|
@end smallexample
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
@xref{Pattern Rules}, for information on defining pattern rules. The
|
@xref{Pattern Rules}, for information on defining pattern rules. The
|
||||||
@@ -2741,13 +2868,15 @@ by making a new subshell for each line. (In practice, @code{make} may
|
|||||||
take shortcuts that do not affect the results.)
|
take shortcuts that do not affect the results.)
|
||||||
|
|
||||||
@cindex @code{cd} (shell command)
|
@cindex @code{cd} (shell command)
|
||||||
@strong{Please note:} this implies that shell commands such as
|
@strong{Please note:} this implies that shell commands such as @code{cd}
|
||||||
@code{cd} that set variables local to each process will not affect the
|
that set variables local to each process will not affect the following
|
||||||
following command lines. If you want to use @code{cd} to affect the
|
command lines. @footnote{On MS-DOS, the value of current working
|
||||||
next command, put the two on a single line with a semicolon between
|
directory is @strong{global}, so changing it @emph{will} affect the
|
||||||
them. Then @code{make} will consider them a single command and pass
|
following command lines on those systems.} If you want to use @code{cd}
|
||||||
them, together, to a shell which will execute them in sequence. For
|
to affect the next command, put the two on a single line with a
|
||||||
example:
|
semicolon between them. Then @code{make} will consider them a single
|
||||||
|
command and pass them, together, to a shell which will execute them in
|
||||||
|
sequence. For example:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
foo : bar/lose
|
foo : bar/lose
|
||||||
@@ -2778,13 +2907,75 @@ foo : bar/lose
|
|||||||
The program used as the shell is taken from the variable @code{SHELL}.
|
The program used as the shell is taken from the variable @code{SHELL}.
|
||||||
By default, the program @file{/bin/sh} is used.
|
By default, the program @file{/bin/sh} is used.
|
||||||
|
|
||||||
|
@vindex COMSPEC
|
||||||
|
On MS-DOS, if @code{SHELL} is not set, the value of the variable
|
||||||
|
@code{COMSPEC} (which is always set) is used instead.
|
||||||
|
|
||||||
|
@cindex @code{SHELL}, MS-DOS specifics
|
||||||
|
The processing of lines that set the variable @code{SHELL} in Makefiles
|
||||||
|
is different on MS-DOS. The stock shell, @file{command.com}, is
|
||||||
|
ridiculously limited in its functionality and many users of @code{make}
|
||||||
|
tend to install a replacement shell. Therefore, on MS-DOS, @code{make}
|
||||||
|
examines the value of @code{SHELL}, and changes its behavior based on
|
||||||
|
whether it points to a Unix-style or DOS-style shell. This allows
|
||||||
|
reasonable functionality even if @code{SHELL} points to
|
||||||
|
@file{command.com}.
|
||||||
|
|
||||||
|
If @code{SHELL} points to a Unix-style shell, @code{make} on MS-DOS
|
||||||
|
additionally checks whether that shell can indeed be found; if not, it
|
||||||
|
ignores the line that sets @code{SHELL}. In MS-DOS, GNU @code{make}
|
||||||
|
searches for the shell in the following places:
|
||||||
|
|
||||||
|
@enumerate
|
||||||
|
@item
|
||||||
|
In the precise place pointed to by the value of @code{SHELL}. For
|
||||||
|
example, if the makefile specifies @samp{SHELL = /bin/sh}, @code{make}
|
||||||
|
will look in the directory @file{/bin} on the current drive.
|
||||||
|
|
||||||
|
@item
|
||||||
|
In the current directory.
|
||||||
|
|
||||||
|
@item
|
||||||
|
In each of the directories in the @code{PATH} variable, in order.
|
||||||
|
|
||||||
|
@end enumerate
|
||||||
|
|
||||||
|
In every directory it examines, @code{make} will first look for the
|
||||||
|
specific file (@file{sh} in the example above). If this is not found,
|
||||||
|
it will also look in that directory for that file with one of the known
|
||||||
|
extensions which identify executable files. For example @file{.exe},
|
||||||
|
@file{.com}, @file{.bat}, @file{.btm}, @file{.sh}, and some others.
|
||||||
|
|
||||||
|
If any of these attempts is successful, the value of @code{SHELL} will
|
||||||
|
be set to the full pathname of the shell as found. However, if none of
|
||||||
|
these is found, the value of @code{SHELL} will not be changed, and thus
|
||||||
|
the line that sets it will be effectively ignored. This is so
|
||||||
|
@code{make} will only support features specific to a Unix-style shell if
|
||||||
|
such a shell is actually installed on the system where @code{make} runs.
|
||||||
|
|
||||||
|
Note that this extended search for the shell is limited to the cases
|
||||||
|
where @code{SHELL} is set from the Makefile; if it is set in the
|
||||||
|
environment or command line, you are expected to set it to the full
|
||||||
|
pathname of the shell, exactly as things are on Unix.
|
||||||
|
|
||||||
|
The effect of the above DOS-specific processing is that a Makefile that
|
||||||
|
says @samp{SHELL = /bin/sh} (as many Unix makefiles do), will work
|
||||||
|
on MS-DOS unaltered if you have e.g. @file{sh.exe} installed in some
|
||||||
|
directory along your @code{PATH}.
|
||||||
|
|
||||||
@cindex environment, @code{SHELL} in
|
@cindex environment, @code{SHELL} in
|
||||||
Unlike most variables, the variable @code{SHELL} is never set from the
|
Unlike most variables, the variable @code{SHELL} is never set from the
|
||||||
environment. This is because the @code{SHELL} environment variable is
|
environment. This is because the @code{SHELL} environment variable is
|
||||||
used to specify your personal choice of shell program for interactive
|
used to specify your personal choice of shell program for interactive
|
||||||
use. It would be very bad for personal choices like this to affect
|
use. It would be very bad for personal choices like this to affect the
|
||||||
the functioning of makefiles. @xref{Environment, ,Variables from the
|
functioning of makefiles. @xref{Environment, ,Variables from the
|
||||||
Environment}.
|
Environment}. However, on MS-DOS and MS-Windows the value of
|
||||||
|
@code{SHELL} in the environment @strong{is} used, since on those systems
|
||||||
|
most users do not set this variable, and therefore it is most likely set
|
||||||
|
specifically to be used by @code{make}. On MS-DOS, if the setting of
|
||||||
|
@code{SHELL} is not suitable for @code{make}, you can set the variable
|
||||||
|
@code{MAKESHELL} to the shell that @code{make} should use; this will
|
||||||
|
override the value of @code{SHELL}.
|
||||||
|
|
||||||
@node Parallel, Errors, Execution, Commands
|
@node Parallel, Errors, Execution, Commands
|
||||||
@section Parallel Execution
|
@section Parallel Execution
|
||||||
@@ -2801,6 +2992,9 @@ for it to finish before executing the next. However, the @samp{-j} or
|
|||||||
@samp{--jobs} option tells @code{make} to execute many commands
|
@samp{--jobs} option tells @code{make} to execute many commands
|
||||||
simultaneously.@refill
|
simultaneously.@refill
|
||||||
|
|
||||||
|
On MS-DOS, the @samp{-j} option has no effect, since that system doesn't
|
||||||
|
support multi-processing.
|
||||||
|
|
||||||
If the @samp{-j} option is followed by an integer, this is the number of
|
If the @samp{-j} option is followed by an integer, this is the number of
|
||||||
commands to execute at once; this is called the number of @dfn{job slots}.
|
commands to execute at once; this is called the number of @dfn{job slots}.
|
||||||
If there is nothing looking like an integer after the @samp{-j} option,
|
If there is nothing looking like an integer after the @samp{-j} option,
|
||||||
@@ -3017,7 +3211,7 @@ subdirectory. You can do it by writing this:
|
|||||||
|
|
||||||
@example
|
@example
|
||||||
subsystem:
|
subsystem:
|
||||||
cd subdir; $(MAKE)
|
cd subdir && $(MAKE)
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
@@ -3053,13 +3247,13 @@ not the explicit command name @samp{make}, as shown here:
|
|||||||
@example
|
@example
|
||||||
@group
|
@group
|
||||||
subsystem:
|
subsystem:
|
||||||
cd subdir; $(MAKE)
|
cd subdir && $(MAKE)
|
||||||
@end group
|
@end group
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
The value of this variable is the file name with which @code{make} was
|
The value of this variable is the file name with which @code{make} was
|
||||||
invoked. If this file name was @file{/bin/make}, then the command executed
|
invoked. If this file name was @file{/bin/make}, then the command executed
|
||||||
is @samp{cd subdir; /bin/make}. If you use a special version of
|
is @samp{cd subdir && /bin/make}. If you use a special version of
|
||||||
@code{make} to run the top-level makefile, the same special version will be
|
@code{make} to run the top-level makefile, the same special version will be
|
||||||
executed for recursive invocations.
|
executed for recursive invocations.
|
||||||
@cindex @code{cd} (shell command)
|
@cindex @code{cd} (shell command)
|
||||||
@@ -3076,7 +3270,7 @@ Consider the command @samp{make -t} in the above example. (The
|
|||||||
any commands; see @ref{Instead of Execution}.) Following the usual
|
any commands; see @ref{Instead of Execution}.) Following the usual
|
||||||
definition of @samp{-t}, a @samp{make -t} command in the example would
|
definition of @samp{-t}, a @samp{make -t} command in the example would
|
||||||
create a file named @file{subsystem} and do nothing else. What you
|
create a file named @file{subsystem} and do nothing else. What you
|
||||||
really want it to do is run @samp{@w{cd subdir;} @w{make -t}}; but that would
|
really want it to do is run @samp{@w{cd subdir &&} @w{make -t}}; but that would
|
||||||
require executing the command, and @samp{-t} says not to execute
|
require executing the command, and @samp{-t} says not to execute
|
||||||
commands.@refill
|
commands.@refill
|
||||||
@cindex @code{-t}, and recursion
|
@cindex @code{-t}, and recursion
|
||||||
@@ -3294,23 +3488,20 @@ definitions just as if they appeared on the command line.
|
|||||||
|
|
||||||
@cindex @code{-C}, and recursion
|
@cindex @code{-C}, and recursion
|
||||||
@cindex @code{-f}, and recursion
|
@cindex @code{-f}, and recursion
|
||||||
@cindex @code{-I}, and recursion
|
|
||||||
@cindex @code{-o}, and recursion
|
@cindex @code{-o}, and recursion
|
||||||
@cindex @code{-W}, and recursion
|
@cindex @code{-W}, and recursion
|
||||||
@cindex @code{--directory}, and recursion
|
@cindex @code{--directory}, and recursion
|
||||||
@cindex @code{--file}, and recursion
|
@cindex @code{--file}, and recursion
|
||||||
@cindex @code{--include-dir}, and recursion
|
|
||||||
@cindex @code{--old-file}, and recursion
|
@cindex @code{--old-file}, and recursion
|
||||||
@cindex @code{--assume-old}, and recursion
|
@cindex @code{--assume-old}, and recursion
|
||||||
@cindex @code{--assume-new}, and recursion
|
@cindex @code{--assume-new}, and recursion
|
||||||
@cindex @code{--new-file}, and recursion
|
@cindex @code{--new-file}, and recursion
|
||||||
@cindex recursion, and @code{-C}
|
@cindex recursion, and @code{-C}
|
||||||
@cindex recursion, and @code{-f}
|
@cindex recursion, and @code{-f}
|
||||||
@cindex recursion, and @code{-I}
|
|
||||||
@cindex recursion, and @code{-o}
|
@cindex recursion, and @code{-o}
|
||||||
@cindex recursion, and @code{-W}
|
@cindex recursion, and @code{-W}
|
||||||
The options @samp{-C}, @samp{-f}, @samp{-I}, @samp{-o}, and @samp{-W}
|
The options @samp{-C}, @samp{-f}, @samp{-o}, and @samp{-W} are not put
|
||||||
are not put into @code{MAKEFLAGS}; these options are not passed down.@refill
|
into @code{MAKEFLAGS}; these options are not passed down.@refill
|
||||||
|
|
||||||
@cindex @code{-j}, and recursion
|
@cindex @code{-j}, and recursion
|
||||||
@cindex @code{--jobs}, and recursion
|
@cindex @code{--jobs}, and recursion
|
||||||
@@ -3329,16 +3520,8 @@ If you do not want to pass the other flags down, you must change the
|
|||||||
value of @code{MAKEFLAGS}, like this:
|
value of @code{MAKEFLAGS}, like this:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
MAKEFLAGS=
|
|
||||||
subsystem:
|
subsystem:
|
||||||
cd subdir; $(MAKE)
|
cd subdir && $(MAKE) MAKEFLAGS=
|
||||||
@end example
|
|
||||||
|
|
||||||
or like this:
|
|
||||||
|
|
||||||
@example
|
|
||||||
subsystem:
|
|
||||||
cd subdir; $(MAKE) MAKEFLAGS=
|
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@vindex MAKEOVERRIDES
|
@vindex MAKEOVERRIDES
|
||||||
@@ -3377,7 +3560,7 @@ this:
|
|||||||
|
|
||||||
@example
|
@example
|
||||||
subsystem:
|
subsystem:
|
||||||
cd subdir; $(MAKE) $(MFLAGS)
|
cd subdir && $(MAKE) $(MFLAGS)
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
@@ -3574,6 +3757,14 @@ from getting implicit commands (from implicit rules or the
|
|||||||
@code{.DEFAULT} special target; @pxref{Implicit Rules} and
|
@code{.DEFAULT} special target; @pxref{Implicit Rules} and
|
||||||
@pxref{Last Resort, ,Defining Last-Resort Default Rules}).@refill
|
@pxref{Last Resort, ,Defining Last-Resort Default Rules}).@refill
|
||||||
|
|
||||||
|
@c !!! another reason is for canonical stamp files:
|
||||||
|
@ignore
|
||||||
|
foo: stamp-foo ;
|
||||||
|
stamp-foo: foo.in
|
||||||
|
create foo frm foo.in
|
||||||
|
touch $@
|
||||||
|
@end ignore
|
||||||
|
|
||||||
You may be inclined to define empty command strings for targets that are
|
You may be inclined to define empty command strings for targets that are
|
||||||
not actual files, but only exist so that their dependencies can be
|
not actual files, but only exist so that their dependencies can be
|
||||||
remade. However, this is not the best way to do that, because the
|
remade. However, this is not the best way to do that, because the
|
||||||
@@ -4495,7 +4686,9 @@ Such problems would be especially likely with the variable @code{SHELL},
|
|||||||
which is normally present in the environment to specify the user's choice
|
which is normally present in the environment to specify the user's choice
|
||||||
of interactive shell. It would be very undesirable for this choice to
|
of interactive shell. It would be very undesirable for this choice to
|
||||||
affect @code{make}. So @code{make} ignores the environment value of
|
affect @code{make}. So @code{make} ignores the environment value of
|
||||||
@code{SHELL}.@refill
|
@code{SHELL} (except on MS-DOS and MS-Windows, where @code{SHELL} is
|
||||||
|
usually not set. @xref{Execution, ,Special handling of SHELL on
|
||||||
|
MS-DOS}.)@refill
|
||||||
|
|
||||||
@node Conditionals, Functions, Using Variables, Top
|
@node Conditionals, Functions, Using Variables, Top
|
||||||
@chapter Conditional Parts of Makefiles
|
@chapter Conditional Parts of Makefiles
|
||||||
@@ -4792,7 +4985,7 @@ call, just as a variable might be substituted.
|
|||||||
@menu
|
@menu
|
||||||
* Syntax of Functions:: How to write a function call.
|
* Syntax of Functions:: How to write a function call.
|
||||||
* Text Functions:: General-purpose text manipulation functions.
|
* Text Functions:: General-purpose text manipulation functions.
|
||||||
* Filename Functions:: Functions for manipulating file names.
|
* File Name Functions:: Functions for manipulating file names.
|
||||||
* Foreach Function:: Repeat some text with controlled variation.
|
* Foreach Function:: Repeat some text with controlled variation.
|
||||||
* Origin Function:: Find where a variable got its value.
|
* Origin Function:: Find where a variable got its value.
|
||||||
* Shell Function:: Substitute the output of a shell command.
|
* Shell Function:: Substitute the output of a shell command.
|
||||||
@@ -4861,7 +5054,7 @@ bar:= $(subst $(space),$(comma),$(foo))
|
|||||||
Here the @code{subst} function replaces each space with a comma, through
|
Here the @code{subst} function replaces each space with a comma, through
|
||||||
the value of @code{foo}, and substitutes the result.
|
the value of @code{foo}, and substitutes the result.
|
||||||
|
|
||||||
@node Text Functions, Filename Functions, Syntax of Functions, Functions
|
@node Text Functions, File Name Functions, Syntax of Functions, Functions
|
||||||
@section Functions for String Substitution and Analysis
|
@section Functions for String Substitution and Analysis
|
||||||
@cindex functions, for text
|
@cindex functions, for text
|
||||||
|
|
||||||
@@ -5125,7 +5318,7 @@ used so that the new value is assigned even if the previous value of
|
|||||||
@code{CFLAGS} was specified with a command argument (@pxref{Override
|
@code{CFLAGS} was specified with a command argument (@pxref{Override
|
||||||
Directive, , The @code{override} Directive}).
|
Directive, , The @code{override} Directive}).
|
||||||
|
|
||||||
@node Filename Functions, Foreach Function, Text Functions, Functions
|
@node File Name Functions, Foreach Function, Text Functions, Functions
|
||||||
@section Functions for File Names
|
@section Functions for File Names
|
||||||
@cindex functions, for file names
|
@cindex functions, for file names
|
||||||
@cindex file name functions
|
@cindex file name functions
|
||||||
@@ -5192,11 +5385,11 @@ file names.
|
|||||||
For example,
|
For example,
|
||||||
|
|
||||||
@example
|
@example
|
||||||
$(suffix src/foo.c hacks)
|
$(suffix src/foo.c src-1.0/bar.c hacks)
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
produces the result @samp{.c}.
|
produces the result @samp{.c .c}.
|
||||||
|
|
||||||
@item $(basename @var{names}@dots{})
|
@item $(basename @var{names}@dots{})
|
||||||
@findex basename
|
@findex basename
|
||||||
@@ -5204,15 +5397,16 @@ produces the result @samp{.c}.
|
|||||||
@cindex file name, basename of
|
@cindex file name, basename of
|
||||||
Extracts all but the suffix of each file name in @var{names}. If the
|
Extracts all but the suffix of each file name in @var{names}. If the
|
||||||
file name contains a period, the basename is everything starting up to
|
file name contains a period, the basename is everything starting up to
|
||||||
(and not including) the last period. Otherwise, the basename is the
|
(and not including) the last period. Periods in the directory part are
|
||||||
entire file name. For example,
|
ignored. If there is no period, the basename is the entire file name.
|
||||||
|
For example,
|
||||||
|
|
||||||
@example
|
@example
|
||||||
$(basename src/foo.c hacks)
|
$(basename src/foo.c src-1.0/bar hacks)
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
produces the result @samp{src/foo hacks}.
|
produces the result @samp{src/foo src-1.0/bar hacks}.
|
||||||
|
|
||||||
@c plural convention with dots (be consistent)
|
@c plural convention with dots (be consistent)
|
||||||
@item $(addsuffix @var{suffix},@var{names}@dots{})
|
@item $(addsuffix @var{suffix},@var{names}@dots{})
|
||||||
@@ -5271,8 +5465,8 @@ was given to those two functions.@refill
|
|||||||
|
|
||||||
@item $(word @var{n},@var{text})
|
@item $(word @var{n},@var{text})
|
||||||
@findex word
|
@findex word
|
||||||
@cindex words, selecting
|
@cindex word, selecting a
|
||||||
@cindex selecting words
|
@cindex selecting a word
|
||||||
Returns the @var{n}th word of @var{text}. The legitimate values of
|
Returns the @var{n}th word of @var{text}. The legitimate values of
|
||||||
@var{n} start from 1. If @var{n} is bigger than the number of words
|
@var{n} start from 1. If @var{n} is bigger than the number of words
|
||||||
in @var{text}, the value is empty. For example,
|
in @var{text}, the value is empty. For example,
|
||||||
@@ -5284,6 +5478,25 @@ $(word 2, foo bar baz)
|
|||||||
@noindent
|
@noindent
|
||||||
returns @samp{bar}.
|
returns @samp{bar}.
|
||||||
|
|
||||||
|
@item $(wordlist @var{s},@var{e},@var{text})
|
||||||
|
@findex wordlist
|
||||||
|
@cindex words, selecting lists of
|
||||||
|
@cindex selecting word lists
|
||||||
|
Returns the list of words in @var{text} starting with word @var{s} and
|
||||||
|
ending with word @var{e} (inclusive). The legitimate values of @var{s}
|
||||||
|
and @var{e} start from 1. If @var{s} is bigger than the number of words
|
||||||
|
in @var{text}, the value is empty. If @var{e} is bigger than the number
|
||||||
|
of words in @var{text}, words up to the end of @var{text} are returned.
|
||||||
|
If @var{s} is greater than @var{e}, @code{make} swaps them for you. For
|
||||||
|
example,
|
||||||
|
|
||||||
|
@example
|
||||||
|
$(wordlist 2, 3, foo bar baz)
|
||||||
|
@end example
|
||||||
|
|
||||||
|
@noindent
|
||||||
|
returns @samp{bar baz}.
|
||||||
|
|
||||||
@c Following item phrased to prevent overfull hbox. --RJC 17 Jul 92
|
@c Following item phrased to prevent overfull hbox. --RJC 17 Jul 92
|
||||||
@item $(words @var{text})
|
@item $(words @var{text})
|
||||||
@findex words
|
@findex words
|
||||||
@@ -5320,7 +5533,7 @@ that match the pattern.
|
|||||||
@xref{Wildcards, ,Using Wildcard Characters in File Names}.
|
@xref{Wildcards, ,Using Wildcard Characters in File Names}.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@node Foreach Function, Origin Function, Filename Functions, Functions
|
@node Foreach Function, Origin Function, File Name Functions, Functions
|
||||||
@section The @code{foreach} Function
|
@section The @code{foreach} Function
|
||||||
@findex foreach
|
@findex foreach
|
||||||
@cindex words, iterating over
|
@cindex words, iterating over
|
||||||
@@ -5400,12 +5613,12 @@ variable names because many strange things are valid variable names, but
|
|||||||
are probably not what you intended. For example,
|
are probably not what you intended. For example,
|
||||||
|
|
||||||
@smallexample
|
@smallexample
|
||||||
files := $(foreach Es escrito en espanol!,b c ch,$(find_files))
|
files := $(foreach Esta escrito en espanol!,b c ch,$(find_files))
|
||||||
@end smallexample
|
@end smallexample
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
might be useful if the value of @code{find_files} references the variable
|
might be useful if the value of @code{find_files} references the variable
|
||||||
whose name is @samp{Es escrito en espanol!} (es un nombre bastante largo,
|
whose name is @samp{Esta escrito en espanol!} (es un nombre bastante largo,
|
||||||
no?), but it is more likely to be a mistake.
|
no?), but it is more likely to be a mistake.
|
||||||
|
|
||||||
@node Origin Function, Shell Function, Foreach Function, Functions
|
@node Origin Function, Shell Function, Foreach Function, Functions
|
||||||
@@ -5533,8 +5746,10 @@ The @code{shell} function performs the same function that backquotes
|
|||||||
(@samp{`}) perform in most shells: it does @dfn{command expansion}. This
|
(@samp{`}) perform in most shells: it does @dfn{command expansion}. This
|
||||||
means that it takes an argument that is a shell command and returns the
|
means that it takes an argument that is a shell command and returns the
|
||||||
output of the command. The only processing @code{make} does on the result,
|
output of the command. The only processing @code{make} does on the result,
|
||||||
before substituting it into the surrounding text, is to convert newlines to
|
before substituting it into the surrounding text, is to convert each
|
||||||
spaces.@refill
|
newline or carriage-return / newline pair to a single space. It also
|
||||||
|
removes the trailing (carriage-return and) newline, if it's the last
|
||||||
|
thing in the result.@refill
|
||||||
|
|
||||||
The commands run by calls to the @code{shell} function are run when the
|
The commands run by calls to the @code{shell} function are run when the
|
||||||
function calls are expanded. In most cases, this is when the makefile is
|
function calls are expanded. In most cases, this is when the makefile is
|
||||||
@@ -5649,6 +5864,28 @@ parsed as a switch or variable definition, respectively). Even
|
|||||||
targets not in the makefile may be specified, if @code{make} can find
|
targets not in the makefile may be specified, if @code{make} can find
|
||||||
implicit rules that say how to make them.
|
implicit rules that say how to make them.
|
||||||
|
|
||||||
|
@cindex @code{MAKECMDGOALS}
|
||||||
|
@vindex MAKECMDGOALS
|
||||||
|
@code{Make} will set the special variable @code{MAKECMDGOALS} to the
|
||||||
|
list of goals you specified on the command line. If no goals were given
|
||||||
|
on the command line, this variable is empty. Note that this variable
|
||||||
|
should be used only in special circumstances.
|
||||||
|
|
||||||
|
An example of appropriate use is to avoid including @file{.d} files
|
||||||
|
during @code{clean} rules (@pxref{Automatic Dependencies}), so
|
||||||
|
@code{make} won't create them only to immediately remove them
|
||||||
|
again:@refill
|
||||||
|
|
||||||
|
@example
|
||||||
|
@group
|
||||||
|
sources = foo.c bar.c
|
||||||
|
|
||||||
|
ifneq ($(MAKECMDGOALS),clean)
|
||||||
|
include $(sources:.c=.d)
|
||||||
|
endif
|
||||||
|
@end group
|
||||||
|
@end example
|
||||||
|
|
||||||
One use of specifying a goal is if you want to compile only a part of
|
One use of specifying a goal is if you want to compile only a part of
|
||||||
the program, or only one of several programs. Specify as a goal each
|
the program, or only one of several programs. Specify as a goal each
|
||||||
file that you wish to remake. For example, consider a directory containing
|
file that you wish to remake. For example, consider a directory containing
|
||||||
@@ -6082,6 +6319,7 @@ argument, @code{make} runs as many jobs simultaneously as possible. If
|
|||||||
there is more than one @samp{-j} option, the last one is effective.
|
there is more than one @samp{-j} option, the last one is effective.
|
||||||
@xref{Parallel, ,Parallel Execution},
|
@xref{Parallel, ,Parallel Execution},
|
||||||
for more information on how commands are run.
|
for more information on how commands are run.
|
||||||
|
Note that this option is ignored on MS-DOS.
|
||||||
|
|
||||||
@item -k
|
@item -k
|
||||||
@cindex @code{-k}
|
@cindex @code{-k}
|
||||||
@@ -6299,7 +6537,7 @@ retained for compatibility.
|
|||||||
* Last Resort:: How to defining commands for rules
|
* Last Resort:: How to defining commands for rules
|
||||||
which cannot find any.
|
which cannot find any.
|
||||||
* Suffix Rules:: The old-fashioned style of implicit rule.
|
* Suffix Rules:: The old-fashioned style of implicit rule.
|
||||||
* Search Algorithm:: The precise algorithm for applying
|
* Implicit Rule Search:: The precise algorithm for applying
|
||||||
implicit rules.
|
implicit rules.
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
@@ -6357,7 +6595,7 @@ result of another implicit rule, we say that @dfn{chaining} is occurring.
|
|||||||
In general, @code{make} searches for an implicit rule for each target, and
|
In general, @code{make} searches for an implicit rule for each target, and
|
||||||
for each double-colon rule, that has no commands. A file that is mentioned
|
for each double-colon rule, that has no commands. A file that is mentioned
|
||||||
only as a dependency is considered a target whose rule specifies nothing,
|
only as a dependency is considered a target whose rule specifies nothing,
|
||||||
so implicit rule search happens for it. @xref{Search Algorithm, ,Implicit Rule Search Algorithm}, for the
|
so implicit rule search happens for it. @xref{Implicit Rule Search, ,Implicit Rule Search Algorithm}, for the
|
||||||
details of how the search is done.
|
details of how the search is done.
|
||||||
|
|
||||||
Note that explicit dependencies do not influence implicit rule search.
|
Note that explicit dependencies do not influence implicit rule search.
|
||||||
@@ -6907,17 +7145,44 @@ mentioned in the makefile, along with the implicit rule that says how to
|
|||||||
create it.@refill
|
create it.@refill
|
||||||
|
|
||||||
Intermediate files are remade using their rules just like all other
|
Intermediate files are remade using their rules just like all other
|
||||||
files. The difference is that the intermediate file is deleted when
|
files. But intermediate files are treated differently in two ways.
|
||||||
@code{make} is finished. Therefore, the intermediate file which did not
|
|
||||||
exist before @code{make} also does not exist after @code{make}. The
|
The first difference is what happens if the intermediate file does not
|
||||||
deletion is reported to you by printing a @samp{rm -f} command that
|
exist. If an ordinary file @var{b} does not exist, and @code{make}
|
||||||
shows what @code{make} is doing. (You can list the target pattern of an
|
considers a target that depends on @var{b}, it invariably creates
|
||||||
implicit rule (such as @samp{%.o}) as a dependency of the special
|
@var{b} and then updates the target from @var{b}. But if @var{b} is an
|
||||||
target @code{.PRECIOUS} to preserve intermediate files made by implicit
|
intermediate file, then @code{make} can leave well enough alone. It
|
||||||
rules whose target patterns match that file's name;
|
won't bother updating @var{b}, or the ultimate target, unless some
|
||||||
see @ref{Interrupts}.)@refill
|
dependency of @var{b} is newer than that target or there is some other
|
||||||
|
reason to update that target.
|
||||||
|
|
||||||
|
The second difference is that if @code{make} @emph{does} create @var{b}
|
||||||
|
in order to update something else, it deletes @var{b} later on after it
|
||||||
|
is no longer needed. Therefore, an intermediate file which did not
|
||||||
|
exist before @code{make} also does not exist after @code{make}.
|
||||||
|
@code{make} reports the deletion to you by printing a @samp{rm -f}
|
||||||
|
command showing which file it is deleting.
|
||||||
|
|
||||||
|
Ordinarily, a file cannot be intermediate if it is mentioned in the
|
||||||
|
makefile as a target or dependency. However, you can explicitly mark a
|
||||||
|
file as intermediate by listing it as a dependency of the special target
|
||||||
|
@code{.INTERMEDIATE}. This takes effect even if the file is mentioned
|
||||||
|
explicitly in some other way.
|
||||||
|
|
||||||
@cindex intermediate files, preserving
|
@cindex intermediate files, preserving
|
||||||
@cindex preserving intermediate files
|
@cindex preserving intermediate files
|
||||||
|
@cindex secondary files
|
||||||
|
You can prevent automatic deletion of an intermediate file by marking it
|
||||||
|
as a @dfn{secondary} file. To do this, list it as a dependency of the
|
||||||
|
special target @code{.SECONDARY}. When a file is secondary, @code{make}
|
||||||
|
will not create the file merely because it does not already exist, but
|
||||||
|
@code{make} does not automatically delete the file. Marking a file as
|
||||||
|
secondary also marks it as intermediate.
|
||||||
|
|
||||||
|
You can list the target pattern of an implicit rule (such as @samp{%.o})
|
||||||
|
as a dependency of the special target @code{.PRECIOUS} to preserve
|
||||||
|
intermediate files made by implicit rules whose target patterns match
|
||||||
|
that file's name; see @ref{Interrupts}.@refill
|
||||||
@cindex preserving with @code{.PRECIOUS}
|
@cindex preserving with @code{.PRECIOUS}
|
||||||
@cindex @code{.PRECIOUS} intermediate files
|
@cindex @code{.PRECIOUS} intermediate files
|
||||||
|
|
||||||
@@ -7213,7 +7478,7 @@ variants that get just the file's directory name or just the file name
|
|||||||
within the directory. The variant variables' names are formed by
|
within the directory. The variant variables' names are formed by
|
||||||
appending @samp{D} or @samp{F}, respectively. These variants are
|
appending @samp{D} or @samp{F}, respectively. These variants are
|
||||||
semi-obsolete in GNU @code{make} since the functions @code{dir} and
|
semi-obsolete in GNU @code{make} since the functions @code{dir} and
|
||||||
@code{notdir} can be used to get a similar effect (@pxref{Filename
|
@code{notdir} can be used to get a similar effect (@pxref{File Name
|
||||||
Functions, , Functions for File Names}). Note, however, that the
|
Functions, , Functions for File Names}). Note, however, that the
|
||||||
@samp{F} variants all omit the trailing slash which always appears in
|
@samp{F} variants all omit the trailing slash which always appears in
|
||||||
the output of the @code{dir} function. Here is a table of the variants:
|
the output of the @code{dir} function. Here is a table of the variants:
|
||||||
@@ -7468,7 +7733,7 @@ Commands, ,Defining Empty Commands}).@refill
|
|||||||
You can use a last-resort rule to override part of another makefile.
|
You can use a last-resort rule to override part of another makefile.
|
||||||
@xref{Overriding Makefiles, , Overriding Part of Another Makefile}.
|
@xref{Overriding Makefiles, , Overriding Part of Another Makefile}.
|
||||||
|
|
||||||
@node Suffix Rules, Search Algorithm, Last Resort, Implicit Rules
|
@node Suffix Rules, Implicit Rule Search, Last Resort, Implicit Rules
|
||||||
@section Old-Fashioned Suffix Rules
|
@section Old-Fashioned Suffix Rules
|
||||||
@cindex old-fashioned suffix rules
|
@cindex old-fashioned suffix rules
|
||||||
@cindex suffix rule
|
@cindex suffix rule
|
||||||
@@ -7570,7 +7835,7 @@ before @code{make} reads any makefiles. You can change the list of suffixes
|
|||||||
with a rule for the special target @code{.SUFFIXES}, but that does not alter
|
with a rule for the special target @code{.SUFFIXES}, but that does not alter
|
||||||
this variable.
|
this variable.
|
||||||
|
|
||||||
@node Search Algorithm, , Suffix Rules, Implicit Rules
|
@node Implicit Rule Search, , Suffix Rules, Implicit Rules
|
||||||
@section Implicit Rule Search Algorithm
|
@section Implicit Rule Search Algorithm
|
||||||
@cindex implicit rule, search algorithm
|
@cindex implicit rule, search algorithm
|
||||||
@cindex search algorithm, implicit rule
|
@cindex search algorithm, implicit rule
|
||||||
@@ -8036,7 +8301,8 @@ multiple members in a single archive file comes from SunOS 4 @code{make}.
|
|||||||
The @code{-include} directive to include makefiles with no error for a
|
The @code{-include} directive to include makefiles with no error for a
|
||||||
nonexistent file comes from SunOS 4 @code{make}. (But note that SunOS 4
|
nonexistent file comes from SunOS 4 @code{make}. (But note that SunOS 4
|
||||||
@code{make} does not allow multiple makefiles to be specified in one
|
@code{make} does not allow multiple makefiles to be specified in one
|
||||||
@code{-include} directive.)
|
@code{-include} directive.) The same feature appears with the name
|
||||||
|
@code{sinclude} in SGI @code{make} and perhaps others.
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
The remaining features are inventions new in GNU @code{make}:
|
The remaining features are inventions new in GNU @code{make}:
|
||||||
@@ -8118,6 +8384,10 @@ characters. In other versions of @code{make}, they must begin with
|
|||||||
Keep track of the current level of @code{make} recursion using the
|
Keep track of the current level of @code{make} recursion using the
|
||||||
variable @code{MAKELEVEL}. @xref{Recursion, ,Recursive Use of @code{make}}.
|
variable @code{MAKELEVEL}. @xref{Recursion, ,Recursive Use of @code{make}}.
|
||||||
|
|
||||||
|
@item
|
||||||
|
Provide any goals given on the command line in the variable
|
||||||
|
@code{MAKECMDGOALS}. @xref{Goals, ,Arguments to Specify the Goals}.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
Specify static pattern rules. @xref{Static Pattern, ,Static Pattern Rules}.
|
Specify static pattern rules. @xref{Static Pattern, ,Static Pattern Rules}.
|
||||||
|
|
||||||
@@ -8382,43 +8652,43 @@ Sort the words in @var{list} lexicographically, removing duplicates.@*
|
|||||||
|
|
||||||
@item $(dir @var{names}@dots{})
|
@item $(dir @var{names}@dots{})
|
||||||
Extract the directory part of each file name.@*
|
Extract the directory part of each file name.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(notdir @var{names}@dots{})
|
@item $(notdir @var{names}@dots{})
|
||||||
Extract the non-directory part of each file name.@*
|
Extract the non-directory part of each file name.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(suffix @var{names}@dots{})
|
@item $(suffix @var{names}@dots{})
|
||||||
Extract the suffix (the last @samp{.} and following characters) of each file name.@*
|
Extract the suffix (the last @samp{.} and following characters) of each file name.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(basename @var{names}@dots{})
|
@item $(basename @var{names}@dots{})
|
||||||
Extract the base name (name without suffix) of each file name.@*
|
Extract the base name (name without suffix) of each file name.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(addsuffix @var{suffix},@var{names}@dots{})
|
@item $(addsuffix @var{suffix},@var{names}@dots{})
|
||||||
Append @var{suffix} to each word in @var{names}.@*
|
Append @var{suffix} to each word in @var{names}.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(addprefix @var{prefix},@var{names}@dots{})
|
@item $(addprefix @var{prefix},@var{names}@dots{})
|
||||||
Prepend @var{prefix} to each word in @var{names}.@*
|
Prepend @var{prefix} to each word in @var{names}.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(join @var{list1},@var{list2})
|
@item $(join @var{list1},@var{list2})
|
||||||
Join two parallel lists of words.@*
|
Join two parallel lists of words.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(word @var{n},@var{text})
|
@item $(word @var{n},@var{text})
|
||||||
Extract the @var{n}th word (one-origin) of @var{text}.@*
|
Extract the @var{n}th word (one-origin) of @var{text}.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(words @var{text})
|
@item $(words @var{text})
|
||||||
Count the number of words in @var{text}.@*
|
Count the number of words in @var{text}.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(firstword @var{names}@dots{})
|
@item $(firstword @var{names}@dots{})
|
||||||
Extract the first word of @var{names}.@*
|
Extract the first word of @var{names}.@*
|
||||||
@xref{Filename Functions, ,Functions for File Names}.
|
@xref{File Name Functions, ,Functions for File Names}.
|
||||||
|
|
||||||
@item $(wildcard @var{pattern}@dots{})
|
@item $(wildcard @var{pattern}@dots{})
|
||||||
Find file names matching a shell file name pattern (@emph{not} a
|
Find file names matching a shell file name pattern (@emph{not} a
|
||||||
@@ -8522,6 +8792,12 @@ The name of the system default command interpreter, usually @file{/bin/sh}.
|
|||||||
You can set @code{SHELL} in the makefile to change the shell used to run
|
You can set @code{SHELL} in the makefile to change the shell used to run
|
||||||
commands. @xref{Execution, ,Command Execution}.
|
commands. @xref{Execution, ,Command Execution}.
|
||||||
|
|
||||||
|
@item MAKESHELL
|
||||||
|
|
||||||
|
On MS-DOS only, the name of the command interpreter that is to be used
|
||||||
|
by @code{make}. This value takes precedence over the value of
|
||||||
|
@code{SHELL}. @xref{Execution, ,MAKESHELL variable}.
|
||||||
|
|
||||||
@item MAKE
|
@item MAKE
|
||||||
|
|
||||||
The name with which @code{make} was invoked.
|
The name with which @code{make} was invoked.
|
||||||
@@ -8539,6 +8815,12 @@ The flags given to @code{make}. You can set this in the environment or
|
|||||||
a makefile to set flags.@*
|
a makefile to set flags.@*
|
||||||
@xref{Options/Recursion, ,Communicating Options to a Sub-@code{make}}.
|
@xref{Options/Recursion, ,Communicating Options to a Sub-@code{make}}.
|
||||||
|
|
||||||
|
@item MAKECMDGOALS
|
||||||
|
|
||||||
|
The targets given to @code{make} on the command line. Setting this
|
||||||
|
variable has no effect on the operation of @code{make}.@*
|
||||||
|
@xref{Goals, ,Arguments to Specify the Goals}.
|
||||||
|
|
||||||
@item SUFFIXES
|
@item SUFFIXES
|
||||||
|
|
||||||
The default list of suffixes before @code{make} reads any makefiles.
|
The default list of suffixes before @code{make} reads any makefiles.
|
||||||
|
|||||||
34
makefile.com
Normal file
34
makefile.com
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
$!
|
||||||
|
$! Makefile.com - builds GNU Make for VMS
|
||||||
|
$!
|
||||||
|
$! P1 is non-empty if you want to link with the VAXCRTL library instead
|
||||||
|
$! of the shareable executable
|
||||||
|
$!
|
||||||
|
$ def/nolog sys sys$library:
|
||||||
|
$ filelist = "alloca ar arscan commands default dir expand file function implicit job main misc read remake remote-stub rule signame variable version vmsfunctions vmsify vpath [.glob]glob [.glob]fnmatch getopt getopt1"
|
||||||
|
$ copy config.h-vms config.h
|
||||||
|
$ n=0
|
||||||
|
$ loop:
|
||||||
|
$ cfile = f$elem(n," ",filelist)
|
||||||
|
$ if cfile .eqs. " " then goto linkit
|
||||||
|
$ write sys$output "Compiling ''cfile'..."
|
||||||
|
$ call compileit 'cfile' 'p1'
|
||||||
|
$ n = n + 1
|
||||||
|
$ goto loop
|
||||||
|
$ linkit:
|
||||||
|
$ if p1 .nes. "" then goto link_using_library
|
||||||
|
$ link/exe=make alloca,ar,arscan,commands,default,dir,expand,file,function,-
|
||||||
|
implicit,job,main,misc,read,remake,remote-stub,rule,-
|
||||||
|
signame,variable,version,vmsfunctions,vmsify,vpath,-
|
||||||
|
glob,fnmatch,getopt,getopt1
|
||||||
|
$ exit
|
||||||
|
$ link_using_library:
|
||||||
|
$ link/exe=make alloca,ar,arscan,commands,default,dir,expand,file,function,-
|
||||||
|
implicit,job,main,misc,read,remake,remote-stub,rule,-
|
||||||
|
signame,variable,version,vmsfunctions,vmsify,vpath,-
|
||||||
|
glob,fnmatch,getopt,getopt1,sys$library:vaxcrtl/lib
|
||||||
|
$!
|
||||||
|
$ compileit : subroutine
|
||||||
|
$ cc/include=([],[.glob])/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS") 'p1'
|
||||||
|
$ exit
|
||||||
|
$ endsubroutine : compileit
|
||||||
121
makefile.vms
Normal file
121
makefile.vms
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
# Copyright (C) 1988, 1989, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
# This file is part of GNU Make.
|
||||||
|
#
|
||||||
|
# VMS extensions from GNU Make 3.60 imported by
|
||||||
|
# Klaus Kämpf (kkaempf@progis.de) of proGIS Software, Aachen, Germany
|
||||||
|
#
|
||||||
|
# GNU Make 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 2, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# GNU Make 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 GNU Make; see the file COPYING. If not, write to
|
||||||
|
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
|
CC = cc/warn
|
||||||
|
CP = copy
|
||||||
|
|
||||||
|
%.obj: %.c
|
||||||
|
$(CC) $(CFLAGS)/obj=$@ $<
|
||||||
|
#
|
||||||
|
# Makefile for GNU Make
|
||||||
|
#
|
||||||
|
|
||||||
|
CFLAGS = $(defines) /debug/noopt/include=([],[.glob])
|
||||||
|
#LDFLAGS = /deb
|
||||||
|
LDFLAGS =
|
||||||
|
|
||||||
|
defines = /define=("unlink=remove","HAVE_CONFIG_H","VMS","allocated_variable_expand_for_file=alloc_var_expand_for_file")
|
||||||
|
|
||||||
|
LOAD_AVG = /define="NO_LDAV"
|
||||||
|
|
||||||
|
# If you don't want archive support, comment these out.
|
||||||
|
ARCHIVES = ,ar.obj,arscan.obj
|
||||||
|
ARCHIVES_SRC = ar.c arscan.c
|
||||||
|
|
||||||
|
# If your system needs extra libraries loaded in, define them here.
|
||||||
|
# System V probably need -lPW for alloca.
|
||||||
|
# if on vax, uncomment the following line
|
||||||
|
#LOADLIBES = ,c.opt/opt
|
||||||
|
LOADLIBES =,sys$$library:vaxcrtl.olb/lib
|
||||||
|
|
||||||
|
# If your system doesn't have alloca, or the one provided is bad,
|
||||||
|
# get it from the Emacs distribution and define these.
|
||||||
|
ALLOCA = ,alloca.obj
|
||||||
|
ALLOCASRC = alloca.c
|
||||||
|
|
||||||
|
# If there are remote execution facilities defined,
|
||||||
|
# enable them with switches here (see remote-*.c).
|
||||||
|
REMOTE =
|
||||||
|
|
||||||
|
# Any extra object files your system needs.
|
||||||
|
extras = ,signame.obj,remote-stub.obj,vmsfunctions.obj,vmsify.obj
|
||||||
|
#,directory.obj
|
||||||
|
# as an alternative:
|
||||||
|
glob = ,[.glob]glob.obj,[.glob]fnmatch.obj
|
||||||
|
getopt = ,getopt.obj,getopt1.obj
|
||||||
|
# Directory to install `make' in.
|
||||||
|
bindir = []
|
||||||
|
# Directory to install the man page in.
|
||||||
|
mandir = []
|
||||||
|
# Number to put on the man page filename.
|
||||||
|
manext = 1
|
||||||
|
|
||||||
|
objs = commands.obj,job.obj,dir.obj,file.obj,misc.obj,\
|
||||||
|
main.obj,read.obj,remake.obj,rule.obj,implicit.obj,\
|
||||||
|
default.obj,variable.obj,expand.obj,function.obj,\
|
||||||
|
vpath.obj,version.obj$(ARCHIVES)$(ALLOCA)$(extras)$(getopt)$(glob)
|
||||||
|
srcs = commands.c job.c dir.c file.c misc.c \
|
||||||
|
main.c read.c remake.c rule.c implicit.c \
|
||||||
|
default.c variable.c expand.c function.c \
|
||||||
|
vpath.c version.c vmsfunctions.c vmsify.c $(ARCHIVES_SRC) $(ALLOCASRC) \
|
||||||
|
commands.h dep.h filedef.h job.h make.h rule.h variable.h
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: all doc
|
||||||
|
all: config.h make.exe
|
||||||
|
|
||||||
|
doc: make.info make.dvi
|
||||||
|
|
||||||
|
|
||||||
|
make.exe: $(objs)
|
||||||
|
$(LD)$(LDFLAGS)/exe=$@ $^$(LOADLIBES)
|
||||||
|
|
||||||
|
.PHONY: clean realclean
|
||||||
|
clean:
|
||||||
|
-$(RM) make.exe;,*.obj;*
|
||||||
|
|
||||||
|
# Automatically generated dependencies.
|
||||||
|
commands.obj: commands.c make.h dep.h commands.h filedef.h variable.h job.h
|
||||||
|
job.obj: job.c make.h commands.h job.h filedef.h variable.h
|
||||||
|
dir.obj: dir.c make.h
|
||||||
|
file.obj: file.c make.h commands.h dep.h filedef.h variable.h
|
||||||
|
misc.obj: misc.c make.h dep.h
|
||||||
|
main.obj: main.c make.h commands.h dep.h filedef.h variable.h job.h
|
||||||
|
read.obj: read.c make.h commands.h dep.h filedef.h variable.h
|
||||||
|
remake.obj: remake.c make.h commands.h job.h dep.h filedef.h
|
||||||
|
rule.obj: rule.c make.h commands.h dep.h filedef.h variable.h rule.h
|
||||||
|
implicit.obj: implicit.c make.h rule.h dep.h filedef.h
|
||||||
|
default.obj: default.c make.h rule.h dep.h filedef.h commands.h variable.h
|
||||||
|
variable.obj: variable.c make.h commands.h variable.h dep.h filedef.h
|
||||||
|
expand.obj: expand.c make.h commands.h filedef.h variable.h
|
||||||
|
function.obj: function.c make.h variable.h dep.h commands.h job.h
|
||||||
|
vpath.obj: vpath.c make.h filedef.h variable.h
|
||||||
|
version.obj: version.c
|
||||||
|
arscan.obj: arscan.c
|
||||||
|
ar.obj: ar.c make.h filedef.h
|
||||||
|
signame.obj: signame.c
|
||||||
|
remote-stub.obj: remote-stub.c
|
||||||
|
[.glob]glob.obj: [.glob]glob.c
|
||||||
|
[.glob]fnmatch.obj: [.glob]fnmatch.c
|
||||||
|
getopt.obj: getopt.c
|
||||||
|
getopt1.obj: getopt1.c
|
||||||
|
|
||||||
|
config.h: config.h-vms
|
||||||
|
$(CP) $< $@
|
||||||
98
misc.c
98
misc.c
@@ -1,5 +1,5 @@
|
|||||||
/* Miscellaneous generic support functions for GNU Make.
|
/* Miscellaneous generic support functions for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,95,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -50,9 +50,8 @@ collapse_continuations (line)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
out = in;
|
out = in;
|
||||||
if (out > line)
|
while (out > line && out[-1] == '\\')
|
||||||
while (out[-1] == '\\')
|
--out;
|
||||||
--out;
|
|
||||||
|
|
||||||
while (*in != '\0')
|
while (*in != '\0')
|
||||||
{
|
{
|
||||||
@@ -126,7 +125,7 @@ remove_comments (line)
|
|||||||
{
|
{
|
||||||
char *comment;
|
char *comment;
|
||||||
|
|
||||||
comment = find_char_unquote (line, '#', 0);
|
comment = find_char_unquote (line, "#", 0);
|
||||||
|
|
||||||
if (comment != 0)
|
if (comment != 0)
|
||||||
/* Cut off the line at the #. */
|
/* Cut off the line at the #. */
|
||||||
@@ -174,15 +173,25 @@ concat (s1, s2, s3)
|
|||||||
/* Print a message on stdout. */
|
/* Print a message on stdout. */
|
||||||
|
|
||||||
void
|
void
|
||||||
message (s1, s2, s3, s4, s5, s6)
|
message (prefix, s1, s2, s3, s4, s5, s6)
|
||||||
|
int prefix;
|
||||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||||
{
|
{
|
||||||
if (makelevel == 0)
|
log_working_directory (1);
|
||||||
printf ("%s: ", program);
|
|
||||||
else
|
if (s1 != 0)
|
||||||
printf ("%s[%u]: ", program, makelevel);
|
{
|
||||||
printf (s1, s2, s3, s4, s5, s6);
|
if (prefix)
|
||||||
putchar ('\n');
|
{
|
||||||
|
if (makelevel == 0)
|
||||||
|
printf ("%s: ", program);
|
||||||
|
else
|
||||||
|
printf ("%s[%u]: ", program, makelevel);
|
||||||
|
}
|
||||||
|
printf (s1, s2, s3, s4, s5, s6);
|
||||||
|
putchar ('\n');
|
||||||
|
}
|
||||||
|
|
||||||
fflush (stdout);
|
fflush (stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,6 +202,8 @@ void
|
|||||||
fatal (s1, s2, s3, s4, s5, s6)
|
fatal (s1, s2, s3, s4, s5, s6)
|
||||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||||
{
|
{
|
||||||
|
log_working_directory (1);
|
||||||
|
|
||||||
if (makelevel == 0)
|
if (makelevel == 0)
|
||||||
fprintf (stderr, "%s: *** ", program);
|
fprintf (stderr, "%s: *** ", program);
|
||||||
else
|
else
|
||||||
@@ -211,6 +222,8 @@ void
|
|||||||
error (s1, s2, s3, s4, s5, s6)
|
error (s1, s2, s3, s4, s5, s6)
|
||||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||||
{
|
{
|
||||||
|
log_working_directory (1);
|
||||||
|
|
||||||
if (makelevel == 0)
|
if (makelevel == 0)
|
||||||
fprintf (stderr, "%s: ", program);
|
fprintf (stderr, "%s: ", program);
|
||||||
else
|
else
|
||||||
@@ -226,6 +239,8 @@ makefile_error (file, lineno, s1, s2, s3, s4, s5, s6)
|
|||||||
unsigned int lineno;
|
unsigned int lineno;
|
||||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||||
{
|
{
|
||||||
|
log_working_directory (1);
|
||||||
|
|
||||||
fprintf (stderr, "%s:%u: ", file, lineno);
|
fprintf (stderr, "%s:%u: ", file, lineno);
|
||||||
fprintf (stderr, s1, s2, s3, s4, s5, s6);
|
fprintf (stderr, s1, s2, s3, s4, s5, s6);
|
||||||
putc ('\n', stderr);
|
putc ('\n', stderr);
|
||||||
@@ -238,6 +253,8 @@ makefile_fatal (file, lineno, s1, s2, s3, s4, s5, s6)
|
|||||||
unsigned int lineno;
|
unsigned int lineno;
|
||||||
char *s1, *s2, *s3, *s4, *s5, *s6;
|
char *s1, *s2, *s3, *s4, *s5, *s6;
|
||||||
{
|
{
|
||||||
|
log_working_directory (1);
|
||||||
|
|
||||||
fprintf (stderr, "%s:%u: *** ", file, lineno);
|
fprintf (stderr, "%s:%u: *** ", file, lineno);
|
||||||
fprintf (stderr, s1, s2, s3, s4, s5, s6);
|
fprintf (stderr, s1, s2, s3, s4, s5, s6);
|
||||||
fputs (". Stop.\n", stderr);
|
fputs (". Stop.\n", stderr);
|
||||||
@@ -254,13 +271,15 @@ strerror (errnum)
|
|||||||
int errnum;
|
int errnum;
|
||||||
{
|
{
|
||||||
extern int errno, sys_nerr;
|
extern int errno, sys_nerr;
|
||||||
|
#ifndef __DECC
|
||||||
extern char *sys_errlist[];
|
extern char *sys_errlist[];
|
||||||
|
#endif
|
||||||
static char buf[] = "Unknown error 12345678901234567890";
|
static char buf[] = "Unknown error 12345678901234567890";
|
||||||
|
|
||||||
if (errno < sys_nerr)
|
if (errno < sys_nerr)
|
||||||
return sys_errlist[errnum];
|
return sys_errlist[errnum];
|
||||||
|
|
||||||
sprintf ("Unknown error %d", buf, errnum);
|
sprintf (buf, "Unknown error %d", errnum);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -378,6 +397,37 @@ end_of_token (s)
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
/*
|
||||||
|
* Same as end_of_token, but take into account a stop character
|
||||||
|
*/
|
||||||
|
char *
|
||||||
|
end_of_token_w32 (s, stopchar)
|
||||||
|
char *s;
|
||||||
|
char stopchar;
|
||||||
|
{
|
||||||
|
register char *p = s;
|
||||||
|
register int backslash = 0;
|
||||||
|
|
||||||
|
while (*p != '\0' && *p != stopchar && (backslash || !isblank (*p)))
|
||||||
|
{
|
||||||
|
if (*p++ == '\\')
|
||||||
|
{
|
||||||
|
backslash = !backslash;
|
||||||
|
while (*p == '\\')
|
||||||
|
{
|
||||||
|
backslash = !backslash;
|
||||||
|
++p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
backslash = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Return the address of the first nonwhitespace or null in the string S. */
|
/* Return the address of the first nonwhitespace or null in the string S. */
|
||||||
|
|
||||||
char *
|
char *
|
||||||
@@ -523,6 +573,7 @@ log_access (flavor)
|
|||||||
static void
|
static void
|
||||||
init_access ()
|
init_access ()
|
||||||
{
|
{
|
||||||
|
#ifndef VMS
|
||||||
user_uid = getuid ();
|
user_uid = getuid ();
|
||||||
user_gid = getgid ();
|
user_gid = getgid ();
|
||||||
|
|
||||||
@@ -536,6 +587,7 @@ init_access ()
|
|||||||
log_access ("Initialized");
|
log_access ("Initialized");
|
||||||
|
|
||||||
current_access = make;
|
current_access = make;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* GETLOADAVG_PRIVILEGED */
|
#endif /* GETLOADAVG_PRIVILEGED */
|
||||||
@@ -716,23 +768,3 @@ get_path_max ()
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* On some systems, stat can return EINTR. */
|
|
||||||
|
|
||||||
int
|
|
||||||
safe_stat (name, buf)
|
|
||||||
char *name;
|
|
||||||
struct stat *buf;
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
#ifdef EINTR
|
|
||||||
do
|
|
||||||
#endif
|
|
||||||
ret = stat (name, buf);
|
|
||||||
#ifdef EINTR
|
|
||||||
while (ret < 0 && errno == EINTR);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|||||||
407
read.c
407
read.c
@@ -1,5 +1,5 @@
|
|||||||
/* Reading and parsing of makefiles for GNU Make.
|
/* Reading and parsing of makefiles for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -17,9 +17,10 @@ along with GNU Make; see the file COPYING. If not, write to
|
|||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
#include "commands.h"
|
|
||||||
#include "dep.h"
|
#include "dep.h"
|
||||||
#include "file.h"
|
#include "filedef.h"
|
||||||
|
#include "job.h"
|
||||||
|
#include "commands.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
|
|
||||||
/* This is POSIX.2, but most systems using -DPOSIX probably don't have it. */
|
/* This is POSIX.2, but most systems using -DPOSIX probably don't have it. */
|
||||||
@@ -29,16 +30,15 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "glob/glob.h"
|
#include "glob/glob.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef WINDOWS32
|
||||||
|
#ifndef _AMIGA
|
||||||
|
#ifndef VMS
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
struct passwd *getpwnam ();
|
#else
|
||||||
|
struct passwd *getpwnam PARAMS ((char *name));
|
||||||
|
#endif
|
||||||
static int read_makefile ();
|
#endif
|
||||||
static unsigned int readline (), do_define ();
|
#endif /* !WINDOWS32 */
|
||||||
static int conditional_line ();
|
|
||||||
static void record_files ();
|
|
||||||
static char *find_semicolon ();
|
|
||||||
|
|
||||||
|
|
||||||
/* A `struct linebuffer' is a structure which holds a line of text.
|
/* A `struct linebuffer' is a structure which holds a line of text.
|
||||||
`readline' reads a line from a stream into a linebuffer
|
`readline' reads a line from a stream into a linebuffer
|
||||||
@@ -81,10 +81,19 @@ static struct conditionals *conditionals = &toplevel_conditionals;
|
|||||||
|
|
||||||
static char *default_include_directories[] =
|
static char *default_include_directories[] =
|
||||||
{
|
{
|
||||||
|
#if defined(WINDOWS32) && !defined(INCLUDEDIR)
|
||||||
|
/*
|
||||||
|
* This completly up to the user when they install MSVC or other packages.
|
||||||
|
* This is defined as a placeholder.
|
||||||
|
*/
|
||||||
|
#define INCLUDEDIR "."
|
||||||
|
#endif
|
||||||
INCLUDEDIR,
|
INCLUDEDIR,
|
||||||
|
#ifndef _AMIGA
|
||||||
"/usr/gnu/include",
|
"/usr/gnu/include",
|
||||||
"/usr/local/include",
|
"/usr/local/include",
|
||||||
"/usr/include",
|
"/usr/include",
|
||||||
|
#endif
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -105,6 +114,17 @@ unsigned int *reading_lineno_ptr;
|
|||||||
/* The chain of makefiles read by read_makefile. */
|
/* The chain of makefiles read by read_makefile. */
|
||||||
|
|
||||||
static struct dep *read_makefiles = 0;
|
static struct dep *read_makefiles = 0;
|
||||||
|
|
||||||
|
static int read_makefile PARAMS ((char *filename, int flags));
|
||||||
|
static unsigned int readline PARAMS ((struct linebuffer *linebuffer, FILE *stream,
|
||||||
|
char *filename, unsigned int lineno));
|
||||||
|
static unsigned int do_define PARAMS ((char *name, unsigned int namelen, enum variable_origin origin,
|
||||||
|
unsigned int lineno, FILE *infile, char *filename));
|
||||||
|
static int conditional_line PARAMS ((char *line, char *filename, unsigned int lineno));
|
||||||
|
static void record_files PARAMS ((struct nameseq *filenames, char *pattern, char *pattern_percent,
|
||||||
|
struct dep *deps, unsigned int commands_started, char *commands,
|
||||||
|
unsigned int commands_idx, int two_colon, char *filename,
|
||||||
|
unsigned int lineno, int set_default));
|
||||||
|
|
||||||
/* Read in all the makefiles and return the chain of their names. */
|
/* Read in all the makefiles and return the chain of their names. */
|
||||||
|
|
||||||
@@ -139,6 +159,7 @@ read_all_makefiles (makefiles)
|
|||||||
/* Set NAME to the start of next token and LENGTH to its length.
|
/* Set NAME to the start of next token and LENGTH to its length.
|
||||||
MAKEFILES is updated for finding remaining tokens. */
|
MAKEFILES is updated for finding remaining tokens. */
|
||||||
p = value;
|
p = value;
|
||||||
|
|
||||||
while ((name = find_next_token (&p, &length)) != 0)
|
while ((name = find_next_token (&p, &length)) != 0)
|
||||||
{
|
{
|
||||||
if (*p != '\0')
|
if (*p != '\0')
|
||||||
@@ -177,7 +198,16 @@ read_all_makefiles (makefiles)
|
|||||||
if (num_makefiles == 0)
|
if (num_makefiles == 0)
|
||||||
{
|
{
|
||||||
static char *default_makefiles[] =
|
static char *default_makefiles[] =
|
||||||
|
#ifdef VMS
|
||||||
|
/* all lower case since readdir() (the vms version) 'lowercasifies' */
|
||||||
|
{ "makefile.vms", "gnumakefile", "makefile", 0 };
|
||||||
|
#else
|
||||||
|
#ifdef _AMIGA
|
||||||
|
{ "GNUmakefile", "Makefile", "SMakefile", 0 };
|
||||||
|
#else /* !Amiga && !VMS */
|
||||||
{ "GNUmakefile", "makefile", "Makefile", 0 };
|
{ "GNUmakefile", "makefile", "Makefile", 0 };
|
||||||
|
#endif /* AMIGA */
|
||||||
|
#endif /* VMS */
|
||||||
register char **p = default_makefiles;
|
register char **p = default_makefiles;
|
||||||
while (*p != 0 && !file_exists_p (*p))
|
while (*p != 0 && !file_exists_p (*p))
|
||||||
++p;
|
++p;
|
||||||
@@ -192,6 +222,9 @@ read_all_makefiles (makefiles)
|
|||||||
/* No default makefile was found. Add the default makefiles to the
|
/* No default makefile was found. Add the default makefiles to the
|
||||||
`read_makefiles' chain so they will be updated if possible. */
|
`read_makefiles' chain so they will be updated if possible. */
|
||||||
struct dep *tail = read_makefiles;
|
struct dep *tail = read_makefiles;
|
||||||
|
/* Add them to the tail, after any MAKEFILES variable makefiles. */
|
||||||
|
while (tail != 0 && tail->next != 0)
|
||||||
|
tail = tail->next;
|
||||||
for (p = default_makefiles; *p != 0; ++p)
|
for (p = default_makefiles; *p != 0; ++p)
|
||||||
{
|
{
|
||||||
struct dep *d = (struct dep *) xmalloc (sizeof (struct dep));
|
struct dep *d = (struct dep *) xmalloc (sizeof (struct dep));
|
||||||
@@ -238,6 +271,7 @@ read_makefile (filename, flags)
|
|||||||
unsigned int commands_started;
|
unsigned int commands_started;
|
||||||
register char *p;
|
register char *p;
|
||||||
char *p2;
|
char *p2;
|
||||||
|
int len;
|
||||||
int ignoring = 0, in_ignored_define = 0;
|
int ignoring = 0, in_ignored_define = 0;
|
||||||
int no_targets = 0; /* Set when reading a rule without targets. */
|
int no_targets = 0; /* Set when reading a rule without targets. */
|
||||||
char *passed_filename = filename;
|
char *passed_filename = filename;
|
||||||
@@ -250,6 +284,9 @@ read_makefile (filename, flags)
|
|||||||
char *pattern = 0, *pattern_percent;
|
char *pattern = 0, *pattern_percent;
|
||||||
|
|
||||||
int makefile_errno;
|
int makefile_errno;
|
||||||
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|
int check_again;
|
||||||
|
#endif
|
||||||
|
|
||||||
#define record_waiting_files() \
|
#define record_waiting_files() \
|
||||||
do \
|
do \
|
||||||
@@ -267,6 +304,8 @@ read_makefile (filename, flags)
|
|||||||
#ifdef lint /* Suppress `used before set' messages. */
|
#ifdef lint /* Suppress `used before set' messages. */
|
||||||
two_colon = 0;
|
two_colon = 0;
|
||||||
#endif
|
#endif
|
||||||
|
pattern_percent = 0;
|
||||||
|
commands_started = lineno;
|
||||||
|
|
||||||
if (debug_flag)
|
if (debug_flag)
|
||||||
{
|
{
|
||||||
@@ -300,7 +339,6 @@ read_makefile (filename, flags)
|
|||||||
/* If the makefile wasn't found and it's either a makefile from
|
/* If the makefile wasn't found and it's either a makefile from
|
||||||
the `MAKEFILES' variable or an included makefile,
|
the `MAKEFILES' variable or an included makefile,
|
||||||
search the included makefile search path for this makefile. */
|
search the included makefile search path for this makefile. */
|
||||||
|
|
||||||
if (infile == 0 && (flags & RM_INCLUDED) && *filename != '/')
|
if (infile == 0 && (flags & RM_INCLUDED) && *filename != '/')
|
||||||
{
|
{
|
||||||
register unsigned int i;
|
register unsigned int i;
|
||||||
@@ -416,8 +454,7 @@ read_makefile (filename, flags)
|
|||||||
remove_comments (collapsed);
|
remove_comments (collapsed);
|
||||||
|
|
||||||
/* strncmp is first to avoid dereferencing out into space. */
|
/* strncmp is first to avoid dereferencing out into space. */
|
||||||
#define word1eq(s, l) (!strncmp (s, p, l) \
|
#define word1eq(s, l) (len == l && !strncmp (s, p, l))
|
||||||
&& (p[l] == '\0' || isblank (p[l])))
|
|
||||||
p = collapsed;
|
p = collapsed;
|
||||||
while (isspace (*p))
|
while (isspace (*p))
|
||||||
++p;
|
++p;
|
||||||
@@ -425,6 +462,21 @@ read_makefile (filename, flags)
|
|||||||
/* This line is completely empty. */
|
/* This line is completely empty. */
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* Find the end of the first token */
|
||||||
|
for (p2 = p+1; *p2 != '\0' && !isspace(*p2); ++p2)
|
||||||
|
{}
|
||||||
|
len = p2 - p;
|
||||||
|
|
||||||
|
/* Find the start of the second token. If it's a `:', jump past
|
||||||
|
preprocessor stuff since it can't be that--this allows targets named
|
||||||
|
`export', etc. */
|
||||||
|
while (isspace (*p2))
|
||||||
|
++p2;
|
||||||
|
if (*p2 == '\0')
|
||||||
|
p2 = NULL;
|
||||||
|
else if (p2[0] == ':' && p2[1] == '\0')
|
||||||
|
goto check_var;
|
||||||
|
|
||||||
/* We must first check for conditional and `define' directives before
|
/* We must first check for conditional and `define' directives before
|
||||||
ignoring anything, since they control what we will do with
|
ignoring anything, since they control what we will do with
|
||||||
following lines. */
|
following lines. */
|
||||||
@@ -542,15 +594,38 @@ read_makefile (filename, flags)
|
|||||||
v->export = v_noexport;
|
v->export = v_noexport;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (word1eq ("include", 7) || word1eq ("-include", 8))
|
else if (word1eq ("vpath", 5))
|
||||||
|
{
|
||||||
|
char *pattern;
|
||||||
|
unsigned int len;
|
||||||
|
p2 = variable_expand (p + 5);
|
||||||
|
p = find_next_token (&p2, &len);
|
||||||
|
if (p != 0)
|
||||||
|
{
|
||||||
|
pattern = savestring (p, len);
|
||||||
|
p = find_next_token (&p2, &len);
|
||||||
|
/* No searchpath means remove all previous
|
||||||
|
selective VPATH's with the same pattern. */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
/* No pattern means remove all previous selective VPATH's. */
|
||||||
|
pattern = 0;
|
||||||
|
construct_vpath_list (pattern, p);
|
||||||
|
if (pattern != 0)
|
||||||
|
free (pattern);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
check_var:
|
||||||
|
if (word1eq ("include", 7) || word1eq ("-include", 8)
|
||||||
|
|| word1eq ("sinclude", 8))
|
||||||
{
|
{
|
||||||
/* We have found an `include' line specifying a nested
|
/* We have found an `include' line specifying a nested
|
||||||
makefile to be read at this point. */
|
makefile to be read at this point. */
|
||||||
struct conditionals *save, new_conditionals;
|
struct conditionals *save, new_conditionals;
|
||||||
struct nameseq *files;
|
struct nameseq *files;
|
||||||
/* "-include" (vs "include") says no
|
/* "-include" (vs "include") says no error if the file does not
|
||||||
error if the file does not exist. */
|
exist. "sinclude" is an alias for this from SGI. */
|
||||||
int noerror = p[0] == '-';
|
int noerror = p[0] != 'i';
|
||||||
|
|
||||||
p = allocated_variable_expand (next_token (p + (noerror ? 9 : 8)));
|
p = allocated_variable_expand (next_token (p + (noerror ? 9 : 8)));
|
||||||
if (*p == '\0')
|
if (*p == '\0')
|
||||||
@@ -584,7 +659,7 @@ read_makefile (filename, flags)
|
|||||||
{
|
{
|
||||||
struct nameseq *next = files->next;
|
struct nameseq *next = files->next;
|
||||||
char *name = files->name;
|
char *name = files->name;
|
||||||
free (files);
|
free ((char *)files);
|
||||||
files = next;
|
files = next;
|
||||||
|
|
||||||
if (! read_makefile (name, (RM_INCLUDED | RM_NO_TILDE
|
if (! read_makefile (name, (RM_INCLUDED | RM_NO_TILDE
|
||||||
@@ -605,33 +680,13 @@ read_makefile (filename, flags)
|
|||||||
reading_filename = filename;
|
reading_filename = filename;
|
||||||
reading_lineno_ptr = &lineno;
|
reading_lineno_ptr = &lineno;
|
||||||
}
|
}
|
||||||
else if (word1eq ("vpath", 5))
|
|
||||||
{
|
|
||||||
char *pattern;
|
|
||||||
unsigned int len;
|
|
||||||
p2 = variable_expand (p + 5);
|
|
||||||
p = find_next_token (&p2, &len);
|
|
||||||
if (p != 0)
|
|
||||||
{
|
|
||||||
pattern = savestring (p, len);
|
|
||||||
p = find_next_token (&p2, &len);
|
|
||||||
/* No searchpath means remove all previous
|
|
||||||
selective VPATH's with the same pattern. */
|
|
||||||
}
|
|
||||||
else
|
|
||||||
/* No pattern means remove all previous selective VPATH's. */
|
|
||||||
pattern = 0;
|
|
||||||
construct_vpath_list (pattern, p);
|
|
||||||
if (pattern != 0)
|
|
||||||
free (pattern);
|
|
||||||
}
|
|
||||||
#undef word1eq
|
#undef word1eq
|
||||||
else if (try_variable_definition (filename, lineno, p, o_file))
|
else if (try_variable_definition (filename, lineno, p, o_file))
|
||||||
/* This line has been dealt with. */
|
/* This line has been dealt with. */
|
||||||
;
|
;
|
||||||
else if (lb.buffer[0] == '\t')
|
else if (lb.buffer[0] == '\t')
|
||||||
{
|
{
|
||||||
p = lb.buffer;
|
p = collapsed; /* Ignore comments. */
|
||||||
while (isblank (*p))
|
while (isblank (*p))
|
||||||
++p;
|
++p;
|
||||||
if (*p == '\0')
|
if (*p == '\0')
|
||||||
@@ -654,9 +709,16 @@ read_makefile (filename, flags)
|
|||||||
|
|
||||||
record_waiting_files ();
|
record_waiting_files ();
|
||||||
|
|
||||||
/* Look for a semicolon in the unexpanded line. */
|
/* Search the line for an unquoted ; that is not after an
|
||||||
cmdleft = find_semicolon (lb.buffer);
|
unquoted #. */
|
||||||
if (cmdleft != 0)
|
cmdleft = find_char_unquote (lb.buffer, ";#", 0);
|
||||||
|
if (cmdleft != 0 && *cmdleft == '#')
|
||||||
|
{
|
||||||
|
/* We found a comment before a semicolon. */
|
||||||
|
*cmdleft = '\0';
|
||||||
|
cmdleft = 0;
|
||||||
|
}
|
||||||
|
else if (cmdleft != 0)
|
||||||
/* Found one. Cut the line short there before expanding it. */
|
/* Found one. Cut the line short there before expanding it. */
|
||||||
*cmdleft = '\0';
|
*cmdleft = '\0';
|
||||||
|
|
||||||
@@ -668,15 +730,12 @@ read_makefile (filename, flags)
|
|||||||
|
|
||||||
if (cmdleft == 0)
|
if (cmdleft == 0)
|
||||||
/* Look for a semicolon in the expanded line. */
|
/* Look for a semicolon in the expanded line. */
|
||||||
cmdleft = find_semicolon (p);
|
cmdleft = find_char_unquote (p, ";", 0);
|
||||||
|
|
||||||
if (cmdleft != 0)
|
if (cmdleft != 0)
|
||||||
/* Cut the line short at the semicolon. */
|
/* Cut the line short at the semicolon. */
|
||||||
*cmdleft = '\0';
|
*cmdleft = '\0';
|
||||||
|
|
||||||
/* Remove comments from the line. */
|
|
||||||
remove_comments (p);
|
|
||||||
|
|
||||||
p2 = next_token (p);
|
p2 = next_token (p);
|
||||||
if (*p2 == '\0')
|
if (*p2 == '\0')
|
||||||
{
|
{
|
||||||
@@ -723,6 +782,32 @@ read_makefile (filename, flags)
|
|||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#ifdef _AMIGA
|
||||||
|
/* Here, the situation is quite complicated. Let's have a look
|
||||||
|
at a couple of targets:
|
||||||
|
|
||||||
|
install: dev:make
|
||||||
|
|
||||||
|
dev:make: make
|
||||||
|
|
||||||
|
dev:make:: xyz
|
||||||
|
|
||||||
|
The rule is that it's only a target, if there are TWO :'s
|
||||||
|
OR a space around the :.
|
||||||
|
*/
|
||||||
|
if (p && !(isspace(p[1]) || !p[1] || isspace(p[-1])))
|
||||||
|
p = 0;
|
||||||
|
#endif
|
||||||
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|
do {
|
||||||
|
check_again = 0;
|
||||||
|
/* For MSDOS and WINDOWS32, skip a "C:\..." or a "C:/..." */
|
||||||
|
if (p != 0 && (p[1] == '\\' || p[1] == '/') && isalpha (p[-1])) {
|
||||||
|
p = index(p + 1, ':');
|
||||||
|
check_again = 1;
|
||||||
|
}
|
||||||
|
} while (check_again);
|
||||||
|
#endif
|
||||||
if (p != 0)
|
if (p != 0)
|
||||||
{
|
{
|
||||||
struct nameseq *target;
|
struct nameseq *target;
|
||||||
@@ -822,13 +907,17 @@ do_define (name, namelen, origin, lineno, infile, filename)
|
|||||||
initbuffer (&lb);
|
initbuffer (&lb);
|
||||||
while (!feof (infile))
|
while (!feof (infile))
|
||||||
{
|
{
|
||||||
|
unsigned int len;
|
||||||
|
|
||||||
lineno += nlines;
|
lineno += nlines;
|
||||||
nlines = readline (&lb, infile, filename, lineno);
|
nlines = readline (&lb, infile, filename, lineno);
|
||||||
|
|
||||||
collapse_continuations (lb.buffer);
|
collapse_continuations (lb.buffer);
|
||||||
|
|
||||||
p = next_token (lb.buffer);
|
p = next_token (lb.buffer);
|
||||||
if ((p[5] == '\0' || isblank (p[5])) && !strncmp (p, "endef", 5))
|
len = strlen (p);
|
||||||
|
if ((len == 5 || (len > 5 && isblank (p[5])))
|
||||||
|
&& !strncmp (p, "endef", 5))
|
||||||
{
|
{
|
||||||
p += 5;
|
p += 5;
|
||||||
remove_comments (p);
|
remove_comments (p);
|
||||||
@@ -843,12 +932,11 @@ do_define (name, namelen, origin, lineno, infile, filename)
|
|||||||
(void) define_variable (var, strlen (var), definition, origin, 1);
|
(void) define_variable (var, strlen (var), definition, origin, 1);
|
||||||
free (definition);
|
free (definition);
|
||||||
freebuffer (&lb);
|
freebuffer (&lb);
|
||||||
return lineno;
|
return (lineno + nlines);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned int len = strlen (lb.buffer);
|
len = strlen (lb.buffer);
|
||||||
|
|
||||||
/* Increase the buffer size if necessary. */
|
/* Increase the buffer size if necessary. */
|
||||||
if (idx + len + 1 > length)
|
if (idx + len + 1 > length)
|
||||||
{
|
{
|
||||||
@@ -1019,7 +1107,16 @@ conditional_line (line, filename, lineno)
|
|||||||
if (*line == '\0')
|
if (*line == '\0')
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
*line++ = '\0';
|
if (termin == ',')
|
||||||
|
{
|
||||||
|
/* Strip blanks after the first string. */
|
||||||
|
char *p = line++;
|
||||||
|
while (isblank (p[-1]))
|
||||||
|
--p;
|
||||||
|
*p = '\0';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*line++ = '\0';
|
||||||
|
|
||||||
s2 = variable_expand (s1);
|
s2 = variable_expand (s1);
|
||||||
/* We must allocate a new copy of the expanded string because
|
/* We must allocate a new copy of the expanded string because
|
||||||
@@ -1292,7 +1389,7 @@ record_files (filenames, pattern, pattern_percent, deps, commands_started,
|
|||||||
{
|
{
|
||||||
struct dep *nextd = d->next;
|
struct dep *nextd = d->next;
|
||||||
free (d->name);
|
free (d->name);
|
||||||
free (d);
|
free ((char *)d);
|
||||||
d = nextd;
|
d = nextd;
|
||||||
}
|
}
|
||||||
f->deps = 0;
|
f->deps = 0;
|
||||||
@@ -1381,7 +1478,11 @@ record_files (filenames, pattern, pattern_percent, deps, commands_started,
|
|||||||
/* See if this is first target seen whose name does
|
/* See if this is first target seen whose name does
|
||||||
not start with a `.', unless it contains a slash. */
|
not start with a `.', unless it contains a slash. */
|
||||||
if (default_goal_file == 0 && set_default
|
if (default_goal_file == 0 && set_default
|
||||||
&& (*name != '.' || index (name, '/') != 0))
|
&& (*name != '.' || index (name, '/') != 0
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
|| index (name, '\\') != 0
|
||||||
|
#endif
|
||||||
|
))
|
||||||
{
|
{
|
||||||
int reject = 0;
|
int reject = 0;
|
||||||
|
|
||||||
@@ -1432,29 +1533,22 @@ record_files (filenames, pattern, pattern_percent, deps, commands_started,
|
|||||||
one, or nil if there are none. */
|
one, or nil if there are none. */
|
||||||
|
|
||||||
char *
|
char *
|
||||||
find_char_unquote (string, stopchar, blank)
|
find_char_unquote (string, stopchars, blank)
|
||||||
char *string;
|
char *string;
|
||||||
int stopchar;
|
char *stopchars;
|
||||||
int blank;
|
int blank;
|
||||||
{
|
{
|
||||||
unsigned int string_len = strlen (string);
|
unsigned int string_len = 0;
|
||||||
register char *p = string;
|
register char *p = string;
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
if (blank)
|
while (*p != '\0' && index (stopchars, *p) == 0
|
||||||
{
|
&& (!blank || !isblank (*p)))
|
||||||
while (*p != '\0' && *p != stopchar && !isblank (*p))
|
++p;
|
||||||
++p;
|
if (*p == '\0')
|
||||||
if (*p == '\0')
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
p = index (p, stopchar);
|
|
||||||
if (p == 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (p > string && p[-1] == '\\')
|
if (p > string && p[-1] == '\\')
|
||||||
{
|
{
|
||||||
/* Search for more backslashes. */
|
/* Search for more backslashes. */
|
||||||
@@ -1462,6 +1556,9 @@ find_char_unquote (string, stopchar, blank)
|
|||||||
while (&p[i] >= string && p[i] == '\\')
|
while (&p[i] >= string && p[i] == '\\')
|
||||||
--i;
|
--i;
|
||||||
++i;
|
++i;
|
||||||
|
/* Only compute the length if really needed. */
|
||||||
|
if (string_len == 0)
|
||||||
|
string_len = strlen (string);
|
||||||
/* The number of backslashes is now -I.
|
/* The number of backslashes is now -I.
|
||||||
Copy P over itself to swallow half of them. */
|
Copy P over itself to swallow half of them. */
|
||||||
bcopy (&p[i / 2], &p[i], (string_len - (p - string)) - (i / 2) + 1);
|
bcopy (&p[i / 2], &p[i], (string_len - (p - string)) - (i / 2) + 1);
|
||||||
@@ -1488,17 +1585,7 @@ char *
|
|||||||
find_percent (pattern)
|
find_percent (pattern)
|
||||||
char *pattern;
|
char *pattern;
|
||||||
{
|
{
|
||||||
return find_char_unquote (pattern, '%', 0);
|
return find_char_unquote (pattern, "%", 0);
|
||||||
}
|
|
||||||
|
|
||||||
/* Search STRING for an unquoted ; that is not after an unquoted #. */
|
|
||||||
|
|
||||||
static char *
|
|
||||||
find_semicolon (string)
|
|
||||||
char *string;
|
|
||||||
{
|
|
||||||
return (find_char_unquote (string, '#', 0) == 0
|
|
||||||
? find_char_unquote (string, ';', 0) : 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse a string into a sequence of filenames represented as a
|
/* Parse a string into a sequence of filenames represented as a
|
||||||
@@ -1517,7 +1604,7 @@ find_semicolon (string)
|
|||||||
struct nameseq *
|
struct nameseq *
|
||||||
parse_file_seq (stringp, stopchar, size, strip)
|
parse_file_seq (stringp, stopchar, size, strip)
|
||||||
char **stringp;
|
char **stringp;
|
||||||
char stopchar;
|
int stopchar;
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
int strip;
|
int strip;
|
||||||
{
|
{
|
||||||
@@ -1526,6 +1613,16 @@ parse_file_seq (stringp, stopchar, size, strip)
|
|||||||
register char *p = *stringp;
|
register char *p = *stringp;
|
||||||
char *q;
|
char *q;
|
||||||
char *name;
|
char *name;
|
||||||
|
char stopchars[3];
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
stopchars[0] = ',';
|
||||||
|
stopchars[1] = stopchar;
|
||||||
|
stopchars[2] = '\0';
|
||||||
|
#else
|
||||||
|
stopchars[0] = stopchar;
|
||||||
|
stopchars[1] = '\0';
|
||||||
|
#endif
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
@@ -1535,15 +1632,51 @@ parse_file_seq (stringp, stopchar, size, strip)
|
|||||||
break;
|
break;
|
||||||
if (*p == stopchar)
|
if (*p == stopchar)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Yes, find end of next name. */
|
/* Yes, find end of next name. */
|
||||||
q = p;
|
q = p;
|
||||||
p = find_char_unquote (q, stopchar, 1);
|
p = find_char_unquote (q, stopchars, 1);
|
||||||
|
#ifdef VMS
|
||||||
|
/* convert comma separated list to space separated */
|
||||||
|
if (p && *p == ',')
|
||||||
|
*p =' ';
|
||||||
|
#endif
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
/* For MS-DOS, skip a "C:\..." or a "C:/..." until we find a
|
||||||
|
first colon which isn't followed by a slash or a backslash. */
|
||||||
|
if (stopchar == ':')
|
||||||
|
while (p != 0 && (p[1] == '\\' || p[1] == '/') && isalpha (p[-1]))
|
||||||
|
p = find_char_unquote (p + 1, stopchars, 1);
|
||||||
|
#endif
|
||||||
|
#ifdef _AMIGA
|
||||||
|
if (stopchar == ':' && p && *p == ':' &&
|
||||||
|
!(isspace(p[1]) || !p[1] || isspace(p[-1])))
|
||||||
|
{
|
||||||
|
p = find_char_unquote (p+1, stopchars, 1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
/* For WINDOWS32, skip a "C:\..." or "C:/...". */
|
||||||
|
if (stopchar == ':' &&
|
||||||
|
p != 0 &&
|
||||||
|
(p[1] == '\\' || p[1] == '/') &&
|
||||||
|
isalpha (p[-1])) {
|
||||||
|
p = end_of_token_w32(++p, ':');
|
||||||
|
if (*p == '\0' && p[-1] == ':')
|
||||||
|
p--;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (p == 0)
|
if (p == 0)
|
||||||
p = q + strlen (q);
|
p = q + strlen (q);
|
||||||
|
|
||||||
if (strip)
|
if (strip)
|
||||||
|
#ifdef VMS
|
||||||
|
/* Skip leading `[]'s. */
|
||||||
|
while (p - q > 2 && q[0] == '[' && q[1] == ']')
|
||||||
|
#else
|
||||||
/* Skip leading `./'s. */
|
/* Skip leading `./'s. */
|
||||||
while (p - q > 2 && q[0] == '.' && q[1] == '/')
|
while (p - q > 2 && q[0] == '.' && q[1] == '/')
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
q += 2; /* Skip "./". */
|
q += 2; /* Skip "./". */
|
||||||
while (q < p && *q == '/')
|
while (q < p && *q == '/')
|
||||||
@@ -1554,10 +1687,44 @@ parse_file_seq (stringp, stopchar, size, strip)
|
|||||||
/* Extract the filename just found, and skip it. */
|
/* Extract the filename just found, and skip it. */
|
||||||
|
|
||||||
if (q == p)
|
if (q == p)
|
||||||
/* ".///" was stripped to "". */
|
/* ".///" was stripped to "". */
|
||||||
|
#ifdef VMS
|
||||||
|
continue;
|
||||||
|
#else
|
||||||
|
#ifdef _AMIGA
|
||||||
|
name = savestring ("", 0);
|
||||||
|
#else
|
||||||
name = savestring ("./", 2);
|
name = savestring ("./", 2);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
|
#ifdef VMS
|
||||||
|
/* VMS filenames can have a ':' in them but they have to be '\'ed but we need
|
||||||
|
* to remove this '\' before we can use the filename.
|
||||||
|
* Savestring called because q may be read-only string constant.
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
char *qbase = savestring(q, strlen(q));
|
||||||
|
char *pbase = qbase + (p-q);
|
||||||
|
char *q1 = qbase;
|
||||||
|
char *q2 = q1;
|
||||||
|
char *p1 = pbase;
|
||||||
|
|
||||||
|
while (q1 != pbase)
|
||||||
|
{
|
||||||
|
if (*q1 == '\\' && *(q1+1) == ':')
|
||||||
|
{
|
||||||
|
q1++;
|
||||||
|
p1--;
|
||||||
|
}
|
||||||
|
*q2++ = *q1++;
|
||||||
|
}
|
||||||
|
name = savestring (qbase, p1 - qbase);
|
||||||
|
free (qbase);
|
||||||
|
}
|
||||||
|
#else
|
||||||
name = savestring (q, p - q);
|
name = savestring (q, p - q);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Add it to the front of the chain. */
|
/* Add it to the front of the chain. */
|
||||||
new1 = (struct nameseq *) xmalloc (size);
|
new1 = (struct nameseq *) xmalloc (size);
|
||||||
@@ -1573,7 +1740,9 @@ parse_file_seq (stringp, stopchar, size, strip)
|
|||||||
an elt further down the chain (i.e., previous in the file list)
|
an elt further down the chain (i.e., previous in the file list)
|
||||||
with an unmatched `(' (e.g., "lib(mem"). */
|
with an unmatched `(' (e.g., "lib(mem"). */
|
||||||
|
|
||||||
for (new1 = new, lastnew1 = 0; new1 != 0; lastnew1 = new1, new1 = new1->next)
|
new1 = new;
|
||||||
|
lastnew1 = 0;
|
||||||
|
while (new1 != 0)
|
||||||
if (new1->name[0] != '(' /* Don't catch "(%)" and suchlike. */
|
if (new1->name[0] != '(' /* Don't catch "(%)" and suchlike. */
|
||||||
&& new1->name[strlen (new1->name) - 1] == ')'
|
&& new1->name[strlen (new1->name) - 1] == ')'
|
||||||
&& index (new1->name, '(') == 0)
|
&& index (new1->name, '(') == 0)
|
||||||
@@ -1654,14 +1823,21 @@ parse_file_seq (stringp, stopchar, size, strip)
|
|||||||
name = concat (libname, new1->name, ")");
|
name = concat (libname, new1->name, ")");
|
||||||
free (new1->name);
|
free (new1->name);
|
||||||
new1->name = name;
|
new1->name = name;
|
||||||
|
lastnew1 = new1;
|
||||||
new1 = new1->next;
|
new1 = new1->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new1 == 0)
|
|
||||||
/* We might have slurped up the whole list,
|
|
||||||
and continuing the loop would dereference NEW1. */
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* No frobnication happening. Just step down the list. */
|
||||||
|
lastnew1 = new1;
|
||||||
|
new1 = new1->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lastnew1 = new1;
|
||||||
|
new1 = new1->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -1776,8 +1952,11 @@ construct_include_path (arg_dirs)
|
|||||||
char **arg_dirs;
|
char **arg_dirs;
|
||||||
{
|
{
|
||||||
register unsigned int i;
|
register unsigned int i;
|
||||||
|
#ifdef VAXC /* just don't ask ... */
|
||||||
|
stat_t stbuf;
|
||||||
|
#else
|
||||||
struct stat stbuf;
|
struct stat stbuf;
|
||||||
|
#endif
|
||||||
/* Table to hold the dirs. */
|
/* Table to hold the dirs. */
|
||||||
|
|
||||||
register unsigned int defsize = (sizeof (default_include_directories)
|
register unsigned int defsize = (sizeof (default_include_directories)
|
||||||
@@ -1786,6 +1965,10 @@ construct_include_path (arg_dirs)
|
|||||||
register char **dirs = (char **) xmalloc ((5 + defsize) * sizeof (char *));
|
register char **dirs = (char **) xmalloc ((5 + defsize) * sizeof (char *));
|
||||||
register unsigned int idx = 0;
|
register unsigned int idx = 0;
|
||||||
|
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
defsize++;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* First consider any dirs specified with -I switches.
|
/* First consider any dirs specified with -I switches.
|
||||||
Ignore dirs that don't exist. */
|
Ignore dirs that don't exist. */
|
||||||
|
|
||||||
@@ -1801,7 +1984,7 @@ construct_include_path (arg_dirs)
|
|||||||
dir = expanded;
|
dir = expanded;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (safe_stat (dir, &stbuf) == 0 && S_ISDIR (stbuf.st_mode))
|
if (stat (dir, &stbuf) == 0 && S_ISDIR (stbuf.st_mode))
|
||||||
{
|
{
|
||||||
if (idx == max - 1)
|
if (idx == max - 1)
|
||||||
{
|
{
|
||||||
@@ -1817,8 +2000,24 @@ construct_include_path (arg_dirs)
|
|||||||
|
|
||||||
/* Now add at the end the standard default dirs. */
|
/* Now add at the end the standard default dirs. */
|
||||||
|
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
{
|
||||||
|
/* The environment variable $DJDIR holds the root of the
|
||||||
|
DJGPP directory tree; add ${DJDIR}/include. */
|
||||||
|
struct variable *djdir = lookup_variable ("DJDIR", 5);
|
||||||
|
|
||||||
|
if (djdir)
|
||||||
|
{
|
||||||
|
char *defdir = (char *) xmalloc (strlen (djdir->value) + 8 + 1);
|
||||||
|
|
||||||
|
strcat (strcpy (defdir, djdir->value), "/include");
|
||||||
|
dirs[idx++] = defdir;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0; default_include_directories[i] != 0; ++i)
|
for (i = 0; default_include_directories[i] != 0; ++i)
|
||||||
if (safe_stat (default_include_directories[i], &stbuf) == 0
|
if (stat (default_include_directories[i], &stbuf) == 0
|
||||||
&& S_ISDIR (stbuf.st_mode))
|
&& S_ISDIR (stbuf.st_mode))
|
||||||
dirs[idx++] = default_include_directories[i];
|
dirs[idx++] = default_include_directories[i];
|
||||||
|
|
||||||
@@ -1849,6 +2048,7 @@ char *
|
|||||||
tilde_expand (name)
|
tilde_expand (name)
|
||||||
char *name;
|
char *name;
|
||||||
{
|
{
|
||||||
|
#ifndef VMS
|
||||||
if (name[1] == '/' || name[1] == '\0')
|
if (name[1] == '/' || name[1] == '\0')
|
||||||
{
|
{
|
||||||
extern char *getenv ();
|
extern char *getenv ();
|
||||||
@@ -1871,6 +2071,7 @@ tilde_expand (name)
|
|||||||
free (home_dir);
|
free (home_dir);
|
||||||
home_dir = getenv ("HOME");
|
home_dir = getenv ("HOME");
|
||||||
}
|
}
|
||||||
|
#if !defined(_AMIGA) && !defined(WINDOWS32)
|
||||||
if (home_dir == 0 || home_dir[0] == '\0')
|
if (home_dir == 0 || home_dir[0] == '\0')
|
||||||
{
|
{
|
||||||
extern char *getlogin ();
|
extern char *getlogin ();
|
||||||
@@ -1883,6 +2084,7 @@ tilde_expand (name)
|
|||||||
home_dir = p->pw_dir;
|
home_dir = p->pw_dir;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* !AMIGA && !WINDOWS32 */
|
||||||
if (home_dir != 0)
|
if (home_dir != 0)
|
||||||
{
|
{
|
||||||
char *new = concat (home_dir, "", name + 1);
|
char *new = concat (home_dir, "", name + 1);
|
||||||
@@ -1891,6 +2093,7 @@ tilde_expand (name)
|
|||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if !defined(_AMIGA) && !defined(WINDOWS32)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct passwd *pwent;
|
struct passwd *pwent;
|
||||||
@@ -1908,7 +2111,8 @@ tilde_expand (name)
|
|||||||
else if (userend != 0)
|
else if (userend != 0)
|
||||||
*userend = '/';
|
*userend = '/';
|
||||||
}
|
}
|
||||||
|
#endif /* !AMIGA && !WINDOWS32 */
|
||||||
|
#endif /* !VMS */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1927,13 +2131,16 @@ multi_glob (chain, size)
|
|||||||
struct nameseq *chain;
|
struct nameseq *chain;
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
{
|
{
|
||||||
|
extern void dir_setup_glob ();
|
||||||
register struct nameseq *new = 0;
|
register struct nameseq *new = 0;
|
||||||
register struct nameseq *old;
|
register struct nameseq *old;
|
||||||
struct nameseq *nexto;
|
struct nameseq *nexto;
|
||||||
|
glob_t gl;
|
||||||
|
|
||||||
|
dir_setup_glob (&gl);
|
||||||
|
|
||||||
for (old = chain; old != 0; old = nexto)
|
for (old = chain; old != 0; old = nexto)
|
||||||
{
|
{
|
||||||
glob_t gl;
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
char *memname;
|
char *memname;
|
||||||
#endif
|
#endif
|
||||||
@@ -1965,9 +2172,9 @@ multi_glob (chain, size)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
memname = 0;
|
memname = 0;
|
||||||
#endif
|
#endif /* !NO_ARCHIVES */
|
||||||
|
|
||||||
switch (glob (old->name, GLOB_NOCHECK, NULL, &gl))
|
switch (glob (old->name, GLOB_NOCHECK|GLOB_ALTDIRFUNC, NULL, &gl))
|
||||||
{
|
{
|
||||||
case 0: /* Success. */
|
case 0: /* Success. */
|
||||||
{
|
{
|
||||||
@@ -2012,7 +2219,7 @@ multi_glob (chain, size)
|
|||||||
free (memname);
|
free (memname);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif /* !NO_ARCHIVES */
|
||||||
{
|
{
|
||||||
struct nameseq *elt = (struct nameseq *) xmalloc (size);
|
struct nameseq *elt = (struct nameseq *) xmalloc (size);
|
||||||
elt->name = savestring (gl.gl_pathv[i],
|
elt->name = savestring (gl.gl_pathv[i],
|
||||||
@@ -2023,7 +2230,7 @@ multi_glob (chain, size)
|
|||||||
}
|
}
|
||||||
globfree (&gl);
|
globfree (&gl);
|
||||||
free (old->name);
|
free (old->name);
|
||||||
free (old);
|
free ((char *)old);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
57
readme.vms
Normal file
57
readme.vms
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
This is the VMS port of GNU Make.
|
||||||
|
|
||||||
|
It is based on the VMS port of GNU Make 3.60 by Mike Moretti.
|
||||||
|
|
||||||
|
This port was done by Klaus Kämpf <kkaempf@progis.de> of
|
||||||
|
proGIS Software, Aachen, Germany.
|
||||||
|
|
||||||
|
To build Make, simply type @makefile. This should compile all the
|
||||||
|
necessary files and link Make. There is also a file called
|
||||||
|
makefile.vms. If you already have GNU Make built you can just use
|
||||||
|
Make with this makefile to rebuild.
|
||||||
|
|
||||||
|
Here are some notes about GNU Make for VMS:
|
||||||
|
|
||||||
|
The variable $^ separates files with commas instead of spaces (It's the
|
||||||
|
natural thing to do for VMS).
|
||||||
|
|
||||||
|
See defaults.c for VMS default suffixes and my definitions for default
|
||||||
|
rules and variables.
|
||||||
|
|
||||||
|
The shell function is not implemented yet.
|
||||||
|
|
||||||
|
Load average routines haven't been implemented for VMS yet.
|
||||||
|
|
||||||
|
The default include directory for including other makefiles is
|
||||||
|
SYS$SYSROOT:[SYSLIB] (I don't remember why I didn't just use
|
||||||
|
SYS$LIBRARY: instead; maybe it wouldn't work that way).
|
||||||
|
|
||||||
|
The default makefiles make looks for are: makefile.vms, gnumakefile, makefile.,
|
||||||
|
and gnumakefile. .
|
||||||
|
|
||||||
|
The stat() function and handling of time stamps in VMS is broken, so I
|
||||||
|
replaced it with a hack in vmsfunctions.c. I will provide a full rewrite
|
||||||
|
somewhere in the future. Be warned, the time resolution inside make is
|
||||||
|
less than what vms provides. This might be a problem on the faster Alphas.
|
||||||
|
|
||||||
|
You can use a : in a filename only if you preceed it with a backslash ('\').
|
||||||
|
E.g.- hobbes\:[bogas.files]
|
||||||
|
|
||||||
|
Make ignores success, informational, or warning errors (-S-, -I-, or -W-).
|
||||||
|
But it will stop on -E- and -F- errors. (unless you do something to override
|
||||||
|
this in your makefile, or whatever).
|
||||||
|
|
||||||
|
Remote stuff isn't implemented yet.
|
||||||
|
|
||||||
|
Multiple line DCL commands, such as "if" statements, must be put inside
|
||||||
|
command files. You can run a command file by using \@.
|
||||||
|
|
||||||
|
|
||||||
|
VMS changes made for 3.74.3
|
||||||
|
|
||||||
|
Lots of default settings are adapted for VMS. See default.c.
|
||||||
|
|
||||||
|
Long command lines are now converted to command files.
|
||||||
|
|
||||||
|
Comma (',') as a separator is now allowed. See makefile.vms for an example.
|
||||||
|
|
||||||
357
remake.c
357
remake.c
@@ -1,5 +1,5 @@
|
|||||||
/* Basic dependency engine for GNU Make.
|
/* Basic dependency engine for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -17,10 +17,10 @@ along with GNU Make; see the file COPYING. If not, write to
|
|||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
#include "commands.h"
|
#include "filedef.h"
|
||||||
#include "job.h"
|
#include "job.h"
|
||||||
|
#include "commands.h"
|
||||||
#include "dep.h"
|
#include "dep.h"
|
||||||
#include "file.h"
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef HAVE_FCNTL_H
|
||||||
@@ -29,17 +29,33 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include <sys/file.h>
|
#include <sys/file.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int try_implicit_rule ();
|
#ifdef __MSDOS__
|
||||||
|
#include "variable.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
#include <starlet.h>
|
||||||
|
#endif
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
#include <io.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern int try_implicit_rule PARAMS ((struct file *file, unsigned int depth));
|
||||||
|
|
||||||
|
|
||||||
/* Incremented when a command is started (under -n, when one would be). */
|
/* Incremented when a command is started (under -n, when one would be). */
|
||||||
unsigned int commands_started = 0;
|
unsigned int commands_started = 0;
|
||||||
|
|
||||||
static int update_file (), update_file_1 (), check_dep (), touch_file ();
|
static int update_file PARAMS ((struct file *file, unsigned int depth));
|
||||||
static void remake_file ();
|
static int update_file_1 PARAMS ((struct file *file, unsigned int depth));
|
||||||
static time_t name_mtime ();
|
static int check_dep PARAMS ((struct file *file, unsigned int depth, time_t this_mtime, int *must_make_ptr));
|
||||||
static int library_search ();
|
static int touch_file PARAMS ((struct file *file));
|
||||||
extern time_t f_mtime ();
|
static void remake_file PARAMS ((struct file *file));
|
||||||
|
static time_t name_mtime PARAMS ((char *name));
|
||||||
|
static int library_search PARAMS ((char **lib, time_t *mtime_ptr));
|
||||||
|
|
||||||
|
extern time_t f_mtime PARAMS ((struct file *file, int search));
|
||||||
|
|
||||||
|
|
||||||
/* Remake all the goals in the `struct dep' chain GOALS. Return -1 if nothing
|
/* Remake all the goals in the `struct dep' chain GOALS. Return -1 if nothing
|
||||||
was done, 0 if all goals were updated successfully, or 1 if a goal failed.
|
was done, 0 if all goals were updated successfully, or 1 if a goal failed.
|
||||||
@@ -100,6 +116,7 @@ update_goal_chain (goals, makefiles)
|
|||||||
/* Iterate over all double-colon entries for this file. */
|
/* Iterate over all double-colon entries for this file. */
|
||||||
struct file *file = g->file;
|
struct file *file = g->file;
|
||||||
int stop, any_not_updated = 0;
|
int stop, any_not_updated = 0;
|
||||||
|
|
||||||
for (file = g->file->double_colon ? g->file->double_colon : g->file;
|
for (file = g->file->double_colon ? g->file->double_colon : g->file;
|
||||||
file != NULL;
|
file != NULL;
|
||||||
file = file->prev)
|
file = file->prev)
|
||||||
@@ -108,7 +125,6 @@ update_goal_chain (goals, makefiles)
|
|||||||
int x;
|
int x;
|
||||||
time_t mtime = MTIME (file);
|
time_t mtime = MTIME (file);
|
||||||
check_renamed (file);
|
check_renamed (file);
|
||||||
|
|
||||||
if (makefiles)
|
if (makefiles)
|
||||||
{
|
{
|
||||||
if (file->cmd_target)
|
if (file->cmd_target)
|
||||||
@@ -195,14 +211,10 @@ update_goal_chain (goals, makefiles)
|
|||||||
&& file->update_status == 0 && !g->changed
|
&& file->update_status == 0 && !g->changed
|
||||||
/* Never give a message under -s or -q. */
|
/* Never give a message under -s or -q. */
|
||||||
&& !silent_flag && !question_flag)
|
&& !silent_flag && !question_flag)
|
||||||
{
|
message (1, ((file->phony || file->cmds == 0)
|
||||||
if (file->phony || file->cmds == 0)
|
? "Nothing to be done for `%s'."
|
||||||
message ("Nothing to be done for `%s'.",
|
: "`%s' is up to date."),
|
||||||
file->name);
|
file->name);
|
||||||
else
|
|
||||||
message ("`%s' is up to date.", file->name);
|
|
||||||
fflush (stdout);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This goal is finished. Remove it from the chain. */
|
/* This goal is finished. Remove it from the chain. */
|
||||||
if (lastgoal == 0)
|
if (lastgoal == 0)
|
||||||
@@ -233,7 +245,6 @@ update_goal_chain (goals, makefiles)
|
|||||||
just_print_flag = n;
|
just_print_flag = n;
|
||||||
job_slots = j;
|
job_slots = j;
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -491,7 +502,16 @@ update_file_1 (file, depth)
|
|||||||
return dep_status;
|
return dep_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
set_command_state (file, cs_not_started);
|
if (file->command_state == cs_deps_running)
|
||||||
|
/* The commands for some deps were running on the last iteration, but
|
||||||
|
they have finished now. Reset the command_state to not_started to
|
||||||
|
simplify later bookkeeping. It is important that we do this only
|
||||||
|
when the prior state was cs_deps_running, because that prior state
|
||||||
|
was definitely propagated to FILE's also_make's by set_command_state
|
||||||
|
(called above), but in another state an also_make may have
|
||||||
|
independently changed to finished state, and we would confuse that
|
||||||
|
file's bookkeeping (updated, but not_started is bogus state). */
|
||||||
|
set_command_state (file, cs_not_started);
|
||||||
|
|
||||||
/* Now record which dependencies are more
|
/* Now record which dependencies are more
|
||||||
recent than this file, so we can define $?. */
|
recent than this file, so we can define $?. */
|
||||||
@@ -546,14 +566,46 @@ update_file_1 (file, depth)
|
|||||||
|
|
||||||
if (!must_make)
|
if (!must_make)
|
||||||
{
|
{
|
||||||
DEBUGPR ("No need to remake target `%s'.\n");
|
if (debug_flag)
|
||||||
file->update_status = 0;
|
{
|
||||||
|
print_spaces(depth);
|
||||||
|
printf("No need to remake target `%s'", file->name);
|
||||||
|
if (!streq(file->name, file->hname))
|
||||||
|
printf("; using VPATH name `%s'", file->hname);
|
||||||
|
printf(".\n");
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
|
|
||||||
notice_finished_file (file);
|
notice_finished_file (file);
|
||||||
|
|
||||||
|
/* Since we don't need to remake the file, convert it to use the
|
||||||
|
VPATH filename if we found one. hfile will be either the
|
||||||
|
local name if no VPATH or the VPATH name if one was found. */
|
||||||
|
|
||||||
|
while (file)
|
||||||
|
{
|
||||||
|
file->name = file->hname;
|
||||||
|
file = file->prev;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUGPR ("Must remake target `%s'.\n");
|
DEBUGPR ("Must remake target `%s'.\n");
|
||||||
|
|
||||||
|
/* It needs to be remade. If it's VPATH and not reset via GPATH, toss the
|
||||||
|
VPATH */
|
||||||
|
if (!streq(file->name, file->hname))
|
||||||
|
{
|
||||||
|
if (debug_flag)
|
||||||
|
{
|
||||||
|
print_spaces (depth);
|
||||||
|
printf(" Ignoring VPATH name `%s'.\n", file->hname);
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
|
file->ignore_vpath = 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Now, take appropriate actions to remake the file. */
|
/* Now, take appropriate actions to remake the file. */
|
||||||
remake_file (file);
|
remake_file (file);
|
||||||
|
|
||||||
@@ -565,14 +617,17 @@ update_file_1 (file, depth)
|
|||||||
|
|
||||||
switch (file->update_status)
|
switch (file->update_status)
|
||||||
{
|
{
|
||||||
case 1:
|
case 2:
|
||||||
DEBUGPR ("Failed to remake target file `%s'.\n");
|
DEBUGPR ("Failed to remake target file `%s'.\n");
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
DEBUGPR ("Successfully remade target file `%s'.\n");
|
DEBUGPR ("Successfully remade target file `%s'.\n");
|
||||||
break;
|
break;
|
||||||
|
case 1:
|
||||||
|
DEBUGPR ("Target file `%s' needs remade under -q.\n");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
assert (file->update_status == 0 || file->update_status == 1);
|
assert (file->update_status >= 0 && file->update_status <= 2);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -582,7 +637,9 @@ update_file_1 (file, depth)
|
|||||||
|
|
||||||
/* Set FILE's `updated' flag and re-check its mtime and the mtime's of all
|
/* Set FILE's `updated' flag and re-check its mtime and the mtime's of all
|
||||||
files listed in its `also_make' member. Under -t, this function also
|
files listed in its `also_make' member. Under -t, this function also
|
||||||
touches FILE. */
|
touches FILE.
|
||||||
|
|
||||||
|
On return, FILE->update_status will no longer be -1 if it was. */
|
||||||
|
|
||||||
void
|
void
|
||||||
notice_finished_file (file)
|
notice_finished_file (file)
|
||||||
@@ -596,12 +653,12 @@ notice_finished_file (file)
|
|||||||
|
|
||||||
if (touch_flag
|
if (touch_flag
|
||||||
/* The update status will be:
|
/* The update status will be:
|
||||||
-1 if no commands were run;
|
-1 if this target was not remade;
|
||||||
0 if some commands (+ or ${MAKE}) were run and won;
|
0 if 0 or more commands (+ or ${MAKE}) were run and won;
|
||||||
1 if some commands were run and lost.
|
1 if some commands were run and lost.
|
||||||
The only time we don't want to touch the target is if
|
We touch the target if it has commands which either were not run
|
||||||
it had some recursive commands, and they lost. */
|
or won when they ran (i.e. status is 0). */
|
||||||
&& file->update_status != 1)
|
&& file->update_status == 0)
|
||||||
{
|
{
|
||||||
if (file->cmds != 0 && file->cmds->any_recurse)
|
if (file->cmds != 0 && file->cmds->any_recurse)
|
||||||
{
|
{
|
||||||
@@ -639,7 +696,7 @@ notice_finished_file (file)
|
|||||||
f->last_mtime = file->last_mtime;
|
f->last_mtime = file->last_mtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file->update_status != -1)
|
if (ran && file->update_status != -1)
|
||||||
/* We actually tried to update FILE, which has
|
/* We actually tried to update FILE, which has
|
||||||
updated its also_make's as well (if it worked).
|
updated its also_make's as well (if it worked).
|
||||||
If it didn't work, it wouldn't work again for them.
|
If it didn't work, it wouldn't work again for them.
|
||||||
@@ -657,6 +714,10 @@ notice_finished_file (file)
|
|||||||
never be done because the target is already updated. */
|
never be done because the target is already updated. */
|
||||||
(void) f_mtime (d->file, 0);
|
(void) f_mtime (d->file, 0);
|
||||||
}
|
}
|
||||||
|
else if (file->update_status == -1)
|
||||||
|
/* Nothing was done for FILE, but it needed nothing done.
|
||||||
|
So mark it now as "succeeded". */
|
||||||
|
file->update_status = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check whether another file (whose mtime is THIS_MTIME)
|
/* Check whether another file (whose mtime is THIS_MTIME)
|
||||||
@@ -693,49 +754,78 @@ check_dep (file, depth, this_mtime, must_make_ptr)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* FILE is an intermediate file.
|
/* FILE is an intermediate file. */
|
||||||
Update all non-intermediate files we depend on, if necessary,
|
time_t mtime;
|
||||||
and see whether any of them is more recent than the file
|
|
||||||
on whose behalf we are checking. */
|
if (!file->phony && file->cmds == 0 && !file->tried_implicit
|
||||||
register struct dep *lastd;
|
&& file->secondary)
|
||||||
lastd = 0;
|
|
||||||
d = file->deps;
|
|
||||||
while (d != 0)
|
|
||||||
{
|
{
|
||||||
if (d->file->updating)
|
if (try_implicit_rule (file, depth))
|
||||||
|
DEBUGPR ("Found an implicit rule for `%s'.\n");
|
||||||
|
else
|
||||||
|
DEBUGPR ("No implicit rule found for `%s'.\n");
|
||||||
|
file->tried_implicit = 1;
|
||||||
|
}
|
||||||
|
if (file->cmds == 0 && !file->is_target && file->secondary
|
||||||
|
&& default_file != 0 && default_file->cmds != 0)
|
||||||
|
{
|
||||||
|
DEBUGPR ("Using default commands for `%s'.\n");
|
||||||
|
file->cmds = default_file->cmds;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If the intermediate file actually exists
|
||||||
|
and is newer, then we should remake from it. */
|
||||||
|
check_renamed (file);
|
||||||
|
mtime = file_mtime (file);
|
||||||
|
check_renamed (file);
|
||||||
|
if (mtime != (time_t) -1 && mtime > this_mtime)
|
||||||
|
*must_make_ptr = 1;
|
||||||
|
/* Otherwise, update all non-intermediate files we depend on,
|
||||||
|
if necessary, and see whether any of them is more
|
||||||
|
recent than the file on whose behalf we are checking. */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
register struct dep *lastd;
|
||||||
|
|
||||||
|
lastd = 0;
|
||||||
|
d = file->deps;
|
||||||
|
while (d != 0)
|
||||||
{
|
{
|
||||||
error ("Circular %s <- %s dependency dropped.",
|
if (d->file->updating)
|
||||||
file->name, d->file->name);
|
|
||||||
if (lastd == 0)
|
|
||||||
{
|
{
|
||||||
file->deps = d->next;
|
error ("Circular %s <- %s dependency dropped.",
|
||||||
free ((char *) d);
|
file->name, d->file->name);
|
||||||
d = file->deps;
|
if (lastd == 0)
|
||||||
|
{
|
||||||
|
file->deps = d->next;
|
||||||
|
free ((char *) d);
|
||||||
|
d = file->deps;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lastd->next = d->next;
|
||||||
|
free ((char *) d);
|
||||||
|
d = lastd->next;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
d->file->parent = file;
|
||||||
lastd->next = d->next;
|
dep_status |= check_dep (d->file, depth, this_mtime, must_make_ptr);
|
||||||
free ((char *) d);
|
check_renamed (d->file);
|
||||||
d = lastd->next;
|
if (dep_status != 0 && !keep_going_flag)
|
||||||
}
|
break;
|
||||||
continue;
|
|
||||||
|
if (d->file->command_state == cs_running
|
||||||
|
|| d->file->command_state == cs_deps_running)
|
||||||
|
/* Record that some of FILE's dependencies are still being made.
|
||||||
|
This tells the upper levels to wait on processing it until
|
||||||
|
the commands are finished. */
|
||||||
|
set_command_state (file, cs_deps_running);
|
||||||
|
|
||||||
|
lastd = d;
|
||||||
|
d = d->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->file->parent = file;
|
|
||||||
dep_status |= check_dep (d->file, depth, this_mtime, must_make_ptr);
|
|
||||||
check_renamed (d->file);
|
|
||||||
if (dep_status != 0 && !keep_going_flag)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (d->file->command_state == cs_running
|
|
||||||
|| d->file->command_state == cs_deps_running)
|
|
||||||
/* Record that some of FILE's dependencies are still being made.
|
|
||||||
This tells the upper levels to wait on processing it until
|
|
||||||
the commands are finished. */
|
|
||||||
set_command_state (file, cs_deps_running);
|
|
||||||
|
|
||||||
lastd = d;
|
|
||||||
d = d->next;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -752,10 +842,7 @@ touch_file (file)
|
|||||||
register struct file *file;
|
register struct file *file;
|
||||||
{
|
{
|
||||||
if (!silent_flag)
|
if (!silent_flag)
|
||||||
{
|
message (0, "touch %s", file->name);
|
||||||
printf ("touch %s\n", file->name);
|
|
||||||
fflush (stdout);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef NO_ARCHIVES
|
#ifndef NO_ARCHIVES
|
||||||
if (ar_name (file->name))
|
if (ar_name (file->name))
|
||||||
@@ -825,15 +912,29 @@ remake_file (file)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* This is a dependency file we cannot remake. Fail. */
|
/* This is a dependency file we cannot remake. Fail. */
|
||||||
static char noway[] = "No rule to make target";
|
static const char msg_noparent[]
|
||||||
|
= "%sNo rule to make target `%s'%s";
|
||||||
|
static const char msg_parent[]
|
||||||
|
= "%sNo rule to make target `%s', needed by `%s'%s";
|
||||||
if (keep_going_flag || file->dontcare)
|
if (keep_going_flag || file->dontcare)
|
||||||
{
|
{
|
||||||
if (!file->dontcare)
|
if (!file->dontcare)
|
||||||
error ("*** %s `%s'.", noway, file->name);
|
{
|
||||||
file->update_status = 1;
|
if (file->parent == 0)
|
||||||
|
error (msg_noparent, "*** ", file->name, ".");
|
||||||
|
else
|
||||||
|
error (msg_parent, "*** ",
|
||||||
|
file->name, file->parent->name, ".");
|
||||||
|
}
|
||||||
|
file->update_status = 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fatal ("%s `%s'", noway, file->name);
|
{
|
||||||
|
if (file->parent == 0)
|
||||||
|
fatal (msg_noparent, "", file->name, "");
|
||||||
|
else
|
||||||
|
fatal (msg_parent, "", file->name, file->parent->name, "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -845,6 +946,9 @@ remake_file (file)
|
|||||||
execute_file_commands (file);
|
execute_file_commands (file);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
/* This tells notice_finished_file it is ok to touch the file. */
|
||||||
|
file->update_status = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This does the touching under -t. */
|
/* This does the touching under -t. */
|
||||||
@@ -932,7 +1036,7 @@ f_mtime (file, search)
|
|||||||
{
|
{
|
||||||
mtime = name_mtime (file->name);
|
mtime = name_mtime (file->name);
|
||||||
|
|
||||||
if (mtime == (time_t) -1 && search)
|
if (mtime == (time_t) -1 && search && !file->ignore_vpath)
|
||||||
{
|
{
|
||||||
/* If name_mtime failed, search VPATH. */
|
/* If name_mtime failed, search VPATH. */
|
||||||
char *name = file->name;
|
char *name = file->name;
|
||||||
@@ -945,13 +1049,63 @@ f_mtime (file, search)
|
|||||||
/* vpath_search and library_search store zero in MTIME
|
/* vpath_search and library_search store zero in MTIME
|
||||||
if they didn't need to do a stat call for their work. */
|
if they didn't need to do a stat call for their work. */
|
||||||
file->last_mtime = mtime;
|
file->last_mtime = mtime;
|
||||||
rename_file (file, name);
|
|
||||||
|
/* If we found it in VPATH, see if it's in GPATH too; if so,
|
||||||
|
change the name right now; if not, defer until after the
|
||||||
|
dependencies are updated. */
|
||||||
|
if (gpath_search (name, strlen(name) - strlen(file->name) - 1))
|
||||||
|
{
|
||||||
|
rename_file (file, name);
|
||||||
|
check_renamed (file);
|
||||||
|
return file_mtime (file);
|
||||||
|
}
|
||||||
|
|
||||||
|
rehash_file (file, name);
|
||||||
check_renamed (file);
|
check_renamed (file);
|
||||||
return file_mtime (file);
|
mtime = name_mtime (name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
/* Files can have bogus timestamps that nothing newly made will be
|
||||||
|
"newer" than. Updating their dependents could just result in loops.
|
||||||
|
So notify the user of the anomaly with a warning.
|
||||||
|
|
||||||
|
We only need to do this once, for now. */
|
||||||
|
|
||||||
|
static time_t now = 0;
|
||||||
|
if (!clock_skew_detected
|
||||||
|
&& mtime != (time_t)-1 && mtime > now
|
||||||
|
&& !file->updated)
|
||||||
|
{
|
||||||
|
/* This file's time appears to be in the future.
|
||||||
|
Update our concept of the present, and compare again. */
|
||||||
|
|
||||||
|
extern time_t time ();
|
||||||
|
time (&now);
|
||||||
|
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
/*
|
||||||
|
* FAT filesystems round time to nearest even second(!). Just
|
||||||
|
* allow for any file (NTFS or FAT) to perhaps suffer from this
|
||||||
|
* braindamage.
|
||||||
|
*
|
||||||
|
* Apparently, this doesn't happen with the MS-DOS/DJGPP port,
|
||||||
|
* although MS-DOS and MS-Windows 3.X/9X also use FAT filesystems.
|
||||||
|
*/
|
||||||
|
if (mtime > now && (((mtime % 2) == 0) && ((mtime-1) > now)))
|
||||||
|
#else
|
||||||
|
if (mtime > now)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
error("*** Warning: File `%s' has modification time in the future",
|
||||||
|
file->name);
|
||||||
|
clock_skew_detected = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Store the mtime into all the entries for this file. */
|
/* Store the mtime into all the entries for this file. */
|
||||||
if (file->double_colon)
|
if (file->double_colon)
|
||||||
file = file->double_colon;
|
file = file->double_colon;
|
||||||
@@ -973,7 +1127,7 @@ name_mtime (name)
|
|||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
if (safe_stat (name, &st) < 0)
|
if (stat (name, &st) < 0)
|
||||||
return (time_t) -1;
|
return (time_t) -1;
|
||||||
|
|
||||||
return (time_t) st.st_mtime;
|
return (time_t) st.st_mtime;
|
||||||
@@ -991,8 +1145,17 @@ library_search (lib, mtime_ptr)
|
|||||||
{
|
{
|
||||||
static char *dirs[] =
|
static char *dirs[] =
|
||||||
{
|
{
|
||||||
|
#ifndef _AMIGA
|
||||||
"/lib",
|
"/lib",
|
||||||
"/usr/lib",
|
"/usr/lib",
|
||||||
|
#endif
|
||||||
|
#if defined(WINDOWS32) && !defined(LIBDIR)
|
||||||
|
/*
|
||||||
|
* This is completely up to the user at product install time. Just define
|
||||||
|
* a placeholder.
|
||||||
|
*/
|
||||||
|
#define LIBDIR "."
|
||||||
|
#endif
|
||||||
LIBDIR, /* Defined by configuration. */
|
LIBDIR, /* Defined by configuration. */
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
@@ -1006,7 +1169,11 @@ library_search (lib, mtime_ptr)
|
|||||||
|
|
||||||
/* Look first for `libNAME.a' in the current directory. */
|
/* Look first for `libNAME.a' in the current directory. */
|
||||||
|
|
||||||
|
#ifndef _AMIGA
|
||||||
sprintf (buf, "lib%s.a", libname);
|
sprintf (buf, "lib%s.a", libname);
|
||||||
|
#else
|
||||||
|
sprintf (buf, "%s.lib", libname);
|
||||||
|
#endif
|
||||||
mtime = name_mtime (buf);
|
mtime = name_mtime (buf);
|
||||||
if (mtime != (time_t) -1)
|
if (mtime != (time_t) -1)
|
||||||
{
|
{
|
||||||
@@ -1028,9 +1195,37 @@ library_search (lib, mtime_ptr)
|
|||||||
|
|
||||||
/* Now try the standard set of directories. */
|
/* Now try the standard set of directories. */
|
||||||
|
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
{
|
||||||
|
/* The default library directory is at ${DJDIR}/lib. */
|
||||||
|
struct variable *djdir = lookup_variable ("DJDIR", 5);
|
||||||
|
|
||||||
|
if (djdir)
|
||||||
|
{
|
||||||
|
size_t djdir_len = strlen (djdir->value);
|
||||||
|
|
||||||
|
if (djdir_len > sizeof(LIBDIR) + 8 + strlen(libname) + 4 + 2)
|
||||||
|
buf = (char *) xrealloc (djdir_len + 1);
|
||||||
|
sprintf (buf, "%s/lib/lib%s.a", djdir->value, libname);
|
||||||
|
mtime = name_mtime (buf);
|
||||||
|
if (mtime != (time_t) -1)
|
||||||
|
{
|
||||||
|
*lib = buf;
|
||||||
|
if (mtime_ptr != 0)
|
||||||
|
*mtime_ptr = mtime;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
for (dp = dirs; *dp != 0; ++dp)
|
for (dp = dirs; *dp != 0; ++dp)
|
||||||
{
|
{
|
||||||
|
#ifndef _AMIGA
|
||||||
sprintf (buf, "%s/lib%s.a", *dp, libname);
|
sprintf (buf, "%s/lib%s.a", *dp, libname);
|
||||||
|
#else
|
||||||
|
sprintf (buf, "%s/%s.lib", *dp, libname);
|
||||||
|
#endif
|
||||||
mtime = name_mtime (buf);
|
mtime = name_mtime (buf);
|
||||||
if (mtime != (time_t) -1)
|
if (mtime != (time_t) -1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Template for the remote job exportation interface to GNU Make.
|
/* Template for the remote job exportation interface to GNU Make.
|
||||||
Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
|
Copyright (C) 1988, 1989, 1992, 1993, 1996 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -17,12 +17,27 @@ along with GNU Make; see the file COPYING. If not, write to
|
|||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
|
#include "filedef.h"
|
||||||
|
#include "job.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
|
||||||
|
|
||||||
char *remote_description = 0;
|
char *remote_description = 0;
|
||||||
|
|
||||||
|
/* Call once at startup even if no commands are run. */
|
||||||
|
|
||||||
|
void
|
||||||
|
remote_setup ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Called before exit. */
|
||||||
|
|
||||||
|
void
|
||||||
|
remote_cleanup ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/* Return nonzero if the next job should be done remotely. */
|
/* Return nonzero if the next job should be done remotely. */
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|||||||
28
rule.c
28
rule.c
@@ -17,13 +17,14 @@ along with GNU Make; see the file COPYING. If not, write to
|
|||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
#include "commands.h"
|
|
||||||
#include "dep.h"
|
#include "dep.h"
|
||||||
#include "file.h"
|
#include "filedef.h"
|
||||||
|
#include "job.h"
|
||||||
|
#include "commands.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#include "rule.h"
|
#include "rule.h"
|
||||||
|
|
||||||
static void freerule ();
|
static void freerule PARAMS ((struct rule *rule, struct rule *lastrule));
|
||||||
|
|
||||||
/* Chain of all pattern rules. */
|
/* Chain of all pattern rules. */
|
||||||
|
|
||||||
@@ -96,9 +97,13 @@ count_implicit_rule_limits ()
|
|||||||
for (dep = rule->deps; dep != 0; dep = dep->next)
|
for (dep = rule->deps; dep != 0; dep = dep->next)
|
||||||
{
|
{
|
||||||
unsigned int len = strlen (dep->name);
|
unsigned int len = strlen (dep->name);
|
||||||
char *p = rindex (dep->name, '/');
|
|
||||||
char *p2 = p != 0 ? index (dep->name, '%') : 0;
|
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
char *p = rindex (dep->name, ']');
|
||||||
|
#else
|
||||||
|
char *p = rindex (dep->name, '/');
|
||||||
|
#endif
|
||||||
|
char *p2 = p != 0 ? index (dep->name, '%') : 0;
|
||||||
ndeps++;
|
ndeps++;
|
||||||
|
|
||||||
if (len > max_pattern_dep_length)
|
if (len > max_pattern_dep_length)
|
||||||
@@ -125,7 +130,11 @@ count_implicit_rule_limits ()
|
|||||||
nonexistent subdirectory. */
|
nonexistent subdirectory. */
|
||||||
|
|
||||||
dep->changed = !dir_file_exists_p (name, "");
|
dep->changed = !dir_file_exists_p (name, "");
|
||||||
|
#ifdef VMS
|
||||||
|
if (dep->changed && *name == ']')
|
||||||
|
#else
|
||||||
if (dep->changed && *name == '/')
|
if (dep->changed && *name == '/')
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
/* The name is absolute and the directory does not exist.
|
/* The name is absolute and the directory does not exist.
|
||||||
This rule can never possibly match, since this dependency
|
This rule can never possibly match, since this dependency
|
||||||
@@ -173,7 +182,11 @@ convert_suffix_rule (target, source, cmds)
|
|||||||
/* Special case: TARGET being nil means we are defining a
|
/* Special case: TARGET being nil means we are defining a
|
||||||
`.X.a' suffix rule; the target pattern is always `(%.o)'. */
|
`.X.a' suffix rule; the target pattern is always `(%.o)'. */
|
||||||
{
|
{
|
||||||
|
#ifdef VMS
|
||||||
|
targname = savestring ("(%.obj)", 7);
|
||||||
|
#else
|
||||||
targname = savestring ("(%.o)", 5);
|
targname = savestring ("(%.o)", 5);
|
||||||
|
#endif
|
||||||
targpercent = targname + 1;
|
targpercent = targname + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -561,6 +574,11 @@ print_rule_data_base ()
|
|||||||
printf ("\n# %u implicit rules, %u", rules, terminal);
|
printf ("\n# %u implicit rules, %u", rules, terminal);
|
||||||
#ifndef NO_FLOAT
|
#ifndef NO_FLOAT
|
||||||
printf (" (%.1f%%)", (double) terminal / (double) rules * 100.0);
|
printf (" (%.1f%%)", (double) terminal / (double) rules * 100.0);
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
int f = (terminal * 1000 + 5) / rules;
|
||||||
|
printf (" (%d.%d%%)", f/10, f%10);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
puts (" terminal.");
|
puts (" terminal.");
|
||||||
}
|
}
|
||||||
|
|||||||
4
rule.h
4
rule.h
@@ -49,5 +49,5 @@ extern struct file *suffix_file;
|
|||||||
extern unsigned int maxsuffix;
|
extern unsigned int maxsuffix;
|
||||||
|
|
||||||
|
|
||||||
extern void install_pattern_rule ();
|
extern void install_pattern_rule PARAMS ((struct pspec *p, int terminal));
|
||||||
int new_pattern_rule ();
|
extern int new_pattern_rule PARAMS ((struct rule *rule, int override));
|
||||||
|
|||||||
65
signame.c
65
signame.c
@@ -1,28 +1,42 @@
|
|||||||
/* Convert between signal names and numbers.
|
/* Convert between signal names and numbers.
|
||||||
Copyright (C) 1990, 1992, 1993 Free Software Foundation, Inc.
|
Copyright (C) 1990, 1992, 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
it under the terms of the GNU General Public License as published by
|
modify it under the terms of the GNU Library General Public License as
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
published by the Free Software Foundation; either version 2 of the
|
||||||
any later version.
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
GNU General Public License for more details.
|
Library General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU Library General Public
|
||||||
along with this program; see the file COPYING. If not, write to
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/types.h> /* Some systems need this for <signal.h>. */
|
#include <sys/types.h> /* Some systems need this for <signal.h>. */
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_STRING_H
|
||||||
#include <config.h>
|
#include <string.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Some systems declare `sys_siglist in <unistd.h>; if
|
||||||
|
configure defined SYS_SIGLIST_DECLARED, it may expect
|
||||||
|
to find the declaration there. */
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Some systems do not define NSIG in <signal.h>. */
|
/* Some systems do not define NSIG in <signal.h>. */
|
||||||
#ifndef NSIG
|
#ifndef NSIG
|
||||||
#ifdef _NSIG
|
#ifdef _NSIG
|
||||||
@@ -216,6 +230,12 @@ signame_init ()
|
|||||||
#if defined (SIGDANGER)
|
#if defined (SIGDANGER)
|
||||||
init_sig (SIGDANGER, "DANGER", "Danger signal");
|
init_sig (SIGDANGER, "DANGER", "Danger signal");
|
||||||
#endif
|
#endif
|
||||||
|
#if defined (SIGINFO)
|
||||||
|
init_sig (SIGINFO, "INFO", "Information request");
|
||||||
|
#endif
|
||||||
|
#if defined (SIGNOFP)
|
||||||
|
init_sig (SIGNOFP, "NOFP", "Floating point co-processor not available");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the abbreviation for signal NUMBER. */
|
/* Return the abbreviation for signal NUMBER. */
|
||||||
@@ -273,3 +293,20 @@ psignal (signal, message)
|
|||||||
fprintf (stderr, "%s: %s\n", message, sys_siglist[signal]);
|
fprintf (stderr, "%s: %s\n", message, sys_siglist[signal]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRSIGNAL
|
||||||
|
/* Return the string associated with the signal number. */
|
||||||
|
|
||||||
|
char *
|
||||||
|
strsignal (signal)
|
||||||
|
int signal;
|
||||||
|
{
|
||||||
|
static char buf[] = "Signal 12345678901234567890";
|
||||||
|
|
||||||
|
if (signal > 0 || signal < NSIG)
|
||||||
|
return (char *) sys_siglist[signal];
|
||||||
|
|
||||||
|
sprintf (buf, "Signal %d", signal);
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
36
signame.h
36
signame.h
@@ -1,19 +1,21 @@
|
|||||||
/* Convert between signal names and numbers.
|
/* Convert between signal names and numbers.
|
||||||
Copyright (C) 1990, 1992, 1993 Free Software Foundation, Inc.
|
Copyright (C) 1990, 1992, 1993, 1995, 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
it under the terms of the GNU General Public License as published by
|
modify it under the terms of the GNU Library General Public License as
|
||||||
the Free Software Foundation; either version 2, or (at your option)
|
published by the Free Software Foundation; either version 2 of the
|
||||||
any later version.
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
GNU General Public License for more details.
|
Library General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU Library General Public
|
||||||
along with this program; see the file COPYING. If not, write to
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
#if defined (__STDC__) && __STDC__
|
#if defined (__STDC__) && __STDC__
|
||||||
|
|
||||||
@@ -29,7 +31,7 @@ char *sig_abbrev (int number);
|
|||||||
signal by that name. */
|
signal by that name. */
|
||||||
int sig_number (const char *abbrev);
|
int sig_number (const char *abbrev);
|
||||||
|
|
||||||
/* Avoid conflicts with a system header file that might define these two. */
|
/* Avoid conflicts with a system header file that might define these three. */
|
||||||
|
|
||||||
#ifndef HAVE_PSIGNAL
|
#ifndef HAVE_PSIGNAL
|
||||||
/* Print to standard error the name of SIGNAL, preceded by MESSAGE and
|
/* Print to standard error the name of SIGNAL, preceded by MESSAGE and
|
||||||
@@ -37,6 +39,11 @@ int sig_number (const char *abbrev);
|
|||||||
void psignal (int signal, const char *message);
|
void psignal (int signal, const char *message);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRSIGNAL
|
||||||
|
/* Return the name of SIGNAL. */
|
||||||
|
char *strsignal (int signal);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined (HAVE_SYS_SIGLIST)
|
#if !defined (HAVE_SYS_SIGLIST)
|
||||||
/* Names for signals from 0 to NSIG-1. */
|
/* Names for signals from 0 to NSIG-1. */
|
||||||
extern const char *sys_siglist[];
|
extern const char *sys_siglist[];
|
||||||
@@ -50,6 +57,9 @@ int sig_number ();
|
|||||||
#if !defined (HAVE_SYS_SIGLIST) && !defined (HAVE_PSIGNAL)
|
#if !defined (HAVE_SYS_SIGLIST) && !defined (HAVE_PSIGNAL)
|
||||||
void psignal ();
|
void psignal ();
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef HAVE_STRSIGNAL
|
||||||
|
char *strsignal ();
|
||||||
|
#endif
|
||||||
#if !defined (HAVE_SYS_SIGLIST)
|
#if !defined (HAVE_SYS_SIGLIST)
|
||||||
extern char *sys_siglist[];
|
extern char *sys_siglist[];
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
3
subproc.bat
Normal file
3
subproc.bat
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
cd w32\subproc
|
||||||
|
nmake /f %1
|
||||||
|
cd ..\..
|
||||||
4935
texinfo.tex
Normal file
4935
texinfo.tex
Normal file
File diff suppressed because it is too large
Load Diff
208
variable.c
208
variable.c
@@ -1,5 +1,5 @@
|
|||||||
/* Internals of variables for GNU Make.
|
/* Internals of variables for GNU Make.
|
||||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -17,10 +17,14 @@ along with GNU Make; see the file COPYING. If not, write to
|
|||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
|
#include "dep.h"
|
||||||
|
#include "filedef.h"
|
||||||
|
#include "job.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
#include "dep.h"
|
#ifdef WINDOWS32
|
||||||
#include "file.h"
|
#include "pathstuff.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Hash table of all global variable definitions. */
|
/* Hash table of all global variable definitions. */
|
||||||
|
|
||||||
@@ -39,6 +43,11 @@ static struct variable_set global_variable_set
|
|||||||
static struct variable_set_list global_setlist
|
static struct variable_set_list global_setlist
|
||||||
= { 0, &global_variable_set };
|
= { 0, &global_variable_set };
|
||||||
struct variable_set_list *current_variable_set_list = &global_setlist;
|
struct variable_set_list *current_variable_set_list = &global_setlist;
|
||||||
|
|
||||||
|
static struct variable *define_variable_in_set PARAMS ((char *name, unsigned int length,
|
||||||
|
char *value, enum variable_origin origin,
|
||||||
|
int recursive, struct variable_set *set));
|
||||||
|
|
||||||
|
|
||||||
/* Implement variables. */
|
/* Implement variables. */
|
||||||
|
|
||||||
@@ -324,8 +333,6 @@ merge_variable_set_lists (setlist0, setlist1)
|
|||||||
|
|
||||||
merge_variable_sets (list0->set, next->set);
|
merge_variable_sets (list0->set, next->set);
|
||||||
|
|
||||||
free ((char *) next);
|
|
||||||
|
|
||||||
last0 = list0;
|
last0 = list0;
|
||||||
list0 = list0->next;
|
list0 = list0->next;
|
||||||
}
|
}
|
||||||
@@ -345,7 +352,11 @@ merge_variable_set_lists (setlist0, setlist1)
|
|||||||
void
|
void
|
||||||
define_automatic_variables ()
|
define_automatic_variables ()
|
||||||
{
|
{
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
extern char* default_shell;
|
||||||
|
#else
|
||||||
extern char default_shell[];
|
extern char default_shell[];
|
||||||
|
#endif
|
||||||
register struct variable *v;
|
register struct variable *v;
|
||||||
char buf[200];
|
char buf[200];
|
||||||
|
|
||||||
@@ -360,12 +371,39 @@ define_automatic_variables ()
|
|||||||
? "" : remote_description);
|
? "" : remote_description);
|
||||||
(void) define_variable ("MAKE_VERSION", 12, buf, o_default, 0);
|
(void) define_variable ("MAKE_VERSION", 12, buf, o_default, 0);
|
||||||
|
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
/* Allow to specify a special shell just for Make,
|
||||||
|
and use $COMSPEC as the default $SHELL when appropriate. */
|
||||||
|
{
|
||||||
|
static char shell_str[] = "SHELL";
|
||||||
|
const int shlen = sizeof (shell_str) - 1;
|
||||||
|
struct variable *mshp = lookup_variable ("MAKESHELL", 9);
|
||||||
|
struct variable *comp = lookup_variable ("COMSPEC", 7);
|
||||||
|
|
||||||
|
/* Make $MAKESHELL override $SHELL even if -e is in effect. */
|
||||||
|
if (mshp)
|
||||||
|
(void) define_variable (shell_str, shlen,
|
||||||
|
mshp->value, o_env_override, 0);
|
||||||
|
else if (comp)
|
||||||
|
{
|
||||||
|
/* $COMSPEC shouldn't override $SHELL. */
|
||||||
|
struct variable *shp = lookup_variable (shell_str, shlen);
|
||||||
|
|
||||||
|
if (!shp)
|
||||||
|
(void) define_variable (shell_str, shlen, comp->value, o_env, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This won't override any definition, but it
|
/* This won't override any definition, but it
|
||||||
will provide one if there isn't one there. */
|
will provide one if there isn't one there. */
|
||||||
v = define_variable ("SHELL", 5, default_shell, o_default, 0);
|
v = define_variable ("SHELL", 5, default_shell, o_default, 0);
|
||||||
v->export = v_export; /* Always export SHELL. */
|
v->export = v_export; /* Always export SHELL. */
|
||||||
|
|
||||||
|
/* On MSDOS we do use SHELL from environment, since
|
||||||
|
it isn't a standard environment variable on MSDOS,
|
||||||
|
so whoever sets it, does that on purpose. */
|
||||||
|
#ifndef __MSDOS__
|
||||||
/* Don't let SHELL come from the environment. */
|
/* Don't let SHELL come from the environment. */
|
||||||
if (*v->value == '\0' || v->origin == o_env || v->origin == o_env_override)
|
if (*v->value == '\0' || v->origin == o_env || v->origin == o_env_override)
|
||||||
{
|
{
|
||||||
@@ -373,6 +411,7 @@ define_automatic_variables ()
|
|||||||
v->origin = o_file;
|
v->origin = o_file;
|
||||||
v->value = savestring (default_shell, strlen (default_shell));
|
v->value = savestring (default_shell, strlen (default_shell));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Make sure MAKEFILES gets exported if it is set. */
|
/* Make sure MAKEFILES gets exported if it is set. */
|
||||||
v = define_variable ("MAKEFILES", 9, "", o_default, 0);
|
v = define_variable ("MAKEFILES", 9, "", o_default, 0);
|
||||||
@@ -533,11 +572,25 @@ target_environment (file)
|
|||||||
&& v->origin != o_env && v->origin != o_env_override)
|
&& v->origin != o_env && v->origin != o_env_override)
|
||||||
{
|
{
|
||||||
char *value = recursively_expand (v);
|
char *value = recursively_expand (v);
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
if (strcmp(v->name, "Path") == 0 ||
|
||||||
|
strcmp(v->name, "PATH") == 0)
|
||||||
|
convert_Path_to_windows32(value, ';');
|
||||||
|
#endif
|
||||||
result[nvariables++] = concat (v->name, "=", value);
|
result[nvariables++] = concat (v->name, "=", value);
|
||||||
free (value);
|
free (value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
{
|
||||||
|
if (strcmp(v->name, "Path") == 0 ||
|
||||||
|
strcmp(v->name, "PATH") == 0)
|
||||||
|
convert_Path_to_windows32(v->value, ';');
|
||||||
|
result[nvariables++] = concat (v->name, "=", v->value);
|
||||||
|
}
|
||||||
|
#else
|
||||||
result[nvariables++] = concat (v->name, "=", v->value);
|
result[nvariables++] = concat (v->name, "=", v->value);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result[nvariables] = (char *) xmalloc (100);
|
result[nvariables] = (char *) xmalloc (100);
|
||||||
@@ -605,6 +658,34 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
flavor = append;
|
flavor = append;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else if (c == '$')
|
||||||
|
{
|
||||||
|
/* This might begin a variable expansion reference. Make sure we
|
||||||
|
don't misrecognize chars inside the reference as =, := or +=. */
|
||||||
|
char closeparen;
|
||||||
|
int count;
|
||||||
|
c = *p++;
|
||||||
|
if (c == '(')
|
||||||
|
closeparen = ')';
|
||||||
|
else if (c == '{')
|
||||||
|
closeparen = '}';
|
||||||
|
else
|
||||||
|
continue; /* Nope. */
|
||||||
|
|
||||||
|
/* P now points past the opening paren or brace.
|
||||||
|
Count parens or braces until it is matched. */
|
||||||
|
count = 0;
|
||||||
|
for (; *p != '\0'; ++p)
|
||||||
|
{
|
||||||
|
if (*p == c)
|
||||||
|
++count;
|
||||||
|
else if (*p == closeparen && --count < 0)
|
||||||
|
{
|
||||||
|
++p;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
beg = next_token (line);
|
beg = next_token (line);
|
||||||
@@ -679,6 +760,88 @@ try_variable_definition (filename, lineno, line, origin)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
/* Many Unix Makefiles include a line saying "SHELL=/bin/sh", but
|
||||||
|
non-Unix systems don't conform to this default configuration (in
|
||||||
|
fact, most of them don't even have `/bin'). On the other hand,
|
||||||
|
$SHELL in the environment, if set, points to the real pathname of
|
||||||
|
the shell.
|
||||||
|
Therefore, we generally won't let lines like "SHELL=/bin/sh" from
|
||||||
|
the Makefile override $SHELL from the environment. But first, we
|
||||||
|
look for the basename of the shell in the directory where SHELL=
|
||||||
|
points, and along the $PATH; if it is found in any of these places,
|
||||||
|
we define $SHELL to be the actual pathname of the shell. Thus, if
|
||||||
|
you have bash.exe installed as d:/unix/bash.exe, and d:/unix is on
|
||||||
|
your $PATH, then SHELL=/usr/local/bin/bash will have the effect of
|
||||||
|
defining SHELL to be "d:/unix/bash.exe". */
|
||||||
|
if (origin == o_file
|
||||||
|
&& strcmp (expanded_name, "SHELL") == 0)
|
||||||
|
{
|
||||||
|
char shellpath[PATH_MAX];
|
||||||
|
extern char * __dosexec_find_on_path (const char *, char *[], char *);
|
||||||
|
|
||||||
|
/* See if we can find "/bin/sh.exe", "/bin/sh.com", etc. */
|
||||||
|
if (__dosexec_find_on_path (value, (char **)0, shellpath))
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
for (p = shellpath; *p; p++)
|
||||||
|
{
|
||||||
|
if (*p == '\\')
|
||||||
|
*p = '/';
|
||||||
|
}
|
||||||
|
v = define_variable (expanded_name, strlen (expanded_name),
|
||||||
|
shellpath, origin, flavor == recursive);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
char *shellbase, *bslash;
|
||||||
|
struct variable *pathv = lookup_variable ("PATH", 4);
|
||||||
|
char *path_string;
|
||||||
|
char *fake_env[2];
|
||||||
|
size_t pathlen = 0;
|
||||||
|
|
||||||
|
shellbase = rindex (value, '/');
|
||||||
|
bslash = rindex (value, '\\');
|
||||||
|
if (!shellbase || bslash > shellbase)
|
||||||
|
shellbase = bslash;
|
||||||
|
if (!shellbase && value[1] == ':')
|
||||||
|
shellbase = value + 1;
|
||||||
|
if (shellbase)
|
||||||
|
shellbase++;
|
||||||
|
else
|
||||||
|
shellbase = value;
|
||||||
|
|
||||||
|
/* Search for the basename of the shell (with standard
|
||||||
|
executable extensions) along the $PATH. */
|
||||||
|
if (pathv)
|
||||||
|
pathlen = strlen (pathv->value);
|
||||||
|
path_string = (char *)xmalloc (5 + pathlen + 2 + 1);
|
||||||
|
/* On MSDOS, current directory is considered as part of $PATH. */
|
||||||
|
sprintf (path_string, "PATH=.;%s", pathv ? pathv->value : "");
|
||||||
|
fake_env[0] = path_string;
|
||||||
|
fake_env[1] = (char *)0;
|
||||||
|
if (__dosexec_find_on_path (shellbase, fake_env, shellpath))
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
for (p = shellpath; *p; p++)
|
||||||
|
{
|
||||||
|
if (*p == '\\')
|
||||||
|
*p = '/';
|
||||||
|
}
|
||||||
|
v = define_variable (expanded_name, strlen (expanded_name),
|
||||||
|
shellpath, origin, flavor == recursive);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
v = lookup_variable (expanded_name, strlen (expanded_name));
|
||||||
|
|
||||||
|
free (path_string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif /* __MSDOS__ */
|
||||||
|
|
||||||
v = define_variable (expanded_name, strlen (expanded_name),
|
v = define_variable (expanded_name, strlen (expanded_name),
|
||||||
value, origin, flavor == recursive);
|
value, origin, flavor == recursive);
|
||||||
|
|
||||||
@@ -795,6 +958,14 @@ print_variable_set (set, prefix)
|
|||||||
max %u in one bucket.\n",
|
max %u in one bucket.\n",
|
||||||
(double) nvariables / (double) set->buckets,
|
(double) nvariables / (double) set->buckets,
|
||||||
per_bucket);
|
per_bucket);
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
int f = (nvariables * 1000 + 5) / set->buckets;
|
||||||
|
printf ("# average of %d.%d variables per bucket, \
|
||||||
|
max %u in one bucket.\n",
|
||||||
|
f/10, f%10,
|
||||||
|
per_bucket);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -820,3 +991,30 @@ print_file_variables (file)
|
|||||||
if (file->variables != 0)
|
if (file->variables != 0)
|
||||||
print_variable_set (file->variables->set, "# ");
|
print_variable_set (file->variables->set, "# ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
void
|
||||||
|
sync_Path_environment(void)
|
||||||
|
{
|
||||||
|
char* path = allocated_variable_expand("$(Path)");
|
||||||
|
static char* environ_path = NULL;
|
||||||
|
|
||||||
|
if (!path)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If done this before, don't leak memory unnecessarily.
|
||||||
|
* Free the previous entry before allocating new one.
|
||||||
|
*/
|
||||||
|
if (environ_path)
|
||||||
|
free(environ_path);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Create something WINDOWS32 world can grok
|
||||||
|
*/
|
||||||
|
convert_Path_to_windows32(path, ';');
|
||||||
|
environ_path = concat("Path", "=", path);
|
||||||
|
putenv(environ_path);
|
||||||
|
free(path);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
49
variable.h
49
variable.h
@@ -70,31 +70,40 @@ struct variable_set_list
|
|||||||
|
|
||||||
extern struct variable_set_list *current_variable_set_list;
|
extern struct variable_set_list *current_variable_set_list;
|
||||||
|
|
||||||
|
/* expand.c */
|
||||||
extern void push_new_variable_scope (), pop_variable_scope ();
|
extern char *variable_buffer_output PARAMS ((char *ptr, char *string, unsigned int length));
|
||||||
|
extern char *variable_expand PARAMS ((char *line));
|
||||||
extern int handle_function ();
|
extern char *variable_expand_for_file PARAMS ((char *line, struct file *file));
|
||||||
|
extern char *allocated_variable_expand_for_file PARAMS ((char *line, struct file *file));
|
||||||
extern char *variable_buffer_output ();
|
|
||||||
extern char *variable_expand (), *variable_expand_for_file ();
|
|
||||||
extern char *allocated_variable_expand_for_file ();
|
|
||||||
#define allocated_variable_expand(line) \
|
#define allocated_variable_expand(line) \
|
||||||
allocated_variable_expand_for_file (line, (struct file *) 0)
|
allocated_variable_expand_for_file (line, (struct file *) 0)
|
||||||
extern char *expand_argument ();
|
extern char *expand_argument PARAMS ((char *str, char *end));
|
||||||
|
|
||||||
extern void define_automatic_variables ();
|
/* function.c */
|
||||||
extern void initialize_file_variables ();
|
extern int handle_function PARAMS ((char **op, char **stringp));
|
||||||
extern void print_file_variables ();
|
extern int pattern_matches PARAMS ((char *pattern, char *percent, char *word));
|
||||||
|
extern char *subst_expand PARAMS ((char *o, char *text, char *subst, char *replace,
|
||||||
|
unsigned int slen, unsigned int rlen, int by_word, int suffix_only));
|
||||||
|
extern char *patsubst_expand PARAMS ((char *o, char *text, char *pattern, char *replace,
|
||||||
|
char *pattern_percent, char *replace_percent));
|
||||||
|
|
||||||
extern void merge_variable_set_lists ();
|
/* expand.c */
|
||||||
|
extern char *recursively_expand PARAMS ((struct variable *v));
|
||||||
|
|
||||||
extern struct variable *try_variable_definition ();
|
/* variable.c */
|
||||||
|
extern void push_new_variable_scope PARAMS ((void));
|
||||||
|
extern void pop_variable_scope PARAMS ((void));
|
||||||
|
extern void define_automatic_variables PARAMS ((void));
|
||||||
|
extern void initialize_file_variables PARAMS ((struct file *file));
|
||||||
|
extern void print_file_variables PARAMS ((struct file *file));
|
||||||
|
extern void merge_variable_set_lists PARAMS ((struct variable_set_list **setlist0, struct variable_set_list *setlist1));
|
||||||
|
extern struct variable *try_variable_definition PARAMS ((char *filename, unsigned int lineno, char *line, enum variable_origin origin));
|
||||||
|
|
||||||
extern struct variable *lookup_variable (), *define_variable ();
|
extern struct variable *lookup_variable PARAMS ((char *name, unsigned int length));
|
||||||
extern struct variable *define_variable_for_file ();
|
extern struct variable *define_variable PARAMS ((char *name, unsigned int length, char *value,
|
||||||
|
enum variable_origin origin, int recursive));
|
||||||
|
extern struct variable *define_variable_for_file PARAMS ((char *name, unsigned int length,
|
||||||
|
char *value, enum variable_origin origin, int recursive, struct file *file));
|
||||||
|
extern char **target_environment PARAMS ((struct file *file));
|
||||||
|
|
||||||
extern int pattern_matches ();
|
|
||||||
extern char *subst_expand (), *patsubst_expand (), *recursively_expand ();
|
|
||||||
|
|
||||||
extern char **target_environment ();
|
|
||||||
extern int export_all_variables;
|
extern int export_all_variables;
|
||||||
|
|||||||
12
version.c
Normal file
12
version.c
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
/* We use <config.h> instead of "config.h" so that a compilation
|
||||||
|
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
|
||||||
|
(which it would do because make.h was found in $srcdir). */
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
char *version_string = VERSION;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Local variables:
|
||||||
|
version-control: never
|
||||||
|
End:
|
||||||
|
*/
|
||||||
42
vmsdir.h
Normal file
42
vmsdir.h
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/* dirent.h for vms */
|
||||||
|
|
||||||
|
#include <rms.h>
|
||||||
|
|
||||||
|
#define MAXNAMLEN 255
|
||||||
|
|
||||||
|
#ifndef __DECC
|
||||||
|
typedef unsigned long u_long;
|
||||||
|
typedef unsigned short u_short;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct direct {
|
||||||
|
off_t d_off;
|
||||||
|
u_long d_fileno;
|
||||||
|
u_short d_reclen;
|
||||||
|
u_short d_namlen;
|
||||||
|
char d_name[MAXNAMLEN + 1];
|
||||||
|
};
|
||||||
|
|
||||||
|
#undef DIRSIZ
|
||||||
|
#define DIRSIZ(dp) \
|
||||||
|
(((sizeof (struct direct) - (MAXNAMLEN+1) + ((dp)->d_namlen+1)) + 3) & ~3)
|
||||||
|
|
||||||
|
#define d_ino d_fileno /* compatability */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Definitions for library routines operating on directories.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef struct FAB DIR;
|
||||||
|
|
||||||
|
#ifndef NULL
|
||||||
|
#define NULL 0
|
||||||
|
#endif
|
||||||
|
extern DIR *opendir PARAMS (());
|
||||||
|
extern struct direct *readdir PARAMS ((DIR *dfd));
|
||||||
|
#define rewinddir(dirp) seekdir((dirp), (long)0)
|
||||||
|
extern int closedir PARAMS ((DIR *dfd));
|
||||||
|
extern char *vmsify PARAMS ((char *name, int type));
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
235
vmsfunctions.c
Normal file
235
vmsfunctions.c
Normal file
@@ -0,0 +1,235 @@
|
|||||||
|
#define KDEBUG 0
|
||||||
|
/* vmsfunctions.c */
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "make.h"
|
||||||
|
#ifdef __DECC
|
||||||
|
#include <starlet.h>
|
||||||
|
#endif
|
||||||
|
#include <descrip.h>
|
||||||
|
#include <rms.h>
|
||||||
|
#include <iodef.h>
|
||||||
|
#include <atrdef.h>
|
||||||
|
#include <fibdef.h>
|
||||||
|
#include "vmsdir.h"
|
||||||
|
|
||||||
|
DIR *opendir(char *dspec)
|
||||||
|
{
|
||||||
|
static struct FAB *dfab;
|
||||||
|
struct NAM *dnam;
|
||||||
|
char *searchspec;
|
||||||
|
|
||||||
|
if ((dfab = (struct FAB *)xmalloc(sizeof (struct FAB))) == NULL) {
|
||||||
|
printf("Error mallocing for FAB\n");
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
|
if ((dnam = (struct NAM *)xmalloc(sizeof (struct NAM))) == NULL) {
|
||||||
|
printf("Error mallocing for NAM\n");
|
||||||
|
free(dfab);
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
|
if ((searchspec = (char *)xmalloc(MAXNAMLEN+1)) == NULL) {
|
||||||
|
printf("Error mallocing for searchspec\n");
|
||||||
|
free(dfab);
|
||||||
|
free(dnam);
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
sprintf(searchspec,"%s*.*;",dspec);
|
||||||
|
|
||||||
|
*dfab = cc$rms_fab;
|
||||||
|
dfab->fab$l_fna = searchspec;
|
||||||
|
dfab->fab$b_fns = strlen(searchspec);
|
||||||
|
dfab->fab$l_nam = dnam;
|
||||||
|
|
||||||
|
*dnam = cc$rms_nam;
|
||||||
|
dnam->nam$l_esa = searchspec;
|
||||||
|
dnam->nam$b_ess = MAXNAMLEN;
|
||||||
|
|
||||||
|
if (!(sys$parse(dfab) & 1)) {
|
||||||
|
free(dfab);
|
||||||
|
free(dnam);
|
||||||
|
free(searchspec);
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
return(dfab);
|
||||||
|
}
|
||||||
|
|
||||||
|
#include <ctype.h>
|
||||||
|
#define uppercasify(str) { char *tmp; for(tmp = (str); *tmp != '\0'; tmp++) if(islower(*tmp)) *tmp = toupper(*tmp); }
|
||||||
|
|
||||||
|
struct direct *readdir(DIR *dfd)
|
||||||
|
{
|
||||||
|
static struct direct *dentry;
|
||||||
|
static char resultspec[MAXNAMLEN+1];
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if ((dentry = (struct direct *)xmalloc(sizeof (struct direct))) == NULL) {
|
||||||
|
printf("Error mallocing for direct\n");
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
dfd->fab$l_nam->nam$l_rsa = resultspec;
|
||||||
|
dfd->fab$l_nam->nam$b_rss = MAXNAMLEN;
|
||||||
|
|
||||||
|
if (debug_flag)
|
||||||
|
printf(".");
|
||||||
|
|
||||||
|
if (!((i = sys$search(dfd)) & 1)) {
|
||||||
|
if (debug_flag)
|
||||||
|
printf("sys$search failed with %d\n", i);
|
||||||
|
free(dentry);
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
dentry->d_off = 0;
|
||||||
|
if (dfd->fab$l_nam->nam$w_fid == 0)
|
||||||
|
dentry->d_fileno = 1;
|
||||||
|
else dentry->d_fileno = dfd->fab$l_nam->nam$w_fid[0]
|
||||||
|
+dfd->fab$l_nam->nam$w_fid[1]<<16;
|
||||||
|
dentry->d_reclen = sizeof (struct direct);
|
||||||
|
/*
|
||||||
|
if (!strcmp(dfd->fab$l_nam->nam$l_type,".DIR"))
|
||||||
|
dentry->d_namlen = dfd->fab$l_nam->nam$b_name;
|
||||||
|
else
|
||||||
|
*/
|
||||||
|
dentry->d_namlen = dfd->fab$l_nam->nam$b_name+dfd->fab$l_nam->nam$b_type;
|
||||||
|
strncpy(dentry->d_name,dfd->fab$l_nam->nam$l_name,dentry->d_namlen);
|
||||||
|
dentry->d_name[dentry->d_namlen] = '\0';
|
||||||
|
uppercasify(dentry->d_name);
|
||||||
|
/* uvUnFixRCSSeparator(dentry->d_name);*/
|
||||||
|
|
||||||
|
return(dentry);
|
||||||
|
}
|
||||||
|
|
||||||
|
closedir(DIR *dfd)
|
||||||
|
{
|
||||||
|
if (dfd != NULL) {
|
||||||
|
if (dfd->fab$l_nam != NULL)
|
||||||
|
free(dfd->fab$l_nam->nam$l_esa);
|
||||||
|
free(dfd->fab$l_nam);
|
||||||
|
free(dfd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
char *getwd(char *cwd)
|
||||||
|
{
|
||||||
|
static char buf[512];
|
||||||
|
|
||||||
|
if (cwd)
|
||||||
|
return(getcwd(cwd,512));
|
||||||
|
else
|
||||||
|
return(getcwd(buf,512));
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
vms_stat (name, buf)
|
||||||
|
char *name;
|
||||||
|
struct stat *buf;
|
||||||
|
{
|
||||||
|
int status;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
static struct FAB Fab;
|
||||||
|
static struct NAM Nam;
|
||||||
|
static struct fibdef Fib; /* short fib */
|
||||||
|
static struct dsc$descriptor FibDesc =
|
||||||
|
{sizeof(Fib), DSC$K_DTYPE_Z, DSC$K_CLASS_S, (char *)&Fib};
|
||||||
|
static struct dsc$descriptor_s DevDesc =
|
||||||
|
{0, DSC$K_DTYPE_T, DSC$K_CLASS_S, &Nam.nam$t_dvi[1]};
|
||||||
|
static char EName[NAM$C_MAXRSS];
|
||||||
|
static char RName[NAM$C_MAXRSS];
|
||||||
|
static struct dsc$descriptor_s FileName =
|
||||||
|
{0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
|
||||||
|
static struct dsc$descriptor_s string =
|
||||||
|
{0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
|
||||||
|
static unsigned long Rdate[2];
|
||||||
|
static unsigned long Cdate[2];
|
||||||
|
static struct atrdef Atr[] = {
|
||||||
|
{sizeof(Rdate),ATR$C_REVDATE,&Rdate[0]}, /* Revision date */
|
||||||
|
{sizeof(Cdate),ATR$C_CREDATE,&Cdate[0]}, /* Creation date */
|
||||||
|
{0,0,0}
|
||||||
|
};
|
||||||
|
static short int DevChan;
|
||||||
|
static short int iosb[4];
|
||||||
|
|
||||||
|
name = vmsify (name, 0);
|
||||||
|
|
||||||
|
/* initialize RMS structures, we need a NAM to retrieve the FID */
|
||||||
|
Fab = cc$rms_fab;
|
||||||
|
Fab.fab$l_fna = name ; /* name of file */
|
||||||
|
Fab.fab$b_fns = strlen(name);
|
||||||
|
Fab.fab$l_nam = &Nam; /* FAB has an associated NAM */
|
||||||
|
|
||||||
|
Nam = cc$rms_nam;
|
||||||
|
Nam.nam$l_esa = EName; /* expanded filename */
|
||||||
|
Nam.nam$b_ess = sizeof(EName);
|
||||||
|
Nam.nam$l_rsa = RName; /* resultant filename */
|
||||||
|
Nam.nam$b_rss = sizeof(RName);
|
||||||
|
|
||||||
|
/* do $PARSE and $SEARCH here */
|
||||||
|
status = sys$parse(&Fab);
|
||||||
|
if (!(status & 1))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
DevDesc.dsc$w_length = Nam.nam$t_dvi[0];
|
||||||
|
status = sys$assign(&DevDesc,&DevChan,0,0);
|
||||||
|
if (!(status & 1))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
FileName.dsc$a_pointer = Nam.nam$l_name;
|
||||||
|
FileName.dsc$w_length = Nam.nam$b_name+Nam.nam$b_type+Nam.nam$b_ver;
|
||||||
|
|
||||||
|
/* Initialize the FIB */
|
||||||
|
for (i=0;i<3;i++)
|
||||||
|
{
|
||||||
|
#if __DECC
|
||||||
|
Fib.fib$w_fid[i]=Nam.nam$w_fid[i];
|
||||||
|
Fib.fib$w_did[i]=Nam.nam$w_did[i];
|
||||||
|
#else
|
||||||
|
Fib.fib$r_fid_overlay.fib$w_fid[i]=Nam.nam$w_fid[i];
|
||||||
|
Fib.fib$r_did_overlay.fib$w_did[i]=Nam.nam$w_did[i];
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
status = sys$qiow(0,DevChan,IO$_ACCESS,&iosb,0,0,
|
||||||
|
&FibDesc,&FileName,0,0,&Atr,0);
|
||||||
|
sys$dassgn (DevChan);
|
||||||
|
if (!(status & 1))
|
||||||
|
return -1;
|
||||||
|
status = iosb[0];
|
||||||
|
if (!(status & 1))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
status = stat (name, buf);
|
||||||
|
if (status)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
buf->st_mtime = ((Rdate[0]>>24) & 0xff) + ((Rdate[1]<<8) & 0xffffff00);
|
||||||
|
buf->st_ctime = ((Cdate[0]>>24) & 0xff) + ((Cdate[1]<<8) & 0xffffff00);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
cvt_time(tval)
|
||||||
|
unsigned long tval;
|
||||||
|
{
|
||||||
|
static long int date[2];
|
||||||
|
static char str[27];
|
||||||
|
static struct dsc$descriptor date_str =
|
||||||
|
{26, DSC$K_DTYPE_T, DSC$K_CLASS_S, str};
|
||||||
|
|
||||||
|
date[0] = (tval & 0xff) << 24;
|
||||||
|
date[1] = ((tval>>8) & 0xffffff);
|
||||||
|
|
||||||
|
if ((date[0]==0) && (date[1]==0))
|
||||||
|
return("never");
|
||||||
|
|
||||||
|
sys$asctim(0,&date_str,date,0);
|
||||||
|
str[26]='\0';
|
||||||
|
|
||||||
|
return(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
927
vmsify.c
Normal file
927
vmsify.c
Normal file
@@ -0,0 +1,927 @@
|
|||||||
|
/*
|
||||||
|
vmsify.c
|
||||||
|
|
||||||
|
Module for vms <-> unix file name conversion
|
||||||
|
|
||||||
|
Written by Klaus Kämpf (kkaempf@progis.de)
|
||||||
|
of proGIS Software, Aachen, Germany
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#if VMS
|
||||||
|
#include <unixlib.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <jpidef.h>
|
||||||
|
#include <descrip.h>
|
||||||
|
#include <uaidef.h>
|
||||||
|
#include <ssdef.h>
|
||||||
|
#include <starlet.h>
|
||||||
|
#include <lib$routines.h>
|
||||||
|
/* Initialize a string descriptor (struct dsc$descriptor_s) for an
|
||||||
|
arbitrary string. ADDR is a pointer to the first character
|
||||||
|
of the string, and LEN is the length of the string. */
|
||||||
|
|
||||||
|
#define INIT_DSC_S(dsc, addr, len) do { \
|
||||||
|
(dsc).dsc$b_dtype = DSC$K_DTYPE_T; \
|
||||||
|
(dsc).dsc$b_class = DSC$K_CLASS_S; \
|
||||||
|
(dsc).dsc$w_length = (len); \
|
||||||
|
(dsc).dsc$a_pointer = (addr); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
/* Initialize a string descriptor (struct dsc$descriptor_s) for a
|
||||||
|
NUL-terminated string. S is a pointer to the string; the length
|
||||||
|
is determined by calling strlen(). */
|
||||||
|
|
||||||
|
#define INIT_DSC_CSTRING(dsc, s) INIT_DSC_S(dsc, s, strlen(s))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
copy 'from' to 'to' up to but not including 'upto'
|
||||||
|
return 0 if eos on from
|
||||||
|
return 1 if upto found
|
||||||
|
|
||||||
|
return 'to' at last char + 1
|
||||||
|
return 'from' at match + 1 or eos if no match
|
||||||
|
|
||||||
|
if as_dir == 1, change all '.' to '_'
|
||||||
|
else change all '.' but the last to '_'
|
||||||
|
*/
|
||||||
|
|
||||||
|
static int
|
||||||
|
copyto (char **to, char **from, char upto, int as_dir)
|
||||||
|
{
|
||||||
|
char *s;
|
||||||
|
|
||||||
|
s = strrchr (*from, '.');
|
||||||
|
|
||||||
|
while (**from)
|
||||||
|
{
|
||||||
|
if (**from == upto)
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
(*from)++;
|
||||||
|
}
|
||||||
|
while (**from == upto);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (**from == '.')
|
||||||
|
{
|
||||||
|
if ((as_dir == 1)
|
||||||
|
|| (*from != s))
|
||||||
|
**to = '_';
|
||||||
|
else
|
||||||
|
**to = '.';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (islower (**from))
|
||||||
|
**to = toupper (**from);
|
||||||
|
else
|
||||||
|
**to = **from;
|
||||||
|
}
|
||||||
|
(*to)++;
|
||||||
|
(*from)++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
get translation of logical name
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
static char *
|
||||||
|
trnlog (char *name)
|
||||||
|
{
|
||||||
|
int stat;
|
||||||
|
static char reslt[1024];
|
||||||
|
$DESCRIPTOR (reslt_dsc, reslt);
|
||||||
|
short resltlen;
|
||||||
|
struct dsc$descriptor_s name_dsc;
|
||||||
|
char *s;
|
||||||
|
|
||||||
|
INIT_DSC_CSTRING (name_dsc, name);
|
||||||
|
|
||||||
|
stat = lib$sys_trnlog (&name_dsc, &resltlen, &reslt_dsc);
|
||||||
|
|
||||||
|
if ((stat&1) == 0)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (stat == SS$_NOTRAN)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
reslt[resltlen] = '\0';
|
||||||
|
|
||||||
|
s = (char *)malloc (resltlen+1);
|
||||||
|
if (s == 0)
|
||||||
|
return "";
|
||||||
|
strcpy (s, reslt);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum namestate { N_START, N_DEVICE, N_OPEN, N_DOT, N_CLOSED, N_DONE };
|
||||||
|
|
||||||
|
/*
|
||||||
|
convert unix style name to vms style
|
||||||
|
type = 0 -> name is a full name (directory and filename part)
|
||||||
|
type = 1 -> name is a directory
|
||||||
|
type = 2 -> name is a filename without directory
|
||||||
|
|
||||||
|
The following conversions are applied
|
||||||
|
(0) (1) (2)
|
||||||
|
input full name dir name file name
|
||||||
|
|
||||||
|
1 ./ <cwd> [] <current directory>.dir
|
||||||
|
2 ../ <home of cwd> <home of cwd> <home of cwd>.dir
|
||||||
|
|
||||||
|
3 // <dev of cwd>: <dev of cwd>:[000000] <dev of cwd>:000000.dir
|
||||||
|
4 //a a: a: a:
|
||||||
|
5 //a/ a: a: a:000000.dir
|
||||||
|
|
||||||
|
9 / [000000] [000000] 000000.dir
|
||||||
|
10 /a [000000]a [a] [000000]a
|
||||||
|
11 /a/ [a] [a] [000000]a.dir
|
||||||
|
12 /a/b [a]b [a.b] [a]b
|
||||||
|
13 /a/b/ [a.b] [a.b] [a]b.dir
|
||||||
|
14 /a/b/c [a.b]c [a.b.c] [a.b]c
|
||||||
|
15 /a/b/c/ [a.b.c] [a.b.c] [a.b]c.dir
|
||||||
|
|
||||||
|
16 a a [.a] a
|
||||||
|
17 a/ [.a] [.a] a.dir
|
||||||
|
18 a/b [.a]b [.a.b] [.a]b
|
||||||
|
19 a/b/ [.a.b] [.a.b] [.a]b.dir
|
||||||
|
20 a/b/c [.a.b]c [.a.b.c] [.a.b]c
|
||||||
|
21 a/b/c/ [.a.b.c] [.a.b.c] [.a.b]c.dir
|
||||||
|
|
||||||
|
22 a.b.c a_b.c [.a_b_c] a_b_c.dir
|
||||||
|
|
||||||
|
23 [x][y]z [x.y]z [x.y]z [x.y]z
|
||||||
|
24 [x][.y]z [x.y]z [x.y]z [x.y]z
|
||||||
|
|
||||||
|
25 filenames with '$' are left unchanged if they contain no '/'
|
||||||
|
25 filenames with ':' are left unchanged
|
||||||
|
26 filenames with a single pair of '[' ']' are left unchanged
|
||||||
|
|
||||||
|
the input string is not written to
|
||||||
|
*/
|
||||||
|
|
||||||
|
char *
|
||||||
|
vmsify (name, type)
|
||||||
|
char *name;
|
||||||
|
int type;
|
||||||
|
{
|
||||||
|
/* max 255 device
|
||||||
|
max 39 directory
|
||||||
|
max 39 filename
|
||||||
|
max 39 filetype
|
||||||
|
max 5 version
|
||||||
|
*/
|
||||||
|
#define MAXPATHLEN 512
|
||||||
|
|
||||||
|
enum namestate nstate;
|
||||||
|
static char vmsname[MAXPATHLEN+1];
|
||||||
|
char *fptr;
|
||||||
|
char *vptr;
|
||||||
|
char *s,*s1;
|
||||||
|
int as_dir;
|
||||||
|
int count;
|
||||||
|
|
||||||
|
if (name == 0)
|
||||||
|
return 0;
|
||||||
|
fptr = name;
|
||||||
|
vptr = vmsname;
|
||||||
|
nstate = N_START;
|
||||||
|
|
||||||
|
/* case 25a */
|
||||||
|
|
||||||
|
s = strpbrk (name, "$:");
|
||||||
|
if (s != 0)
|
||||||
|
{
|
||||||
|
if (*s == '$')
|
||||||
|
{
|
||||||
|
if (strchr (name, '/') == 0)
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* case 26 */
|
||||||
|
|
||||||
|
s = strchr (name, '[');
|
||||||
|
|
||||||
|
if (s != 0)
|
||||||
|
{
|
||||||
|
s1 = strchr (s+1, '[');
|
||||||
|
if (s1 == 0)
|
||||||
|
{
|
||||||
|
return name; /* single [, keep unchanged */
|
||||||
|
}
|
||||||
|
s1--;
|
||||||
|
if (*s1 != ']')
|
||||||
|
{
|
||||||
|
return name; /* not ][, keep unchanged */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* we have ][ */
|
||||||
|
|
||||||
|
s = name;
|
||||||
|
|
||||||
|
/* s -> starting char
|
||||||
|
s1 -> ending ']' */
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
strncpy (vptr, s, s1-s); /* copy up to but not including ']' */
|
||||||
|
vptr += s1-s;
|
||||||
|
if (*s1 == 0)
|
||||||
|
break;
|
||||||
|
s = s1 + 1; /* s -> char behind ']' */
|
||||||
|
if (*s != '[') /* was '][' ? */
|
||||||
|
break; /* no, last ] found, exit */
|
||||||
|
s++;
|
||||||
|
if (*s != '.')
|
||||||
|
*vptr++ = '.';
|
||||||
|
s1 = strchr (s, ']');
|
||||||
|
if (s1 == 0) /* no closing ] */
|
||||||
|
s1 = s + strlen (s);
|
||||||
|
}
|
||||||
|
while (1);
|
||||||
|
|
||||||
|
*vptr++ = ']';
|
||||||
|
|
||||||
|
fptr = s;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
else /* no [ in name */
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
int state;
|
||||||
|
int rooted = 1; /* flag if logical is rooted, else insert [000000] */
|
||||||
|
|
||||||
|
state = 0;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case 0: /* start of loop */
|
||||||
|
if (*fptr == '/')
|
||||||
|
{
|
||||||
|
fptr++;
|
||||||
|
state = 1;
|
||||||
|
}
|
||||||
|
else if (*fptr == '.')
|
||||||
|
{
|
||||||
|
fptr++;
|
||||||
|
state = 10;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
state = 2;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1: /* '/' at start */
|
||||||
|
if (*fptr == '/')
|
||||||
|
{
|
||||||
|
fptr++;
|
||||||
|
state = 3;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
state = 4;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2: /* no '/' at start */
|
||||||
|
s = strchr (fptr, '/');
|
||||||
|
if (s == 0) /* no '/' (16) */
|
||||||
|
{
|
||||||
|
if (type == 1)
|
||||||
|
{
|
||||||
|
strcpy (vptr, "[.");
|
||||||
|
vptr += 2;
|
||||||
|
}
|
||||||
|
copyto (&vptr, &fptr, 0, (type==1));
|
||||||
|
if (type == 1)
|
||||||
|
*vptr++ = ']';
|
||||||
|
state = -1;
|
||||||
|
}
|
||||||
|
else /* found '/' (17..21) */
|
||||||
|
{
|
||||||
|
if ((type == 2)
|
||||||
|
&& (*(s+1) == 0)) /* 17(2) */
|
||||||
|
{
|
||||||
|
copyto (&vptr, &fptr, '/', 1);
|
||||||
|
state = 7;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strcpy (vptr, "[.");
|
||||||
|
vptr += 2;
|
||||||
|
copyto (&vptr, &fptr, '/', 1);
|
||||||
|
nstate = N_OPEN;
|
||||||
|
state = 9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3: /* '//' at start */
|
||||||
|
while (*fptr == '/') /* collapse all '/' */
|
||||||
|
fptr++;
|
||||||
|
if (*fptr == 0) /* just // */
|
||||||
|
{
|
||||||
|
char cwdbuf[MAXPATHLEN+1];
|
||||||
|
|
||||||
|
s1 = getcwd(cwdbuf, MAXPATHLEN);
|
||||||
|
if (s1 == 0)
|
||||||
|
{
|
||||||
|
return ""; /* FIXME, err getcwd */
|
||||||
|
}
|
||||||
|
s = strchr (s1, ':');
|
||||||
|
if (s == 0)
|
||||||
|
{
|
||||||
|
return ""; /* FIXME, err no device */
|
||||||
|
}
|
||||||
|
strncpy (vptr, s1, s-s1+1);
|
||||||
|
vptr += s-s1+1;
|
||||||
|
state = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
s = vptr;
|
||||||
|
|
||||||
|
if (copyto (&vptr, &fptr, '/', 1) == 0) /* copy device part */
|
||||||
|
{
|
||||||
|
*vptr++ = ':';
|
||||||
|
state = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
*vptr = ':';
|
||||||
|
nstate = N_DEVICE;
|
||||||
|
if (*fptr == 0) /* just '//a/' */
|
||||||
|
{
|
||||||
|
strcpy (vptr+1, "[000000]");
|
||||||
|
vptr += 9;
|
||||||
|
state = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
*vptr = 0;
|
||||||
|
/* check logical for [000000] insertion */
|
||||||
|
s1 = trnlog (s);
|
||||||
|
if (*s1 != 0)
|
||||||
|
{ /* found translation */
|
||||||
|
char *s2;
|
||||||
|
for (;;) /* loop over all nested logicals */
|
||||||
|
{
|
||||||
|
s2 = s1 + strlen (s1) - 1;
|
||||||
|
if (*s2 == ':') /* translation ends in ':' */
|
||||||
|
{
|
||||||
|
s2 = trnlog (s1);
|
||||||
|
free (s1);
|
||||||
|
if (*s2 == 0)
|
||||||
|
{
|
||||||
|
rooted = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
s1 = s2;
|
||||||
|
continue; /* next iteration */
|
||||||
|
}
|
||||||
|
if (*s2 == ']') /* translation ends in ']' */
|
||||||
|
{
|
||||||
|
if (*(s2-1) == '.') /* ends in '.]' */
|
||||||
|
{
|
||||||
|
if (strncmp (fptr, "000000", 6) != 0)
|
||||||
|
rooted = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strcpy (vmsname, s1);
|
||||||
|
s = strchr (vmsname, ']');
|
||||||
|
*s = '.';
|
||||||
|
nstate = N_DOT;
|
||||||
|
vptr = s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
free (s1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
rooted = 0;
|
||||||
|
|
||||||
|
if (*vptr == 0)
|
||||||
|
{
|
||||||
|
nstate = N_DEVICE;
|
||||||
|
*vptr++ = ':';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
vptr++;
|
||||||
|
|
||||||
|
if (rooted == 0)
|
||||||
|
{
|
||||||
|
strcpy (vptr, "[000000.");
|
||||||
|
vptr += 8;
|
||||||
|
s1 = vptr-1;
|
||||||
|
nstate = N_DOT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
s1 = 0;
|
||||||
|
|
||||||
|
/* s1-> '.' after 000000 or NULL */
|
||||||
|
|
||||||
|
s = strchr (fptr, '/');
|
||||||
|
if (s == 0)
|
||||||
|
{ /* no next '/' */
|
||||||
|
if (*(vptr-1) == '.')
|
||||||
|
*(vptr-1) = ']';
|
||||||
|
else if (rooted == 0)
|
||||||
|
*vptr++ = ']';
|
||||||
|
copyto (&vptr, &fptr, 0, (type == 1));
|
||||||
|
state = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (*(s+1) == '/') /* skip multiple '/' */
|
||||||
|
s++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((rooted != 0)
|
||||||
|
&& (*(vptr-1) != '.'))
|
||||||
|
{
|
||||||
|
*vptr++ = '[';
|
||||||
|
nstate = N_DOT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if ((nstate == N_DOT)
|
||||||
|
&& (s1 != 0)
|
||||||
|
&& (*(s+1) == 0))
|
||||||
|
{
|
||||||
|
if (type == 2)
|
||||||
|
{
|
||||||
|
*s1 = ']';
|
||||||
|
nstate = N_CLOSED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
state = 9;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 4: /* single '/' at start (9..15) */
|
||||||
|
if (*fptr == 0)
|
||||||
|
state = 5;
|
||||||
|
else
|
||||||
|
state = 6;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 5: /* just '/' at start (9) */
|
||||||
|
if (type != 2)
|
||||||
|
{
|
||||||
|
*vptr++ = '[';
|
||||||
|
nstate = N_OPEN;
|
||||||
|
}
|
||||||
|
strcpy (vptr, "000000");
|
||||||
|
vptr += 6;
|
||||||
|
if (type == 2)
|
||||||
|
state = 7;
|
||||||
|
else
|
||||||
|
state = 8;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 6: /* chars following '/' at start 10..15 */
|
||||||
|
*vptr++ = '[';
|
||||||
|
nstate = N_OPEN;
|
||||||
|
s = strchr (fptr, '/');
|
||||||
|
if (s == 0) /* 10 */
|
||||||
|
{
|
||||||
|
if (type != 1)
|
||||||
|
{
|
||||||
|
strcpy (vptr, "000000]");
|
||||||
|
vptr += 7;
|
||||||
|
}
|
||||||
|
copyto (&vptr, &fptr, 0, (type == 1));
|
||||||
|
if (type == 1)
|
||||||
|
{
|
||||||
|
*vptr++ = ']';
|
||||||
|
}
|
||||||
|
state = -1;
|
||||||
|
}
|
||||||
|
else /* 11..15 */
|
||||||
|
{
|
||||||
|
if ( (type == 2)
|
||||||
|
&& (*(s+1) == 0)) /* 11(2) */
|
||||||
|
{
|
||||||
|
strcpy (vptr, "000000]");
|
||||||
|
nstate = N_CLOSED;
|
||||||
|
vptr += 7;
|
||||||
|
}
|
||||||
|
copyto (&vptr, &fptr, '/', (*(vptr-1) != ']'));
|
||||||
|
state = 9;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 7: /* add '.dir' and exit */
|
||||||
|
if ((nstate == N_OPEN)
|
||||||
|
|| (nstate == N_DOT))
|
||||||
|
{
|
||||||
|
s = vptr-1;
|
||||||
|
while (s > vmsname)
|
||||||
|
{
|
||||||
|
if (*s == ']')
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (*s == '.')
|
||||||
|
{
|
||||||
|
*s = ']';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
s--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
strcpy (vptr, ".dir");
|
||||||
|
vptr += 4;
|
||||||
|
state = -1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 8: /* add ']' and exit */
|
||||||
|
*vptr++ = ']';
|
||||||
|
state = -1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 9: /* 17..21, fptr -> 1st '/' + 1 */
|
||||||
|
if (*fptr == 0)
|
||||||
|
{
|
||||||
|
if (type == 2)
|
||||||
|
{
|
||||||
|
state = 7;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
state = 8;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
s = strchr (fptr, '/');
|
||||||
|
if (s == 0)
|
||||||
|
{
|
||||||
|
if (type != 1)
|
||||||
|
{
|
||||||
|
if (nstate == N_OPEN)
|
||||||
|
{
|
||||||
|
*vptr++ = ']';
|
||||||
|
nstate = N_CLOSED;
|
||||||
|
}
|
||||||
|
as_dir = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (nstate == N_OPEN)
|
||||||
|
{
|
||||||
|
*vptr++ = '.';
|
||||||
|
nstate = N_DOT;
|
||||||
|
}
|
||||||
|
as_dir = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while (*(s+1) == '/')
|
||||||
|
s++;
|
||||||
|
if ( (type == 2)
|
||||||
|
&& (*(s+1) == 0)) /* 19(2), 21(2)*/
|
||||||
|
{
|
||||||
|
if (nstate != N_CLOSED)
|
||||||
|
{
|
||||||
|
*vptr++ = ']';
|
||||||
|
nstate = N_CLOSED;
|
||||||
|
}
|
||||||
|
as_dir = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (nstate == N_OPEN)
|
||||||
|
{
|
||||||
|
*vptr++ = '.';
|
||||||
|
nstate = N_DOT;
|
||||||
|
}
|
||||||
|
as_dir = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( (*fptr == '.') /* check for '..' or '../' */
|
||||||
|
&& (*(fptr+1) == '.')
|
||||||
|
&& ((*(fptr+2) == '/')
|
||||||
|
|| (*(fptr+2) == 0)) )
|
||||||
|
{
|
||||||
|
fptr += 2;
|
||||||
|
if (*fptr == '/')
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
fptr++;
|
||||||
|
}
|
||||||
|
while (*fptr == '/');
|
||||||
|
}
|
||||||
|
else if (*fptr == 0)
|
||||||
|
type = 1;
|
||||||
|
vptr--; /* vptr -> '.' or ']' */
|
||||||
|
s1 = vptr;
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
s1--;
|
||||||
|
if (*s1 == '.') /* one back */
|
||||||
|
{
|
||||||
|
vptr = s1;
|
||||||
|
nstate = N_OPEN;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (*s1 == '[') /* top level reached */
|
||||||
|
{
|
||||||
|
if (*fptr == 0)
|
||||||
|
{
|
||||||
|
strcpy (s1, "[000000]");
|
||||||
|
vptr = s1 + 8;
|
||||||
|
nstate = N_CLOSED;
|
||||||
|
s = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vptr = s1+1;
|
||||||
|
nstate = N_OPEN;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
copyto (&vptr, &fptr, '/', as_dir);
|
||||||
|
if (nstate == N_DOT)
|
||||||
|
nstate = N_OPEN;
|
||||||
|
}
|
||||||
|
if (s == 0)
|
||||||
|
{ /* 18,20 */
|
||||||
|
if (type == 1)
|
||||||
|
*vptr++ = ']';
|
||||||
|
state = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (*(s+1) == 0)
|
||||||
|
{
|
||||||
|
if (type == 2) /* 19,21 */
|
||||||
|
{
|
||||||
|
state = 7;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*vptr++ = ']';
|
||||||
|
state = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 10: /* 1,2 first is '.' */
|
||||||
|
if (*fptr == '.')
|
||||||
|
{
|
||||||
|
fptr++;
|
||||||
|
state = 11;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
state = 12;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 11: /* 2, '..' at start */
|
||||||
|
count = 1;
|
||||||
|
if (*fptr != 0)
|
||||||
|
{
|
||||||
|
if (*fptr != '/') /* got ..xxx */
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
do /* got ../ */
|
||||||
|
{
|
||||||
|
fptr++;
|
||||||
|
while (*fptr == '/') fptr++;
|
||||||
|
if (*fptr != '.')
|
||||||
|
break;
|
||||||
|
if (*(fptr+1) != '.')
|
||||||
|
break;
|
||||||
|
fptr += 2;
|
||||||
|
if ((*fptr == 0)
|
||||||
|
|| (*fptr == '/'))
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
while (*fptr == '/');
|
||||||
|
}
|
||||||
|
{ /* got '..' or '../' */
|
||||||
|
char cwdbuf[MAXPATHLEN+1];
|
||||||
|
|
||||||
|
s1 = getcwd(cwdbuf, MAXPATHLEN);
|
||||||
|
if (s1 == 0)
|
||||||
|
{
|
||||||
|
return ""; /* FIXME, err getcwd */
|
||||||
|
}
|
||||||
|
strcpy (vptr, s1);
|
||||||
|
s = strchr (vptr, ']');
|
||||||
|
if (s != 0)
|
||||||
|
{
|
||||||
|
nstate = N_OPEN;
|
||||||
|
while (s > vptr)
|
||||||
|
{
|
||||||
|
s--;
|
||||||
|
if (*s == '[')
|
||||||
|
{
|
||||||
|
s++;
|
||||||
|
strcpy (s, "000000]");
|
||||||
|
state = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (*s == '.')
|
||||||
|
{
|
||||||
|
if (--count == 0)
|
||||||
|
{
|
||||||
|
if (*fptr == 0) /* had '..' or '../' */
|
||||||
|
{
|
||||||
|
*s++ = ']';
|
||||||
|
state = -1;
|
||||||
|
}
|
||||||
|
else /* had '../xxx' */
|
||||||
|
{
|
||||||
|
state = 9;
|
||||||
|
}
|
||||||
|
*s = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vptr += strlen (vptr);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 12: /* 1, '.' at start */
|
||||||
|
if (*fptr != 0)
|
||||||
|
{
|
||||||
|
if (*fptr != '/')
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
fptr++;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
char cwdbuf[MAXPATHLEN+1];
|
||||||
|
|
||||||
|
s1 = getcwd(cwdbuf, MAXPATHLEN);
|
||||||
|
if (s1 == 0)
|
||||||
|
{
|
||||||
|
return ""; /*FIXME, err getcwd */
|
||||||
|
}
|
||||||
|
strcpy (vptr, s1);
|
||||||
|
if (*fptr == 0)
|
||||||
|
{
|
||||||
|
state = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s = strchr (vptr, ']');
|
||||||
|
if (s == 0)
|
||||||
|
{
|
||||||
|
state = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
*s = 0;
|
||||||
|
nstate = N_OPEN;
|
||||||
|
vptr += strlen (vptr);
|
||||||
|
state = 9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
while (state > 0);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* directory conversion done
|
||||||
|
fptr -> filename part of input string
|
||||||
|
vptr -> free space in vmsname
|
||||||
|
*/
|
||||||
|
|
||||||
|
*vptr++ = 0;
|
||||||
|
|
||||||
|
return vmsname;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
convert from vms-style to unix-style
|
||||||
|
|
||||||
|
dev:[dir1.dir2] //dev/dir1/dir2/
|
||||||
|
*/
|
||||||
|
|
||||||
|
char *
|
||||||
|
unixify (char *name)
|
||||||
|
{
|
||||||
|
static char piece[512];
|
||||||
|
char *s, *p;
|
||||||
|
|
||||||
|
if (strchr (name, '/') != 0) /* already in unix style */
|
||||||
|
return name;
|
||||||
|
|
||||||
|
p = piece;
|
||||||
|
*p = 0;
|
||||||
|
|
||||||
|
/* device part */
|
||||||
|
|
||||||
|
s = strchr (name, ':');
|
||||||
|
|
||||||
|
if (s != 0)
|
||||||
|
{
|
||||||
|
*s = 0;
|
||||||
|
*p++ = '/';
|
||||||
|
*p++ = '/';
|
||||||
|
strcpy (p, name);
|
||||||
|
p += strlen (p);
|
||||||
|
*s = ':';
|
||||||
|
}
|
||||||
|
|
||||||
|
/* directory part */
|
||||||
|
|
||||||
|
*p++ = '/';
|
||||||
|
s = strchr (name, '[');
|
||||||
|
|
||||||
|
if (s != 0)
|
||||||
|
{
|
||||||
|
s++;
|
||||||
|
switch (*s)
|
||||||
|
{
|
||||||
|
case ']': /* [] */
|
||||||
|
strcat (p, "./");
|
||||||
|
break;
|
||||||
|
case '-': /* [- */
|
||||||
|
strcat (p, "../");
|
||||||
|
break;
|
||||||
|
case '.':
|
||||||
|
strcat (p, "./"); /* [. */
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
s--;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
s++;
|
||||||
|
while (*s)
|
||||||
|
{
|
||||||
|
if (*s == '.')
|
||||||
|
*p++ = '/';
|
||||||
|
else
|
||||||
|
*p++ = *s;
|
||||||
|
s++;
|
||||||
|
if (*s == ']')
|
||||||
|
{
|
||||||
|
s++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (*s != 0) /* more after ']' ?? */
|
||||||
|
{
|
||||||
|
if (*(p-1) != '/')
|
||||||
|
*p++ = '/';
|
||||||
|
strcpy (p, s); /* copy it anyway */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else /* no '[' anywhere */
|
||||||
|
|
||||||
|
{
|
||||||
|
*p++ = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* force end with '/' */
|
||||||
|
|
||||||
|
if (*(p-1) != '/')
|
||||||
|
*p++ = '/';
|
||||||
|
*p = 0;
|
||||||
|
|
||||||
|
return piece;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* EOF */
|
||||||
138
vpath.c
138
vpath.c
@@ -1,5 +1,5 @@
|
|||||||
/* Implementation of pattern-matching file search paths for GNU Make.
|
/* Implementation of pattern-matching file search paths for GNU Make.
|
||||||
Copyright (C) 1988, 1989, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
|
Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc.
|
||||||
This file is part of GNU Make.
|
This file is part of GNU Make.
|
||||||
|
|
||||||
GNU Make is free software; you can redistribute it and/or modify
|
GNU Make is free software; you can redistribute it and/or modify
|
||||||
@@ -17,8 +17,11 @@ along with GNU Make; see the file COPYING. If not, write to
|
|||||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
|
|
||||||
#include "make.h"
|
#include "make.h"
|
||||||
#include "file.h"
|
#include "filedef.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
#include "pathstuff.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Structure used to represent a selective VPATH searchpath. */
|
/* Structure used to represent a selective VPATH searchpath. */
|
||||||
@@ -40,8 +43,12 @@ static struct vpath *vpaths;
|
|||||||
/* Structure for the general VPATH given in the variable. */
|
/* Structure for the general VPATH given in the variable. */
|
||||||
|
|
||||||
static struct vpath *general_vpath;
|
static struct vpath *general_vpath;
|
||||||
|
|
||||||
|
/* Structure for GPATH given in the variable. */
|
||||||
|
|
||||||
|
static struct vpath *gpaths;
|
||||||
|
|
||||||
static int selective_vpath_search ();
|
static int selective_vpath_search PARAMS ((struct vpath *path, char **file, time_t *mtime_ptr));
|
||||||
|
|
||||||
/* Reverse the chain of selective VPATH lists so they
|
/* Reverse the chain of selective VPATH lists so they
|
||||||
will be searched in the order given in the makefiles
|
will be searched in the order given in the makefiles
|
||||||
@@ -95,6 +102,38 @@ build_vpath_lists ()
|
|||||||
general_vpath = vpaths;
|
general_vpath = vpaths;
|
||||||
vpaths = save_vpaths;
|
vpaths = save_vpaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If there is a GPATH variable with a nonnull value, construct the
|
||||||
|
GPATH list from it. We use variable_expand rather than just
|
||||||
|
calling lookup_variable so that it will be recursively expanded. */
|
||||||
|
|
||||||
|
{
|
||||||
|
/* Turn off --warn-undefined-variables while we expand SHELL and IFS. */
|
||||||
|
int save = warn_undefined_variables_flag;
|
||||||
|
warn_undefined_variables_flag = 0;
|
||||||
|
|
||||||
|
p = variable_expand ("$(strip $(GPATH))");
|
||||||
|
|
||||||
|
warn_undefined_variables_flag = save;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*p != '\0')
|
||||||
|
{
|
||||||
|
/* Save the list of vpaths. */
|
||||||
|
struct vpath *save_vpaths = vpaths;
|
||||||
|
|
||||||
|
/* Empty `vpaths' so the new one will have no next, and `vpaths'
|
||||||
|
will still be nil if P contains no existing directories. */
|
||||||
|
vpaths = 0;
|
||||||
|
|
||||||
|
/* Parse P. */
|
||||||
|
construct_vpath_list ("%", p);
|
||||||
|
|
||||||
|
/* Store the created path as the GPATH,
|
||||||
|
and restore the old list of vpaths. */
|
||||||
|
gpaths = vpaths;
|
||||||
|
vpaths = save_vpaths;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Construct the VPATH listing for the pattern and searchpath given.
|
/* Construct the VPATH listing for the pattern and searchpath given.
|
||||||
@@ -106,14 +145,15 @@ build_vpath_lists ()
|
|||||||
variable.
|
variable.
|
||||||
|
|
||||||
If SEARCHPATH is nil, remove all previous listings with the same
|
If SEARCHPATH is nil, remove all previous listings with the same
|
||||||
pattern. If PATTERN is nil, remove all VPATH listings.
|
pattern. If PATTERN is nil, remove all VPATH listings. Existing
|
||||||
Existing and readable directories that are not "." given in the
|
and readable directories that are not "." given in the searchpath
|
||||||
searchpath separated by colons are loaded into the directory hash
|
separated by the path element separator (defined in make.h) are
|
||||||
table if they are not there already and put in the VPATH searchpath
|
loaded into the directory hash table if they are not there already
|
||||||
for the given pattern with trailing slashes stripped off if present
|
and put in the VPATH searchpath for the given pattern with trailing
|
||||||
(and if the directory is not the root, "/").
|
slashes stripped off if present (and if the directory is not the
|
||||||
The length of the longest entry in the list is put in the structure as well.
|
root, "/"). The length of the longest entry in the list is put in
|
||||||
The new entry will be at the head of the VPATHS chain. */
|
the structure as well. The new entry will be at the head of the
|
||||||
|
VPATHS chain. */
|
||||||
|
|
||||||
void
|
void
|
||||||
construct_vpath_list (pattern, dirpath)
|
construct_vpath_list (pattern, dirpath)
|
||||||
@@ -170,10 +210,14 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Figure out the maximum number of VPATH entries and
|
#ifdef WINDOWS32
|
||||||
put it in MAXELEM. We start with 2, one before the
|
convert_vpath_to_windows32(dirpath, ';');
|
||||||
first colon and one nil, the list terminator and
|
#endif
|
||||||
increment our estimated number for each colon or blank we find. */
|
|
||||||
|
/* Figure out the maximum number of VPATH entries and put it in
|
||||||
|
MAXELEM. We start with 2, one before the first separator and one
|
||||||
|
nil (the list terminator) and increment our estimated number for
|
||||||
|
each separator or blank we find. */
|
||||||
maxelem = 2;
|
maxelem = 2;
|
||||||
p = dirpath;
|
p = dirpath;
|
||||||
while (*p != '\0')
|
while (*p != '\0')
|
||||||
@@ -183,7 +227,7 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
vpath = (char **) xmalloc (maxelem * sizeof (char *));
|
vpath = (char **) xmalloc (maxelem * sizeof (char *));
|
||||||
maxvpath = 0;
|
maxvpath = 0;
|
||||||
|
|
||||||
/* Skip over any initial colons and blanks. */
|
/* Skip over any initial separators and blanks. */
|
||||||
p = dirpath;
|
p = dirpath;
|
||||||
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
|
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
|
||||||
++p;
|
++p;
|
||||||
@@ -202,6 +246,10 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
len = p - v;
|
len = p - v;
|
||||||
/* Make sure there's no trailing slash,
|
/* Make sure there's no trailing slash,
|
||||||
but still allow "/" as a directory. */
|
but still allow "/" as a directory. */
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
/* We need also to leave alone a trailing slash in "d:/". */
|
||||||
|
if (len > 3 || (len > 1 && v[1] != ':'))
|
||||||
|
#endif
|
||||||
if (len > 1 && p[-1] == '/')
|
if (len > 1 && p[-1] == '/')
|
||||||
--len;
|
--len;
|
||||||
|
|
||||||
@@ -224,7 +272,7 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
free (v);
|
free (v);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Skip over colons and blanks between entries. */
|
/* Skip over separators and blanks between entries. */
|
||||||
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
|
while (*p == PATH_SEPARATOR_CHAR || isblank (*p))
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
@@ -263,6 +311,24 @@ construct_vpath_list (pattern, dirpath)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Search the GPATH list for a pathname string that matches the one passed
|
||||||
|
in. If it is found, return 1. Otherwise we return 0. */
|
||||||
|
|
||||||
|
int
|
||||||
|
gpath_search (file, len)
|
||||||
|
char *file;
|
||||||
|
int len;
|
||||||
|
{
|
||||||
|
register char **gp;
|
||||||
|
|
||||||
|
if (gpaths && (len <= gpaths->maxlen))
|
||||||
|
for (gp = gpaths->searchpath; *gp != NULL; ++gp)
|
||||||
|
if (!strncmp(*gp, file, len) && (*gp)[len] == '\0')
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Search the VPATH list whose pattern matches *FILE for a directory
|
/* Search the VPATH list whose pattern matches *FILE for a directory
|
||||||
where the name pointed to by FILE exists. If it is found, we set *FILE to
|
where the name pointed to by FILE exists. If it is found, we set *FILE to
|
||||||
the newly malloc'd name of the existing file, *MTIME_PTR (if MTIME_PTR is
|
the newly malloc'd name of the existing file, *MTIME_PTR (if MTIME_PTR is
|
||||||
@@ -279,7 +345,12 @@ vpath_search (file, mtime_ptr)
|
|||||||
/* If there are no VPATH entries or FILENAME starts at the root,
|
/* If there are no VPATH entries or FILENAME starts at the root,
|
||||||
there is nothing we can do. */
|
there is nothing we can do. */
|
||||||
|
|
||||||
if (**file == '/' || (vpaths == 0 && general_vpath == 0))
|
if (**file == '/'
|
||||||
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|
|| **file == '\\'
|
||||||
|
|| (*file)[1] == ':'
|
||||||
|
#endif
|
||||||
|
|| (vpaths == 0 && general_vpath == 0))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (v = vpaths; v != 0; v = v->next)
|
for (v = vpaths; v != 0; v = v->next)
|
||||||
@@ -331,6 +402,14 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
pointer to the name-within-directory and FLEN is its length. */
|
pointer to the name-within-directory and FLEN is its length. */
|
||||||
|
|
||||||
n = rindex (*file, '/');
|
n = rindex (*file, '/');
|
||||||
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|
/* We need the rightmost slash or backslash. */
|
||||||
|
{
|
||||||
|
char *bslash = rindex(*file, '\\');
|
||||||
|
if (!n || bslash > n)
|
||||||
|
n = bslash;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
name_dplen = n != 0 ? n - *file : 0;
|
name_dplen = n != 0 ? n - *file : 0;
|
||||||
filename = name_dplen > 0 ? n + 1 : *file;
|
filename = name_dplen > 0 ? n + 1 : *file;
|
||||||
if (name_dplen > 0)
|
if (name_dplen > 0)
|
||||||
@@ -340,7 +419,7 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
a slash, the directory prefix that came with *FILE,
|
a slash, the directory prefix that came with *FILE,
|
||||||
another slash (although this one may not always be
|
another slash (although this one may not always be
|
||||||
necessary), the filename, and a null terminator. */
|
necessary), the filename, and a null terminator. */
|
||||||
name = (char *) alloca (maxvpath + 1 + name_dplen + 1 + flen + 1);
|
name = (char *) xmalloc (maxvpath + 1 + name_dplen + 1 + flen + 1);
|
||||||
|
|
||||||
/* Try each VPATH entry. */
|
/* Try each VPATH entry. */
|
||||||
for (i = 0; vpath[i] != 0; ++i)
|
for (i = 0; vpath[i] != 0; ++i)
|
||||||
@@ -357,18 +436,27 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
/* Add the directory prefix already in *FILE. */
|
/* Add the directory prefix already in *FILE. */
|
||||||
if (name_dplen > 0)
|
if (name_dplen > 0)
|
||||||
{
|
{
|
||||||
|
#ifndef VMS
|
||||||
*n++ = '/';
|
*n++ = '/';
|
||||||
|
#endif
|
||||||
bcopy (*file, n, name_dplen);
|
bcopy (*file, n, name_dplen);
|
||||||
n += name_dplen;
|
n += name_dplen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined (WINDOWS32) || defined (__MSDOS__)
|
||||||
|
/* Cause the next if to treat backslash and slash alike. */
|
||||||
|
if (n != name && n[-1] == '\\' )
|
||||||
|
n[-1] = '/';
|
||||||
|
#endif
|
||||||
/* Now add the name-within-directory at the end of NAME. */
|
/* Now add the name-within-directory at the end of NAME. */
|
||||||
|
#ifndef VMS
|
||||||
if (n != name && n[-1] != '/')
|
if (n != name && n[-1] != '/')
|
||||||
{
|
{
|
||||||
*n = '/';
|
*n = '/';
|
||||||
bcopy (filename, n + 1, flen + 1);
|
bcopy (filename, n + 1, flen + 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
bcopy (filename, n, flen + 1);
|
bcopy (filename, n, flen + 1);
|
||||||
|
|
||||||
/* Check if the file is mentioned in a makefile. If *FILE is not
|
/* Check if the file is mentioned in a makefile. If *FILE is not
|
||||||
@@ -381,7 +469,7 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
inadequately commented change in July 1990; I am not sure off
|
inadequately commented change in July 1990; I am not sure off
|
||||||
hand what problem it fixes.
|
hand what problem it fixes.
|
||||||
|
|
||||||
In December 1993 I loosened of this restriction to allow a file
|
In December 1993 I loosened this restriction to allow a file
|
||||||
to be chosen if it is mentioned as a target in a makefile. This
|
to be chosen if it is mentioned as a target in a makefile. This
|
||||||
seem logical. */
|
seem logical. */
|
||||||
{
|
{
|
||||||
@@ -395,6 +483,9 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
/* That file wasn't mentioned in the makefile.
|
/* That file wasn't mentioned in the makefile.
|
||||||
See if it actually exists. */
|
See if it actually exists. */
|
||||||
|
|
||||||
|
#ifdef VMS
|
||||||
|
exists_in_cache = exists = dir_file_exists_p (vpath[i], filename);
|
||||||
|
#else
|
||||||
/* Clobber a null into the name at the last slash.
|
/* Clobber a null into the name at the last slash.
|
||||||
Now NAME is the name of the directory to look in. */
|
Now NAME is the name of the directory to look in. */
|
||||||
*n = '\0';
|
*n = '\0';
|
||||||
@@ -403,6 +494,7 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
construct_vpath_list or the code just above put it there.
|
construct_vpath_list or the code just above put it there.
|
||||||
Does the file we seek exist in it? */
|
Does the file we seek exist in it? */
|
||||||
exists_in_cache = exists = dir_file_exists_p (name, filename);
|
exists_in_cache = exists = dir_file_exists_p (name, filename);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exists)
|
if (exists)
|
||||||
@@ -415,11 +507,13 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
|
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
|
#ifndef VMS
|
||||||
/* Put the slash back in NAME. */
|
/* Put the slash back in NAME. */
|
||||||
*n = '/';
|
*n = '/';
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!exists_in_cache /* Makefile-mentioned file need not exist. */
|
if (!exists_in_cache /* Makefile-mentioned file need not exist. */
|
||||||
|| safe_stat (name, &st) == 0) /* Does it really exist? */
|
|| stat (name, &st) == 0) /* Does it really exist? */
|
||||||
{
|
{
|
||||||
/* We have found a file.
|
/* We have found a file.
|
||||||
Store the name we found into *FILE for the caller. */
|
Store the name we found into *FILE for the caller. */
|
||||||
@@ -432,6 +526,7 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
we record a zero modtime to indicate this. */
|
we record a zero modtime to indicate this. */
|
||||||
*mtime_ptr = exists_in_cache ? st.st_mtime : (time_t) 0;
|
*mtime_ptr = exists_in_cache ? st.st_mtime : (time_t) 0;
|
||||||
|
|
||||||
|
free (name);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -439,6 +534,7 @@ selective_vpath_search (path, file, mtime_ptr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free (name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
188
w32/compat/dirent.c
Normal file
188
w32/compat/dirent.c
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "dirent.h"
|
||||||
|
|
||||||
|
|
||||||
|
DIR*
|
||||||
|
opendir(const char* pDirName)
|
||||||
|
{
|
||||||
|
struct stat sb;
|
||||||
|
DIR* pDir;
|
||||||
|
char* pEndDirName;
|
||||||
|
int nBufferLen;
|
||||||
|
|
||||||
|
/* sanity checks */
|
||||||
|
if (!pDirName) {
|
||||||
|
errno = EINVAL;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
if (stat(pDirName, &sb) != 0) {
|
||||||
|
errno = ENOENT;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
if ((sb.st_mode & S_IFMT) != S_IFDIR) {
|
||||||
|
errno = ENOTDIR;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* allocate a DIR structure to return */
|
||||||
|
pDir = (DIR *) malloc(sizeof (DIR));
|
||||||
|
|
||||||
|
if (!pDir)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
/* input directory name length */
|
||||||
|
nBufferLen = strlen(pDirName);
|
||||||
|
|
||||||
|
/* copy input directory name to DIR buffer */
|
||||||
|
strcpy(pDir->dir_pDirectoryName, pDirName);
|
||||||
|
|
||||||
|
/* point to end of the copied directory name */
|
||||||
|
pEndDirName = &pDir->dir_pDirectoryName[nBufferLen - 1];
|
||||||
|
|
||||||
|
/* if directory name did not end in '/' or '\', add '/' */
|
||||||
|
if ((*pEndDirName != '/') && (*pEndDirName != '\\')) {
|
||||||
|
pEndDirName++;
|
||||||
|
*pEndDirName = '/';
|
||||||
|
}
|
||||||
|
|
||||||
|
/* now append the wildcard character to the buffer */
|
||||||
|
pEndDirName++;
|
||||||
|
*pEndDirName = '*';
|
||||||
|
pEndDirName++;
|
||||||
|
*pEndDirName = '\0';
|
||||||
|
|
||||||
|
/* other values defaulted */
|
||||||
|
pDir->dir_nNumFiles = 0;
|
||||||
|
pDir->dir_hDirHandle = INVALID_HANDLE_VALUE;
|
||||||
|
pDir->dir_ulCookie = __DIRENT_COOKIE;
|
||||||
|
|
||||||
|
return pDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
closedir(DIR *pDir)
|
||||||
|
{
|
||||||
|
/* got a valid pointer? */
|
||||||
|
if (!pDir) {
|
||||||
|
errno = EINVAL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* sanity check that this is a DIR pointer */
|
||||||
|
if (pDir->dir_ulCookie != __DIRENT_COOKIE) {
|
||||||
|
errno = EINVAL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* close the WINDOWS32 directory handle */
|
||||||
|
if (pDir->dir_hDirHandle != INVALID_HANDLE_VALUE)
|
||||||
|
FindClose(pDir->dir_hDirHandle);
|
||||||
|
|
||||||
|
free(pDir);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct dirent *
|
||||||
|
readdir(DIR* pDir)
|
||||||
|
{
|
||||||
|
WIN32_FIND_DATA wfdFindData;
|
||||||
|
|
||||||
|
if (!pDir) {
|
||||||
|
errno = EINVAL;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* sanity check that this is a DIR pointer */
|
||||||
|
if (pDir->dir_ulCookie != __DIRENT_COOKIE) {
|
||||||
|
errno = EINVAL;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pDir->dir_nNumFiles == 0) {
|
||||||
|
pDir->dir_hDirHandle = FindFirstFile(pDir->dir_pDirectoryName, &wfdFindData);
|
||||||
|
if (pDir->dir_hDirHandle == INVALID_HANDLE_VALUE)
|
||||||
|
return NULL;
|
||||||
|
} else if (!FindNextFile(pDir->dir_hDirHandle, &wfdFindData))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
/* bump count for next call to readdir() or telldir() */
|
||||||
|
pDir->dir_nNumFiles++;
|
||||||
|
|
||||||
|
/* fill in struct dirent values */
|
||||||
|
pDir->dir_sdReturn.d_ino = -1;
|
||||||
|
strcpy(pDir->dir_sdReturn.d_name, wfdFindData.cFileName);
|
||||||
|
|
||||||
|
return &pDir->dir_sdReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
rewinddir(DIR* pDir)
|
||||||
|
{
|
||||||
|
if (!pDir) {
|
||||||
|
errno = EINVAL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* sanity check that this is a DIR pointer */
|
||||||
|
if (pDir->dir_ulCookie != __DIRENT_COOKIE) {
|
||||||
|
errno = EINVAL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* close the WINDOWS32 directory handle */
|
||||||
|
if (pDir->dir_hDirHandle != INVALID_HANDLE_VALUE)
|
||||||
|
if (!FindClose(pDir->dir_hDirHandle))
|
||||||
|
errno = EBADF;
|
||||||
|
|
||||||
|
/* reset members which control readdir() */
|
||||||
|
pDir->dir_hDirHandle = INVALID_HANDLE_VALUE;
|
||||||
|
pDir->dir_nNumFiles = 0;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
telldir(DIR* pDir)
|
||||||
|
{
|
||||||
|
if (!pDir) {
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* sanity check that this is a DIR pointer */
|
||||||
|
if (pDir->dir_ulCookie != __DIRENT_COOKIE) {
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* return number of times readdir() called */
|
||||||
|
return pDir->dir_nNumFiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
seekdir(DIR* pDir, long nPosition)
|
||||||
|
{
|
||||||
|
if (!pDir)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* sanity check that this is a DIR pointer */
|
||||||
|
if (pDir->dir_ulCookie != __DIRENT_COOKIE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* go back to beginning of directory */
|
||||||
|
rewinddir(pDir);
|
||||||
|
|
||||||
|
/* loop until we have found position we care about */
|
||||||
|
for (--nPosition; nPosition && readdir(pDir); nPosition--);
|
||||||
|
|
||||||
|
/* flag invalid nPosition value */
|
||||||
|
if (nPosition)
|
||||||
|
errno = EINVAL;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
37
w32/include/dirent.h
Normal file
37
w32/include/dirent.h
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
#ifndef _DIRENT_H
|
||||||
|
#define _DIRENT_H
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <windows.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#ifndef NAME_MAX
|
||||||
|
#define NAME_MAX 255
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define __DIRENT_COOKIE 0xfefeabab
|
||||||
|
|
||||||
|
|
||||||
|
struct dirent
|
||||||
|
{
|
||||||
|
ino_t d_ino; /* unused - no equivalent on WINDOWS32 */
|
||||||
|
char d_name[NAME_MAX+1];
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct dir_struct {
|
||||||
|
ULONG dir_ulCookie;
|
||||||
|
HANDLE dir_hDirHandle;
|
||||||
|
DWORD dir_nNumFiles;
|
||||||
|
char dir_pDirectoryName[NAME_MAX+1];
|
||||||
|
struct dirent dir_sdReturn;
|
||||||
|
} DIR;
|
||||||
|
|
||||||
|
DIR *opendir(const char *);
|
||||||
|
struct dirent *readdir(DIR *);
|
||||||
|
void rewinddir(DIR *);
|
||||||
|
void closedir(DIR *);
|
||||||
|
int telldir(DIR *);
|
||||||
|
void seekdir(DIR *, long);
|
||||||
|
|
||||||
|
#endif
|
||||||
9
w32/include/pathstuff.h
Normal file
9
w32/include/pathstuff.h
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#ifndef _PATHSTUFF_H
|
||||||
|
#define _PATHSTUFF_H
|
||||||
|
|
||||||
|
extern char * convert_Path_to_windows32(char *Path, char to_delim);
|
||||||
|
extern char * convert_vpath_to_windows32(char *Path, char to_delim);
|
||||||
|
extern char * w32ify(char *file, int resolve);
|
||||||
|
extern char * getcwd_fs(char *buf, int len);
|
||||||
|
|
||||||
|
#endif
|
||||||
47
w32/include/sub_proc.h
Normal file
47
w32/include/sub_proc.h
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
#ifndef SUB_PROC_H
|
||||||
|
#define SUB_PROC_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Component Name:
|
||||||
|
*
|
||||||
|
* $Date$
|
||||||
|
*
|
||||||
|
* $Source$
|
||||||
|
*
|
||||||
|
* $Revision$
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
#ifdef WINDOWS32
|
||||||
|
|
||||||
|
#define EXTERN_DECL(entry, args) extern entry args
|
||||||
|
#define VOID_DECL void
|
||||||
|
|
||||||
|
EXTERN_DECL(HANDLE process_init, (VOID_DECL));
|
||||||
|
EXTERN_DECL(HANDLE process_init_fd, (HANDLE stdinh, HANDLE stdouth,
|
||||||
|
HANDLE stderrh));
|
||||||
|
EXTERN_DECL(long process_begin, (HANDLE proc, char **argv, char **envp,
|
||||||
|
char *exec_path, char *as_user));
|
||||||
|
EXTERN_DECL(long process_pipe_io, (HANDLE proc, char *stdin_data,
|
||||||
|
int stdin_data_len));
|
||||||
|
EXTERN_DECL(long process_file_io, (HANDLE proc));
|
||||||
|
EXTERN_DECL(void process_cleanup, (HANDLE proc));
|
||||||
|
EXTERN_DECL(HANDLE process_wait_for_any, (VOID_DECL));
|
||||||
|
EXTERN_DECL(void process_register, (HANDLE proc));
|
||||||
|
EXTERN_DECL(HANDLE process_easy, (char** argv, char** env));
|
||||||
|
EXTERN_DECL(BOOL process_kill, (HANDLE proc, int signal));
|
||||||
|
|
||||||
|
/* support routines */
|
||||||
|
EXTERN_DECL(long process_errno, (HANDLE proc));
|
||||||
|
EXTERN_DECL(long process_last_err, (HANDLE proc));
|
||||||
|
EXTERN_DECL(long process_exit_code, (HANDLE proc));
|
||||||
|
EXTERN_DECL(long process_signal, (HANDLE proc));
|
||||||
|
EXTERN_DECL(char * process_outbuf, (HANDLE proc));
|
||||||
|
EXTERN_DECL(char * process_errbuf, (HANDLE proc));
|
||||||
|
EXTERN_DECL(int process_outcnt, (HANDLE proc));
|
||||||
|
EXTERN_DECL(int process_errcnt, (HANDLE proc));
|
||||||
|
EXTERN_DECL(void process_pipes, (HANDLE proc, int pipes[3]));
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
10
w32/include/w32err.h
Normal file
10
w32/include/w32err.h
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#ifndef _W32ERR_H_
|
||||||
|
#define _W32ERR_H_
|
||||||
|
|
||||||
|
#ifndef EXTERN_DECL
|
||||||
|
#define EXTERN_DECL(entry, args) entry args
|
||||||
|
#endif
|
||||||
|
|
||||||
|
EXTERN_DECL(char * map_windows32_error_to_string, (DWORD error));
|
||||||
|
|
||||||
|
#endif /* !_W32ERR_H */
|
||||||
238
w32/pathstuff.c
Normal file
238
w32/pathstuff.c
Normal file
@@ -0,0 +1,238 @@
|
|||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "make.h"
|
||||||
|
#include "pathstuff.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert delimiter separated vpath to Canonical format.
|
||||||
|
*/
|
||||||
|
char *
|
||||||
|
convert_vpath_to_windows32(char *Path, char to_delim)
|
||||||
|
{
|
||||||
|
char *etok; /* token separator for old Path */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert all spaces to delimiters. Note that pathnames which
|
||||||
|
* contain blanks get trounced here. Use 8.3 format as a workaround.
|
||||||
|
*/
|
||||||
|
for (etok = Path; etok && *etok; etok++)
|
||||||
|
if (isblank(*etok))
|
||||||
|
*etok = to_delim;
|
||||||
|
|
||||||
|
return (convert_Path_to_windows32(Path, to_delim));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert delimiter separated path to Canonical format.
|
||||||
|
*/
|
||||||
|
char *
|
||||||
|
convert_Path_to_windows32(char *Path, char to_delim)
|
||||||
|
{
|
||||||
|
char *etok; /* token separator for old Path */
|
||||||
|
char *p; /* points to element of old Path */
|
||||||
|
|
||||||
|
/* is this a multi-element Path ? */
|
||||||
|
for (p = Path, etok = strpbrk(p, ":;");
|
||||||
|
etok;
|
||||||
|
etok = strpbrk(p, ":;"))
|
||||||
|
if ((etok - p) == 1) {
|
||||||
|
if (*(etok - 1) == ';' ||
|
||||||
|
*(etok - 1) == ':') {
|
||||||
|
etok[-1] = to_delim;
|
||||||
|
etok[0] = to_delim;
|
||||||
|
p = ++etok;
|
||||||
|
continue; /* ignore empty bucket */
|
||||||
|
} else if (!isalpha(*p)) {
|
||||||
|
/* found one to count, handle things like '.' */
|
||||||
|
*etok = to_delim;
|
||||||
|
p = ++etok;
|
||||||
|
} else if ((*etok == ':') && (etok = strpbrk(etok+1, ":;"))) {
|
||||||
|
/* found one to count, handle drive letter */
|
||||||
|
*etok = to_delim;
|
||||||
|
p = ++etok;
|
||||||
|
} else
|
||||||
|
/* all finished, force abort */
|
||||||
|
p += strlen(p);
|
||||||
|
} else {
|
||||||
|
/* found another one, no drive letter */
|
||||||
|
*etok = to_delim;
|
||||||
|
p = ++etok;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Path;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convert to forward slashes. Resolve to full pathname optionally
|
||||||
|
*/
|
||||||
|
char *
|
||||||
|
w32ify(char *filename, int resolve)
|
||||||
|
{
|
||||||
|
static char w32_path[FILENAME_MAX];
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
if (resolve)
|
||||||
|
_fullpath(w32_path, filename, sizeof (w32_path));
|
||||||
|
else
|
||||||
|
strncpy(w32_path, filename, sizeof (w32_path));
|
||||||
|
|
||||||
|
for (p = w32_path; p && *p; p++)
|
||||||
|
if (*p == '\\')
|
||||||
|
*p = '/';
|
||||||
|
|
||||||
|
return w32_path;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
getcwd_fs(char* buf, int len)
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
if (p = getcwd(buf, len)) {
|
||||||
|
char *q = w32ify(buf, 0);
|
||||||
|
strncpy(buf, q, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef unused
|
||||||
|
/*
|
||||||
|
* Convert delimiter separated pathnames (e.g. PATH) or single file pathname
|
||||||
|
* (e.g. c:/foo, c:\bar) to NutC format. If we are handed a string that
|
||||||
|
* _NutPathToNutc() fails to convert, just return the path we were handed
|
||||||
|
* and assume the caller will know what to do with it (It was probably
|
||||||
|
* a mistake to try and convert it anyway due to some of the bizarre things
|
||||||
|
* that might look like pathnames in makefiles).
|
||||||
|
*/
|
||||||
|
char *
|
||||||
|
convert_path_to_nutc(char *path)
|
||||||
|
{
|
||||||
|
int count; /* count of path elements */
|
||||||
|
char *nutc_path; /* new NutC path */
|
||||||
|
int nutc_path_len; /* length of buffer to allocate for new path */
|
||||||
|
char *pathp; /* pointer to nutc_path used to build it */
|
||||||
|
char *etok; /* token separator for old path */
|
||||||
|
char *p; /* points to element of old path */
|
||||||
|
char sep; /* what flavor of separator used in old path */
|
||||||
|
char *rval;
|
||||||
|
|
||||||
|
/* is this a multi-element path ? */
|
||||||
|
for (p = path, etok = strpbrk(p, ":;"), count = 0;
|
||||||
|
etok;
|
||||||
|
etok = strpbrk(p, ":;"))
|
||||||
|
if ((etok - p) == 1) {
|
||||||
|
if (*(etok - 1) == ';' ||
|
||||||
|
*(etok - 1) == ':') {
|
||||||
|
p = ++etok;
|
||||||
|
continue; /* ignore empty bucket */
|
||||||
|
} else if (etok = strpbrk(etok+1, ":;"))
|
||||||
|
/* found one to count, handle drive letter */
|
||||||
|
p = ++etok, count++;
|
||||||
|
else
|
||||||
|
/* all finished, force abort */
|
||||||
|
p += strlen(p);
|
||||||
|
} else
|
||||||
|
/* found another one, no drive letter */
|
||||||
|
p = ++etok, count++;
|
||||||
|
|
||||||
|
if (count) {
|
||||||
|
count++; /* x1;x2;x3 <- need to count x3 */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Hazard a guess on how big the buffer needs to be.
|
||||||
|
* We have to convert things like c:/foo to /c=/foo.
|
||||||
|
*/
|
||||||
|
nutc_path_len = strlen(path) + (count*2) + 1;
|
||||||
|
nutc_path = xmalloc(nutc_path_len);
|
||||||
|
pathp = nutc_path;
|
||||||
|
*pathp = '\0';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Loop through PATH and convert one elemnt of the path at at
|
||||||
|
* a time. Single file pathnames will fail this and fall
|
||||||
|
* to the logic below loop.
|
||||||
|
*/
|
||||||
|
for (p = path, etok = strpbrk(p, ":;");
|
||||||
|
etok;
|
||||||
|
etok = strpbrk(p, ":;")) {
|
||||||
|
|
||||||
|
/* don't trip up on device specifiers or empty path slots */
|
||||||
|
if ((etok - p) == 1)
|
||||||
|
if (*(etok - 1) == ';' ||
|
||||||
|
*(etok - 1) == ':') {
|
||||||
|
p = ++etok;
|
||||||
|
continue;
|
||||||
|
} else if ((etok = strpbrk(etok+1, ":;")) == NULL)
|
||||||
|
break; /* thing found was a WINDOWS32 pathname */
|
||||||
|
|
||||||
|
/* save separator */
|
||||||
|
sep = *etok;
|
||||||
|
|
||||||
|
/* terminate the current path element -- temporarily */
|
||||||
|
*etok = '\0';
|
||||||
|
|
||||||
|
#ifdef __NUTC__
|
||||||
|
/* convert to NutC format */
|
||||||
|
if (_NutPathToNutc(p, pathp, 0) == FALSE) {
|
||||||
|
free(nutc_path);
|
||||||
|
rval = savestring(path, strlen(path));
|
||||||
|
return rval;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
*pathp++ = '/';
|
||||||
|
*pathp++ = p[0];
|
||||||
|
*pathp++ = '=';
|
||||||
|
*pathp++ = '/';
|
||||||
|
strcpy(pathp, &p[2]);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
pathp += strlen(pathp);
|
||||||
|
*pathp++ = ':'; /* use Unix style path separtor for new path */
|
||||||
|
*pathp = '\0'; /* make sure we are null terminaed */
|
||||||
|
|
||||||
|
/* restore path separator */
|
||||||
|
*etok = sep;
|
||||||
|
|
||||||
|
/* point p to first char of next path element */
|
||||||
|
p = ++etok;
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
nutc_path_len = strlen(path) + 3;
|
||||||
|
nutc_path = xmalloc(nutc_path_len);
|
||||||
|
pathp = nutc_path;
|
||||||
|
*pathp = '\0';
|
||||||
|
p = path;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* OK, here we handle the last element in PATH (e.g. c of a;b;c)
|
||||||
|
* or the path was a single filename and will be converted
|
||||||
|
* here. Note, testing p here assures that we don't trip up
|
||||||
|
* on paths like a;b; which have trailing delimiter followed by
|
||||||
|
* nothing.
|
||||||
|
*/
|
||||||
|
if (*p != '\0') {
|
||||||
|
#ifdef __NUTC__
|
||||||
|
if (_NutPathToNutc(p, pathp, 0) == FALSE) {
|
||||||
|
free(nutc_path);
|
||||||
|
rval = savestring(path, strlen(path));
|
||||||
|
return rval;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
*pathp++ = '/';
|
||||||
|
*pathp++ = p[0];
|
||||||
|
*pathp++ = '=';
|
||||||
|
*pathp++ = '/';
|
||||||
|
strcpy(pathp, &p[2]);
|
||||||
|
#endif
|
||||||
|
} else
|
||||||
|
*(pathp-1) = '\0'; /* we're already done, don't leave trailing : */
|
||||||
|
|
||||||
|
rval = savestring(nutc_path, strlen(nutc_path));
|
||||||
|
free(nutc_path);
|
||||||
|
return rval;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
59
w32/subproc/NMakefile
Normal file
59
w32/subproc/NMakefile
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
# NOTE: If you have no `make' program at all to process this makefile, run
|
||||||
|
# `build.bat' instead.
|
||||||
|
#
|
||||||
|
# Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc
|
||||||
|
# This file is part of GNU Make.
|
||||||
|
#
|
||||||
|
# GNU Make 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 2, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# GNU Make 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 GNU Make; see the file COPYING. If not, write to
|
||||||
|
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
|
#
|
||||||
|
# NMakefile for GNU Make (subproc library)
|
||||||
|
#
|
||||||
|
LIB = lib
|
||||||
|
CC = cl
|
||||||
|
|
||||||
|
OUTDIR=.
|
||||||
|
MAKEFILE=NMakefile
|
||||||
|
|
||||||
|
CFLAGS_any = /nologo /MT /W3 /GX /Z7 /YX /D WIN32 /D WINDOWS32 /D _WINDOWS -I. -I../include
|
||||||
|
CFLAGS_debug = $(CFLAGS_any) /Od /D _DEBUG /FR.\WinDebug\ /Fp.\WinDebug\subproc.pch /Fo.\WinDebug/
|
||||||
|
CFLAGS_release = $(CFLAGS_any) /O2 /FR.\WinRel\ /Fp.\WinRel\subproc.pch /Fo.\WinRel/
|
||||||
|
|
||||||
|
all: Release Debug
|
||||||
|
|
||||||
|
Release:
|
||||||
|
$(MAKE) /f $(MAKEFILE) OUTDIR=WinRel CFLAGS="$(CFLAGS_release)" WinRel/subproc.lib
|
||||||
|
Debug:
|
||||||
|
$(MAKE) /f $(MAKEFILE) OUTDIR=WinDebug CFLAGS="$(CFLAGS_debug)" WinDebug/subproc.lib
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rmdir /s /q WinRel WinDebug
|
||||||
|
|
||||||
|
$(OUTDIR):
|
||||||
|
if not exist .\$@\nul mkdir .\$@
|
||||||
|
|
||||||
|
OBJS = $(OUTDIR)/misc.obj $(OUTDIR)/w32err.obj $(OUTDIR)/sub_proc.obj
|
||||||
|
|
||||||
|
$(OUTDIR)/subproc.lib: $(OUTDIR) $(OBJS)
|
||||||
|
$(LIB) -out:$@ @<<
|
||||||
|
$(OBJS)
|
||||||
|
<<
|
||||||
|
|
||||||
|
.c{$(OUTDIR)}.obj:
|
||||||
|
$(CC) $(CFLAGS) /c $<
|
||||||
|
|
||||||
|
$(OUTDIR)/misc.obj: misc.c proc.h
|
||||||
|
$(OUTDIR)/sub_proc.obj: sub_proc.c ../include/sub_proc.h ../include/w32err.h proc.h
|
||||||
|
$(OUTDIR)/w32err.obj: w32err.c ../include/w32err.h
|
||||||
10
w32/subproc/build.bat
Normal file
10
w32/subproc/build.bat
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
if not exist .\WinDebug\nul mkdir .\WinDebug
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c misc.c
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c sub_proc.c
|
||||||
|
cl.exe /nologo /MT /W3 /GX /Z7 /YX /Od /I .. /I . /I ../include /D WIN32 /D WINDOWS32 /D _DEBUG /D _WINDOWS /FR.\WinDebug/ /Fp.\WinDebug/subproc.pch /Fo.\WinDebug/ /c w32err.c
|
||||||
|
lib.exe /NOLOGO /OUT:.\WinDebug\subproc.lib .\WinDebug/misc.obj .\WinDebug/sub_proc.obj .\WinDebug/w32err.obj
|
||||||
|
if not exist .\WinRel\nul mkdir .\WinRel
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c misc.c
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c sub_proc.c
|
||||||
|
cl.exe /nologo /MT /W3 /GX /YX /O2 /I ../include /D WIN32 /D WINDOWS32 /D NDEBUG /D _WINDOWS /FR.\WinRel/ /Fp.\WinRel/subproc.pch /Fo.\WinRel/ /c w32err.c
|
||||||
|
lib.exe /NOLOGO /OUT:.\WinRel\subproc.lib .\WinRel/misc.obj .\WinRel/sub_proc.obj .\WinRel/w32err.obj
|
||||||
63
w32/subproc/misc.c
Normal file
63
w32/subproc/misc.c
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
#include <stddef.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <windows.h>
|
||||||
|
#include "proc.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Description: Convert a NULL string terminated UNIX environment block to
|
||||||
|
* an environment block suitable for a windows32 system call
|
||||||
|
*
|
||||||
|
* Returns: TRUE= success, FALSE=fail
|
||||||
|
*
|
||||||
|
* Notes/Dependencies: the environment block is sorted in case-insensitive
|
||||||
|
* order, is double-null terminated, and is a char *, not a char **
|
||||||
|
*/
|
||||||
|
int _cdecl compare(const void *a1, const void *a2)
|
||||||
|
{
|
||||||
|
return _stricoll(*((char**)a1),*((char**)a2));
|
||||||
|
}
|
||||||
|
bool_t
|
||||||
|
arr2envblk(char **arr, char **envblk_out)
|
||||||
|
{
|
||||||
|
char **tmp;
|
||||||
|
int size_needed;
|
||||||
|
int arrcnt;
|
||||||
|
char *ptr;
|
||||||
|
|
||||||
|
arrcnt = 0;
|
||||||
|
while (arr[arrcnt]) {
|
||||||
|
arrcnt++;
|
||||||
|
}
|
||||||
|
|
||||||
|
tmp = (char**) calloc(arrcnt + 1, sizeof(char *));
|
||||||
|
if (!tmp) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
arrcnt = 0;
|
||||||
|
size_needed = 0;
|
||||||
|
while (arr[arrcnt]) {
|
||||||
|
tmp[arrcnt] = arr[arrcnt];
|
||||||
|
size_needed += strlen(arr[arrcnt]) + 1;
|
||||||
|
arrcnt++;
|
||||||
|
}
|
||||||
|
size_needed++;
|
||||||
|
|
||||||
|
qsort((void *) tmp, (size_t) arrcnt, sizeof (char*), compare);
|
||||||
|
|
||||||
|
ptr = *envblk_out = calloc(size_needed, 1);
|
||||||
|
if (!ptr) {
|
||||||
|
free(tmp);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
arrcnt = 0;
|
||||||
|
while (tmp[arrcnt]) {
|
||||||
|
strcpy(ptr, tmp[arrcnt]);
|
||||||
|
ptr += strlen(tmp[arrcnt]) + 1;
|
||||||
|
arrcnt++;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
13
w32/subproc/proc.h
Normal file
13
w32/subproc/proc.h
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#ifndef _PROC_H
|
||||||
|
#define _PROC_H
|
||||||
|
|
||||||
|
typedef int bool_t;
|
||||||
|
|
||||||
|
#define E_SCALL 101
|
||||||
|
#define E_IO 102
|
||||||
|
#define E_NO_MEM 103
|
||||||
|
#define E_FORK 104
|
||||||
|
|
||||||
|
extern bool_t arr2envblk(char **arr, char **envblk_out);
|
||||||
|
|
||||||
|
#endif
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user