diff lwasm/input.c @ 186:1824cabf25ce

Various enhancements to lwasm
author lost@l-w.ca
date Thu, 22 Dec 2011 18:04:13 -0700
parents a88b04ba5ab8
children afd50d6b4113
line wrap: on
line diff
--- a/lwasm/input.c	Thu Dec 22 18:03:38 2011 -0700
+++ b/lwasm/input.c	Thu Dec 22 18:04:13 2011 -0700
@@ -264,6 +264,8 @@
 	{
 		/* absolute path */
 		debug_message(as, 2, "Open file (st abs) %s", s);
+		if (as -> flags & FLAG_DEPEND)
+			printf("%s\n", s);
 		fp = fopen(s, "rb");
 		if (!fp)
 		{
@@ -279,6 +281,8 @@
 	fp = fopen(p2, "rb");
 	if (fp)
 	{
+		if (as -> flags & FLAG_DEPEND)
+			printf("%s\n", p2);
 		lw_free(p2);
 		return fp;
 	}
@@ -293,12 +297,23 @@
 		fp = fopen(p2, "rb");
 		if (fp)
 		{
+			if (as -> flags & FLAG_DEPEND)
+				printf("%s\n", p2);
 			lw_free(p2);
 			return fp;
 		}
 		lw_free(p2);
 		lw_stringlist_next(as -> include_list);
 	}
+
+	// last ditch output for dependencies
+	if (as -> flags & FLAG_DEPEND)
+	{
+		p = lw_stack_top(as -> file_dir);
+		p2 = make_filename(p ? p : "", s);
+		printf("%s\n", p2);
+		lw_free(p2);
+	}
 	
 	return NULL;
 }