/* RISC OS little endian ARM machines */

#include <string.h>

#ifndef LCCDIR
#define LCCDIR "LCC:"
#endif

char *suffixes[] = { ".c", ".i", ".s", ".o", "", 0 };
char inputs[256] = "";
char *cpp[] = { LCCDIR "bin/cpp", "-D__STDC__=1",
	"-DLANGUAGE_C", "-D_LANGUAGE_C", "-D__LANGUAGE_C",
	"-D__riscos__", "-D__arm__",
	"$1", "$2", "$3", 0 };
char *com[] =  { LCCDIR "bin/rcc", "-target=arm/riscos", "$1", "$2", "$3",
	0 };
char *include[] = { "-Ilcc:libscl", 0 };
char *as[] =  { LCCDIR "bin/as", "-gcc", "-o", "$3", "$1", "$2", 0 };
char *ld[] =  { LCCDIR "bin/ld", "-o", "$3", "lcc:libscl.libscl.o", "$1", "$2",
	"-Llcc:libscl", "-L" LCCDIR, "-llcc", "", "", 0 };
static char *bbexit = LCCDIR "bbexit.o";

extern char *concat(char *, char *);

int option(char *arg) {
	if (strncmp(arg, "-lccdir=", 8) == 0) {
		cpp[0] = concat(&arg[8], "bin/cpp");
		include[0] = concat("-I", &arg[8]);
		com[0] = concat(&arg[8], "bin/rcc");
		bbexit = concat(&arg[8], "bbexit.o");
	} else if (strcmp(arg, "-b") == 0 && access(bbexit, 4) == 0)
		ld[6] = bbexit;
	else if (strcmp(arg, "-g") == 0);
	else
		return 0;
	return 1;
}
