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 | |
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>
-rw-r--r-- | applets/Kbuild.src | 2 | ||||
-rw-r--r-- | applets/applet_tables.c | 24 | ||||
-rw-r--r-- | libbb/appletlib.c | 2 | ||||
-rw-r--r-- | shell/ash.c | 4 | ||||
-rw-r--r-- | shell/hush.c | 4 |
5 files changed, 26 insertions, 10 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 | } |
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index f3d530184..58f1a9490 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -61,7 +61,7 @@ | |||
61 | static const char usage_messages[] ALIGN1 = UNPACKED_USAGE; | 61 | static const char usage_messages[] ALIGN1 = UNPACKED_USAGE; |
62 | #else | 62 | #else |
63 | # define usage_messages 0 | 63 | # define usage_messages 0 |
64 | #endif /* SHOW_USAGE */ | 64 | #endif |
65 | 65 | ||
66 | #if ENABLE_FEATURE_COMPRESS_USAGE | 66 | #if ENABLE_FEATURE_COMPRESS_USAGE |
67 | 67 | ||
diff --git a/shell/ash.c b/shell/ash.c index 1f8f90a09..cfd8154ef 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -50,9 +50,7 @@ | |||
50 | # define CLEAR_RANDOM_T(rnd) ((void)0) | 50 | # define CLEAR_RANDOM_T(rnd) ((void)0) |
51 | #endif | 51 | #endif |
52 | 52 | ||
53 | #define SKIP_definitions 1 | 53 | #include "NUM_APPLETS.h" |
54 | #include "applet_tables.h" | ||
55 | #undef SKIP_definitions | ||
56 | #if NUM_APPLETS == 1 | 54 | #if NUM_APPLETS == 1 |
57 | /* STANDALONE does not make sense, and won't compile */ | 55 | /* STANDALONE does not make sense, and won't compile */ |
58 | # undef CONFIG_FEATURE_SH_STANDALONE | 56 | # undef CONFIG_FEATURE_SH_STANDALONE |
diff --git a/shell/hush.c b/shell/hush.c index e64c923b4..29ff3c442 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -128,9 +128,7 @@ | |||
128 | # define USE_FOR_MMU(...) | 128 | # define USE_FOR_MMU(...) |
129 | #endif | 129 | #endif |
130 | 130 | ||
131 | #define SKIP_definitions 1 | 131 | #include "NUM_APPLETS.h" |
132 | #include "applet_tables.h" | ||
133 | #undef SKIP_definitions | ||
134 | #if NUM_APPLETS == 1 | 132 | #if NUM_APPLETS == 1 |
135 | /* STANDALONE does not make sense, and won't compile */ | 133 | /* STANDALONE does not make sense, and won't compile */ |
136 | # undef CONFIG_FEATURE_SH_STANDALONE | 134 | # undef CONFIG_FEATURE_SH_STANDALONE |