diff lwasm/main.c @ 257:e27279180a73 2.x

Added support for include path to LWASM
author lost
date Tue, 22 Dec 2009 04:53:20 +0000
parents a58f49a77441
children c79b3c88adbc
line wrap: on
line diff
--- a/lwasm/main.c	Tue Dec 22 04:52:59 2009 +0000
+++ b/lwasm/main.c	Tue Dec 22 04:53:20 2009 +0000
@@ -31,6 +31,7 @@
 #include <unistd.h>
 
 #include "lwasm.h"
+#include "util.h"
 
 // external declarations
 extern void lwasm_pass1(asmstate_t *as);
@@ -50,6 +51,11 @@
 	
 	switch (key)
 	{
+	case 'I':
+		as -> includedirs = lwasm_realloc(as -> includedirs, (as -> nincludedirs + 1) * sizeof(char *));
+		as -> includedirs[as -> nincludedirs++] = arg;
+		break;
+
 	case 'o':
 		// output
 		if (as -> outfile)
@@ -166,6 +172,8 @@
 				"Set assembler to 6809 only mode" },
 	{ "6309",		'3',	0,			0,
 				"Set assembler to 6309 mode (default)" },
+	{ "includedir",	'I',	"PATH",			0,
+				"Add entry to include path" },
 	{ 0 }
 };