70 |
|
|
71 |
/* Keep in sync with include/busybox.h! */ |
/* Keep in sync with include/busybox.h! */ |
72 |
|
|
73 |
puts("/* This is a generated file, don't edit */\n"); |
printf("/* This is a generated file, don't edit */\n\n"); |
74 |
|
|
75 |
printf("#define NUM_APPLETS %u\n", NUM_APPLETS); |
printf("#define NUM_APPLETS %u\n", NUM_APPLETS); |
76 |
if (NUM_APPLETS == 1) { |
if (NUM_APPLETS == 1) { |
77 |
printf("#define SINGLE_APPLET_STR \"%s\"\n", applets[0].name); |
printf("#define SINGLE_APPLET_STR \"%s\"\n", applets[0].name); |
78 |
printf("#define SINGLE_APPLET_MAIN %s_main\n", applets[0].name); |
printf("#define SINGLE_APPLET_MAIN %s_main\n", applets[0].name); |
79 |
} |
} |
80 |
|
printf("\n"); |
81 |
|
|
82 |
puts("\nconst char applet_names[] ALIGN1 = \"\""); |
printf("#ifndef SKIP_definitions\n"); |
83 |
|
printf("const char applet_names[] ALIGN1 = \"\"\n"); |
84 |
for (i = 0; i < NUM_APPLETS; i++) { |
for (i = 0; i < NUM_APPLETS; i++) { |
85 |
printf("\"%s\" \"\\0\"\n", applets[i].name); |
printf("\"%s\" \"\\0\"\n", applets[i].name); |
86 |
if (MAX_APPLET_NAME_LEN < strlen(applets[i].name)) |
if (MAX_APPLET_NAME_LEN < strlen(applets[i].name)) |
87 |
MAX_APPLET_NAME_LEN = strlen(applets[i].name); |
MAX_APPLET_NAME_LEN = strlen(applets[i].name); |
88 |
} |
} |
89 |
puts(";"); |
printf(";\n\n"); |
90 |
|
|
91 |
puts("\nint (*const applet_main[])(int argc, char **argv) = {"); |
printf("#ifndef SKIP_applet_main\n"); |
92 |
|
printf("int (*const applet_main[])(int argc, char **argv) = {\n"); |
93 |
for (i = 0; i < NUM_APPLETS; i++) { |
for (i = 0; i < NUM_APPLETS; i++) { |
94 |
printf("%s_main,\n", applets[i].main); |
printf("%s_main,\n", applets[i].main); |
95 |
} |
} |
96 |
puts("};"); |
printf("};\n"); |
97 |
|
printf("#endif\n\n"); |
98 |
|
|
99 |
puts("const uint16_t applet_nameofs[] ALIGN2 = {"); |
printf("const uint16_t applet_nameofs[] ALIGN2 = {\n"); |
100 |
for (i = 0; i < NUM_APPLETS; i++) { |
for (i = 0; i < NUM_APPLETS; i++) { |
101 |
printf("0x%04x,\n", |
printf("0x%04x,\n", |
102 |
offset[i] |
offset[i] |
109 |
#endif |
#endif |
110 |
); |
); |
111 |
} |
} |
112 |
puts("};"); |
printf("};\n\n"); |
113 |
|
|
114 |
#if ENABLE_FEATURE_INSTALLER |
#if ENABLE_FEATURE_INSTALLER |
115 |
puts("const uint8_t applet_install_loc[] ALIGN1 = {"); |
printf("const uint8_t applet_install_loc[] ALIGN1 = {\n"); |
116 |
i = 0; |
i = 0; |
117 |
while (i < NUM_APPLETS) { |
while (i < NUM_APPLETS) { |
118 |
int v = applets[i].install_loc; /* 3 bits */ |
int v = applets[i].install_loc; /* 3 bits */ |
121 |
printf("0x%02x,\n", v); |
printf("0x%02x,\n", v); |
122 |
i++; |
i++; |
123 |
} |
} |
124 |
puts("};\n"); |
printf("};\n"); |
125 |
#endif |
#endif |
126 |
|
printf("#endif /* SKIP_definitions */\n"); |
127 |
|
printf("\n"); |
128 |
printf("#define MAX_APPLET_NAME_LEN %u\n", MAX_APPLET_NAME_LEN); |
printf("#define MAX_APPLET_NAME_LEN %u\n", MAX_APPLET_NAME_LEN); |
129 |
|
|
130 |
return 0; |
return 0; |