diff lwasm/main.c @ 73:1f77ae5c3590

Added --dependnoerr flag to list dependencies on non-existent files without bailing out; also suppress error reports during dependency generation
author lost@l-w.ca
date Tue, 12 Apr 2011 17:56:51 -0600
parents ceab04fd2969
children ed7f970f3688
line wrap: on
line diff
--- a/lwasm/main.c	Tue Apr 12 14:16:36 2011 -0600
+++ b/lwasm/main.c	Tue Apr 12 17:56:51 2011 -0600
@@ -49,6 +49,7 @@
 	{ "raw",		'r',	0,			0,							"Generate raw binary format output, equivalent of --format=raw"},
 	{ "obj",		0x100,	0,			0,							"Generate proprietary object file format for later linking, equivalent of --format=obj" },
 	{ "depend",		0x101,	0,			0,							"Output a dependency list to stdout; do not do any actual output though assembly is completed as usual" },
+	{ "dependnoerr", 0x102,	0,			0,							"Output a dependency list to stdout; do not do any actual output though assembly is completed as usual; don't bail on missing include files" },
 	{ "pragma",		'p',	"PRAGMA",	0,							"Set an assembler pragma to any value understood by the \"pragma\" pseudo op"},
 	{ "6809",		'9',	0,			0,							"Set assembler to 6809 only mode" },
 	{ "6309",		'3',	0,			0,							"Set assembler to 6309 mode (default)" },
@@ -110,6 +111,10 @@
 		as -> flags |= FLAG_DEPEND;
 		break;
 
+	case 0x102:
+		as -> flags |= FLAG_DEPEND | FLAG_DEPENDNOERR;
+		break;
+
 	case 'f':
 		if (!strcasecmp(arg, "decb"))
 			as -> output_format = OUTPUT_DECB;
@@ -240,6 +245,12 @@
 		
 		if (asmstate.errorcount > 0)
 		{
+			if (asmstate.flags & FLAG_DEPEND)
+			{
+				// don't show errors during dependency scanning but
+				// stop processing immediately
+				break;
+			}
 			lwasm_show_errors(&asmstate);
 			exit(1);
 		}