aboutsummaryrefslogtreecommitdiff
path: root/applets/applet_tables.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-08-23 20:21:36 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2016-08-23 20:21:36 +0200
commit0dddbc1a59795a77679d8c5ef48a2795cb470563 (patch)
treec0b9b3895f4cb4710d26111237f782d34459c10b /applets/applet_tables.c
parent29483ffb075f1a64d2183ebe188b83f5704ba637 (diff)
downloadbusybox-w32-0dddbc1a59795a77679d8c5ef48a2795cb470563.tar.gz
busybox-w32-0dddbc1a59795a77679d8c5ef48a2795cb470563.tar.bz2
busybox-w32-0dddbc1a59795a77679d8c5ef48a2795cb470563.zip
build system: always rewrite NUM_APPLETS.h
Conditional rewrite can keep NUM_APPLETS.h mtime old, this causes make to try to regenerate it at every invocation. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'applets/applet_tables.c')
-rw-r--r--applets/applet_tables.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/applets/applet_tables.c b/applets/applet_tables.c
index 8401a1549..ef911a43b 100644
--- a/applets/applet_tables.c
+++ b/applets/applet_tables.c
@@ -192,27 +192,28 @@ int main(int argc, char **argv)
192 printf("};\n"); 192 printf("};\n");
193#endif 193#endif
194 //printf("#endif /* SKIP_definitions */\n"); 194 //printf("#endif /* SKIP_definitions */\n");
195
195// printf("\n"); 196// printf("\n");
196// printf("#define MAX_APPLET_NAME_LEN %u\n", MAX_APPLET_NAME_LEN); 197// printf("#define MAX_APPLET_NAME_LEN %u\n", MAX_APPLET_NAME_LEN);
197 198
198 if (argv[2]) { 199 if (argv[2]) {
199 char line_old[80];
200 char line_new[80];
201 FILE *fp; 200 FILE *fp;
201 char line_new[80];
202// char line_old[80];
202 203
203 line_old[0] = 0;
204 fp = fopen(argv[2], "r");
205 if (fp) {
206 fgets(line_old, sizeof(line_old), fp);
207 fclose(fp);
208 }
209 sprintf(line_new, "#define NUM_APPLETS %u\n", NUM_APPLETS); 204 sprintf(line_new, "#define NUM_APPLETS %u\n", NUM_APPLETS);
210 if (strcmp(line_old, line_new) != 0) { 205// line_old[0] = 0;
206// fp = fopen(argv[2], "r");
207// if (fp) {
208// fgets(line_old, sizeof(line_old), fp);
209// fclose(fp);
210// }
211// if (strcmp(line_old, line_new) != 0) {
211 fp = fopen(argv[2], "w"); 212 fp = fopen(argv[2], "w");
212 if (!fp) 213 if (!fp)
213 return 1; 214 return 1;
214 fputs(line_new, fp); 215 fputs(line_new, fp);
215 } 216// }
216 } 217 }
217 218
218 return 0; 219 return 0;