diff lwasm/main.c @ 384:38b50ce6967a

Made --list and --depend work
author lost@starbug
date Sat, 15 May 2010 20:46:04 -0600
parents 848d3cca8078
children cf8c92d70eb1
line wrap: on
line diff
--- a/lwasm/main.c	Sat May 15 20:01:58 2010 -0600
+++ b/lwasm/main.c	Sat May 15 20:46:04 2010 -0600
@@ -236,9 +236,23 @@
 			exit(1);
 		}
 	}
-	
-	debug_message(&asmstate, 50, "Doing output");
-	do_output(&asmstate);
+
+	if (asmstate.flags & FLAG_DEPEND)
+	{
+		// output dependencies
+		char *n;
+		
+		while (n = lw_stack_pop(asmstate.includelist))
+		{
+			fprintf(stdout, "%s\n", n);
+			lw_free(n);
+		}
+	}	
+	else
+	{
+		debug_message(&asmstate, 50, "Doing output");
+		do_output(&asmstate);
+	}
 	
 	debug_message(&asmstate, 50, "Done assembly");