summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/cwebdir/comm-w2c.ch
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2021-10-11 15:21:35 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2021-10-11 15:21:35 +0000
commit885c6c0a19aea7e3583ab2c03916e1e0a4c04554 (patch)
treee9306a9299e79e1cae2a95a2ce8232876c70c062 /Build/source/texk/web2c/cwebdir/comm-w2c.ch
parent5a9a95dd3cc51469724c8b6f67d4d963ae05b0e5 (diff)
[CWEB] Pre-release candidate 2 for CWEB 4.6.
When the CWEB programs are called with option '-c' (the default), no intermediate output files are created at all. After thoroughly testing these programs, I'll prepare the final release of CWEB 4.6 in the coming weeks (months). git-svn-id: svn://tug.org/texlive/trunk@60728 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/cwebdir/comm-w2c.ch')
-rw-r--r--Build/source/texk/web2c/cwebdir/comm-w2c.ch66
1 files changed, 44 insertions, 22 deletions
diff --git a/Build/source/texk/web2c/cwebdir/comm-w2c.ch b/Build/source/texk/web2c/cwebdir/comm-w2c.ch
index 264d2b2f1e4..0bb4f8b70fc 100644
--- a/Build/source/texk/web2c/cwebdir/comm-w2c.ch
+++ b/Build/source/texk/web2c/cwebdir/comm-w2c.ch
@@ -601,32 +601,15 @@ else {
@ @<Scan arguments and open output files@>=
scan_args();
if (program==ctangle) {
- if ((C_file=fopen(C_file_name,"a"))==NULL)
+ if (check_for_change) @<Open intermediate \CEE/ output file@>@;
+ else if ((C_file=fopen(C_file_name,"wb"))==NULL)
fatal(_("! Cannot open output file "), C_file_name);
@.Cannot open output file@>
- else fclose(C_file); /* Test accessability */
- strcpy(check_file_name,C_file_name);
- if(check_file_name[0]!='\0') {
- char *dot_pos=strrchr(check_file_name,'.');
- if(dot_pos==NULL) strcat(check_file_name,".ttp");
- else strcpy(dot_pos,".ttp");
- }
- if ((C_file=fopen(check_file_name,"wb"))==NULL)
- fatal(_("! Cannot open output file "), check_file_name);
-@.Cannot open output file@>
}
else {
- if ((tex_file=fopen(tex_file_name,"a"))==NULL)
+ if (check_for_change) @<Open intermediate \TEX/ output file@>@;
+ else if ((tex_file=fopen(tex_file_name,"wb"))==NULL)
fatal(_("! Cannot open output file "), tex_file_name);
- else fclose(tex_file); /* Test accessability */
- strcpy(check_file_name,tex_file_name);
- if(check_file_name[0]!='\0') {
- char *dot_pos=strrchr(check_file_name,'.');
- if(dot_pos==NULL) strcat(check_file_name,".wtp");
- else strcpy(dot_pos,".wtp");
- }
- if ((tex_file=fopen(check_file_name,"wb"))==NULL)
- fatal(_("! Cannot open output file "), check_file_name);
}
@z
@@ -664,7 +647,46 @@ string texmf_locale;@/
#endif
char separators[]=SEPARATORS;
-@* Temporary file output. Before we leave the program we have to make
+@* Temporary file output. Most \CEE/ projects are controlled by a \.{Makefile}
+that automatically takes care of the temporal dependecies between the different
+source modules. It may be convenient that \.{CWEB} doesn't create new output
+for all existing files, when there are only changes to some of them. Thus the
+\.{make} process will only recompile those modules where necessary. You can
+activate this feature with the `\.{+c}' command-line option. The idea and basic
+implementation of this mechanism can be found in the program \.{NUWEB} by
+Preston Briggs, to whom credit is due.
+
+@<Open intermediate \CEE/ output file@>= {
+ if ((C_file=fopen(C_file_name,"a"))==NULL)
+ fatal(_("! Cannot open output file "), C_file_name);
+@.Cannot open output file@>
+ else fclose(C_file); /* Test accessability */
+ strcpy(check_file_name,C_file_name);
+ if(check_file_name[0]!='\0') {
+ char *dot_pos=strrchr(check_file_name,'.');
+ if(dot_pos==NULL) strcat(check_file_name,".ttp");
+ else strcpy(dot_pos,".ttp");
+ }
+ if ((C_file=fopen(check_file_name,"wb"))==NULL)
+ fatal(_("! Cannot open output file "), check_file_name);
+}
+
+@ @<Open intermediate \TEX/ output file@>= {
+ if ((tex_file=fopen(tex_file_name,"a"))==NULL)
+ fatal(_("! Cannot open output file "), tex_file_name);
+@.Cannot open output file@>
+ else fclose(tex_file); /* Test accessability */
+ strcpy(check_file_name,tex_file_name);
+ if(check_file_name[0]!='\0') {
+ char *dot_pos=strrchr(check_file_name,'.');
+ if(dot_pos==NULL) strcat(check_file_name,".wtp");
+ else strcpy(dot_pos,".wtp");
+ }
+ if ((tex_file=fopen(check_file_name,"wb"))==NULL)
+ fatal(_("! Cannot open output file "), check_file_name);
+}
+
+@ Before we leave the program we have to make
sure that the output files are correctly written.
@<Remove the temporary file...@>=