commit 5ae8cb41158a3af9db313ff45d98c20735231ec9
Author:     Roberto E. Vargas Caballero <k...@shike2.com>
AuthorDate: Sun Jan 24 10:11:44 2016 +0100
Commit:     Roberto E. Vargas Caballero <k...@shike2.com>
CommitDate: Sun Jan 24 10:11:44 2016 +0100

    Move PREFIX to config.mk
    
    This prefix needs to be the same for all the toolchain.

diff --git a/cc1/cc1.h b/cc1/cc1.h
index efd4f61..5f3fcc7 100644
--- 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
index 2eca5f1..117c366 100644
--- 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
index c989e5f..7c70dc2 100644
--- 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
index bcab69e..3f15316 100644
--- 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);

Reply via email to