fix ./msc xxx -o yyy

This commit is contained in:
lyon 2022-10-24 00:27:11 +08:00
parent 3fbbd94e5a
commit f507182d3f
2 changed files with 12 additions and 10 deletions

View File

@ -59,6 +59,7 @@ int main(int argc, char** argv) {
/* example ./rust-msc-latest-linux main.py -o out.a */ /* example ./rust-msc-latest-linux main.py -o out.a */
if (3 == parc) { if (3 == parc) {
if (0 == strcmp(argv[2], "-o")) {
PikaMaker* maker = New_PikaMaker(); PikaMaker* maker = New_PikaMaker();
char* module_entry = argv[1]; char* module_entry = argv[1];
/* remove subfix */ /* remove subfix */
@ -67,10 +68,11 @@ int main(int argc, char** argv) {
*subfix = '\0'; *subfix = '\0';
} }
pikaMaker_compileModuleWithDepends(maker, module_entry); pikaMaker_compileModuleWithDepends(maker, module_entry);
pikaMaker_linkCompiledModules(maker, argv[2]); pikaMaker_linkCompiledModules(maker, argv[3]);
obj_deinit(maker); obj_deinit(maker);
return 0; return 0;
} }
}
/* example: ./rust-msc-latest-linux -c main.py */ /* example: ./rust-msc-latest-linux -c main.py */
if (2 == parc) { if (2 == parc) {