diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-06-26 02:40:08 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-06-26 02:40:08 +0200 |
commit | 1fcbff2fac490f5665fc1ed13ddad766a8879f3b (patch) | |
tree | eb2de3837812e53b1adf999fc2f01529dc9c0d28 /applets | |
parent | 918f444f9012ca22d696020dff116844400d37d2 (diff) | |
download | busybox-w32-1fcbff2fac490f5665fc1ed13ddad766a8879f3b.tar.gz busybox-w32-1fcbff2fac490f5665fc1ed13ddad766a8879f3b.tar.bz2 busybox-w32-1fcbff2fac490f5665fc1ed13ddad766a8879f3b.zip |
build system: do not rebuild ash and hush on any change to any .c file
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'applets')
-rw-r--r-- | applets/Kbuild.src | 2 | ||||
-rw-r--r-- | applets/applet_tables.c | 24 |
2 files changed, 23 insertions, 3 deletions
diff --git a/applets/Kbuild.src b/applets/Kbuild.src index e3bac9681..31fee8d1e 100644 --- a/applets/Kbuild.src +++ b/applets/Kbuild.src | |||
@@ -38,7 +38,7 @@ include/usage_compressed.h: applets/usage $(srctree_slash)applets/usage_compress | |||
38 | $(call cmd,gen_usage_compressed) | 38 | $(call cmd,gen_usage_compressed) |
39 | 39 | ||
40 | quiet_cmd_gen_applet_tables = GEN include/applet_tables.h | 40 | quiet_cmd_gen_applet_tables = GEN include/applet_tables.h |
41 | cmd_gen_applet_tables = applets/applet_tables include/applet_tables.h | 41 | cmd_gen_applet_tables = applets/applet_tables include/applet_tables.h include/NUM_APPLETS.h |
42 | 42 | ||
43 | include/applet_tables.h: applets/applet_tables | 43 | include/applet_tables.h: applets/applet_tables |
44 | $(call cmd,gen_applet_tables) | 44 | $(call cmd,gen_applet_tables) |
diff --git a/applets/applet_tables.c b/applets/applet_tables.c index e48be4682..338dc20f9 100644 --- a/applets/applet_tables.c +++ b/applets/applet_tables.c | |||
@@ -79,7 +79,7 @@ int main(int argc, char **argv) | |||
79 | } | 79 | } |
80 | printf("\n"); | 80 | printf("\n"); |
81 | 81 | ||
82 | printf("#ifndef SKIP_definitions\n"); | 82 | //printf("#ifndef SKIP_definitions\n"); |
83 | printf("const char applet_names[] ALIGN1 = \"\"\n"); | 83 | printf("const char applet_names[] ALIGN1 = \"\"\n"); |
84 | for (i = 0; i < NUM_APPLETS; i++) { | 84 | for (i = 0; i < NUM_APPLETS; i++) { |
85 | printf("\"%s\" \"\\0\"\n", applets[i].name); | 85 | printf("\"%s\" \"\\0\"\n", applets[i].name); |
@@ -123,9 +123,29 @@ int main(int argc, char **argv) | |||
123 | } | 123 | } |
124 | printf("};\n"); | 124 | printf("};\n"); |
125 | #endif | 125 | #endif |
126 | printf("#endif /* SKIP_definitions */\n"); | 126 | //printf("#endif /* SKIP_definitions */\n"); |
127 | printf("\n"); | 127 | printf("\n"); |
128 | printf("#define MAX_APPLET_NAME_LEN %u\n", MAX_APPLET_NAME_LEN); | 128 | printf("#define MAX_APPLET_NAME_LEN %u\n", MAX_APPLET_NAME_LEN); |
129 | 129 | ||
130 | if (argv[2]) { | ||
131 | char line_old[80]; | ||
132 | char line_new[80]; | ||
133 | FILE *fp; | ||
134 | |||
135 | line_old[0] = 0; | ||
136 | fp = fopen(argv[2], "r"); | ||
137 | if (fp) { | ||
138 | fgets(line_old, sizeof(line_old), fp); | ||
139 | fclose(fp); | ||
140 | } | ||
141 | sprintf(line_new, "#define NUM_APPLETS %u\n", NUM_APPLETS); | ||
142 | if (strcmp(line_old, line_new) != 0) { | ||
143 | fp = fopen(argv[2], "w"); | ||
144 | if (!fp) | ||
145 | return 1; | ||
146 | fputs(line_new, fp); | ||
147 | } | ||
148 | } | ||
149 | |||
130 | return 0; | 150 | return 0; |
131 | } | 151 | } |