diff lwasm/main.c @ 224:3864d96ee8c7

Make unicorns notice referenced files better Fix bug related to includebin and also make unicorns notice all files opened through the input subsystem when generating the resource list.
author William Astle <lost@l-w.ca>
date Sun, 15 Jul 2012 20:50:18 -0600
parents 03f7192fcd20
children 7c2c2239ec9c
line wrap: on
line diff
--- a/lwasm/main.c	Sun Jul 15 20:14:51 2012 -0600
+++ b/lwasm/main.c	Sun Jul 15 20:50:18 2012 -0600
@@ -58,7 +58,7 @@
 	{ "includedir",	'I',	"PATH",		0,							"Add entry to include path" },
 	{ "define", 'D', "SYM[=VAL]", 0, "Automatically define SYM to be VAL (or 1)"},
 	{ "preprocess",	'P',	0,			0,							"Preprocess macros and conditionals and output revised source to stdout" },
-	{ "unicorns",	0x4242,	0,			0,							"Add sooper sekrit sauce"},
+	{ "unicorns",	0x142,	0,			0,							"Add sooper sekrit sauce"},
 	{ 0 }
 };
 
@@ -141,7 +141,7 @@
 		as -> flags |= FLAG_DEPEND | FLAG_DEPENDNOERR;
 		break;
 	
-	case 0x4242:
+	case 0x142:
 		as -> flags |= FLAG_UNICORNS;
 		break;
 
@@ -299,16 +299,13 @@
 
 	if (asmstate.flags & FLAG_DEPEND)
 	{
-		if ((asmstate.flags & FLAG_UNICORNS) == 0)
-		{
-			// output dependencies (other than "includebin")
-			char *n;
+		// output dependencies (other than "includebin")
+		char *n;
 		
-			while ((n = lw_stack_pop(asmstate.includelist)))
-			{
-				fprintf(stdout, "%s\n", n);
-				lw_free(n);
-			}
+		while ((n = lw_stack_pop(asmstate.includelist)))
+		{
+			fprintf(stdout, "%s\n", n);
+			lw_free(n);
 		}
 	}	
 	else
@@ -321,6 +318,7 @@
 
 	if (asmstate.flags & FLAG_UNICORNS)
 	{	
+		debug_message(&asmstate, 50, "Invoking unicorns");
 		lwasm_do_unicorns(&asmstate);
 	}
 	else