mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 02:32:06 +00:00
Merge branch 'makedepend'
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
@@ -26,6 +26,9 @@ ULONG nTotalLines, nPass, nPC, nIFDepth, nErrors;
|
||||
|
||||
extern int yydebug;
|
||||
|
||||
FILE *dependfile;
|
||||
extern char *tzObjectname;
|
||||
|
||||
/*
|
||||
* Option stack
|
||||
*/
|
||||
@@ -274,7 +277,7 @@ usage(void)
|
||||
{
|
||||
printf(
|
||||
"Usage: rgbasm [-hvE] [-b chars] [-Dname[=value]] [-g chars] [-i path]\n"
|
||||
" [-o outfile] [-p pad_value] file.asm\n");
|
||||
" [-M dependfile] [-o outfile] [-p pad_value] file.asm\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -288,6 +291,8 @@ main(int argc, char *argv[])
|
||||
|
||||
char *tzMainfile;
|
||||
|
||||
dependfile = NULL;
|
||||
|
||||
cldefines_size = 32;
|
||||
cldefines = reallocarray(cldefines, cldefines_size,
|
||||
2 * sizeof(void *));
|
||||
@@ -317,7 +322,7 @@ main(int argc, char *argv[])
|
||||
|
||||
newopt = CurrentOptions;
|
||||
|
||||
while ((ch = getopt(argc, argv, "b:D:g:hi:o:p:vEw")) != -1) {
|
||||
while ((ch = getopt(argc, argv, "b:D:g:hi:M:o:p:vEw")) != -1) {
|
||||
switch (ch) {
|
||||
case 'b':
|
||||
if (strlen(optarg) == 2) {
|
||||
@@ -348,6 +353,11 @@ main(int argc, char *argv[])
|
||||
case 'i':
|
||||
fstk_AddIncludePath(optarg);
|
||||
break;
|
||||
case 'M':
|
||||
if ((dependfile = fopen(optarg, "w")) == NULL) {
|
||||
err(1, "Could not open dependfile %s", optarg);
|
||||
}
|
||||
break;
|
||||
case 'o':
|
||||
out_SetFileName(optarg);
|
||||
break;
|
||||
@@ -392,6 +402,10 @@ main(int argc, char *argv[])
|
||||
printf("Assembling %s\n", tzMainfile);
|
||||
}
|
||||
|
||||
if (dependfile) {
|
||||
fprintf(dependfile, "%s: %s\n", tzObjectname, tzMainfile);
|
||||
}
|
||||
|
||||
nStartClock = clock();
|
||||
|
||||
nLineNo = 1;
|
||||
|
||||
Reference in New Issue
Block a user