mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
replace linkfile functionality with command-line options
Instead of running: $ xlink linkfile.txt where the linkfile looks like: --- [Objects] foo.o bar.o [Libraries] foo.l bar.l [Output] baz.gb --- we now do: $ xlink -o baz.gb -l foo.l -l bar.l foo.o bar.o
This commit is contained in:
@@ -118,19 +118,23 @@ main(int argc, char *argv[])
|
||||
int ch;
|
||||
char *ep;
|
||||
|
||||
SLONG argn = 0;
|
||||
|
||||
if (argc == 1)
|
||||
usage();
|
||||
|
||||
while ((ch = getopt(argc, argv, "m:n:s:t:z:")) != -1) {
|
||||
while ((ch = getopt(argc, argv, "l:m:n:o:s:t:z:")) != -1) {
|
||||
switch (ch) {
|
||||
case 'l':
|
||||
lib_Readfile(optarg);
|
||||
break;
|
||||
case 'm':
|
||||
SetMapfileName(optarg);
|
||||
break;
|
||||
case 'n':
|
||||
SetSymfileName(optarg);
|
||||
break;
|
||||
case 'o':
|
||||
out_Setname(optarg);
|
||||
break;
|
||||
case 's':
|
||||
options |= OPT_SMART_C_LINK;
|
||||
strcpy(smartlinkstartsymbol, optarg);
|
||||
@@ -171,16 +175,18 @@ main(int argc, char *argv[])
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (argc == 1) {
|
||||
ProcessLinkfile(argv[argc - 1]);
|
||||
if (argc == 0)
|
||||
usage();
|
||||
|
||||
for (int i = 0; i < argc; ++i)
|
||||
obj_Readfile(argv[i]);
|
||||
|
||||
AddNeededModules();
|
||||
AssignSections();
|
||||
CreateSymbolTable();
|
||||
Patch();
|
||||
Output();
|
||||
CloseMapfile();
|
||||
} else
|
||||
usage();
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user