commit 5ae8cb41158a3af9db313ff45d98c20735231ec9
parent 4506a7ac70b36365f7448c3fe3840550f3230874
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Sun, 24 Jan 2016 10:11:44 +0100
Move PREFIX to config.mk
This prefix needs to be the same for all the toolchain.
Diffstat:
4 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/cc1/cc1.h b/cc1/cc1.h
@@ -1,9 +1,6 @@
#define INPUTSIZ LINESIZ
-#ifndef PREFIX
-#define PREFIX "/usr/"
-#endif
#define GLOBALCTX 0
diff --git a/cc1/cpp.c b/cc1/cpp.c
@@ -11,10 +11,6 @@
#include "arch.h"
#include "cc1.h"
-#ifndef PREFIX
-#define PREFIX "/usr/include/local"
-#endif
-
static char *argp, *macroname;
static unsigned arglen;
static Symbol *symline, *symfile;
diff --git a/config.mk b/config.mk
@@ -8,10 +8,11 @@ ARCH = z80
PREFIX = /usr/local/
MANPREFIX = ${PREFIX}/share/man
-CC = cc
+# if your system is not POSIX maybe you want to use cc or gcc
+CC = c99
LD = $(CC)
AR = ar
# for Plan9 add -D_SUSV2_SOURCE -DNBOOL
-CFLAGS = -DNDEBUG -Iarch/$(ARCH) -O2 -std=c99
+CFLAGS = -DNDEBUG -Iarch/$(ARCH) -DPREFIX=\""$(PREFIX)"\"
LDFLAGS = -s
diff --git a/inc/cc.h b/inc/cc.h
@@ -16,6 +16,10 @@ extern int debug;
#define DBGON()
#endif
+#ifndef PREFIX
+#define PREFIX "/usr/local/"
+#endif
+
extern void die(const char *fmt, ...);
extern void dbg(const char *fmt, ...);
extern void *xmalloc(size_t size);