shithub: scc

Download patch

ref: f9f461db2531e5034f729c784bf7ad9dd0cdeaa3
parent: 348cbf56cdf4a39bf18b451ecd32e2df57b86fb1
author: Roberto E. Vargas Caballero <[email protected]>
date: Fri Feb 13 12:20:50 EST 2015

Remove the -I flag in the compilation process

This flag is not needed at all because we can use the route
to the inclussion file. The content of "" or <> is totally
dependant of the compiler, so we are not reducing the
portability at all.

--- a/cc1/Makefile
+++ b/cc1/Makefile
@@ -2,7 +2,7 @@
 OBJS = types.o decl.o lex.o error.o symbol.o main.o expr.o \
 	code.o stmt.o
 
-CPPFLAGS = -I../inc
+CPPFLAGS =
 LDFLAGS = -L../lib
 LIBS = -lcc
 
--- a/cc1/code.c
+++ b/cc1/code.c
@@ -3,7 +3,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <cc.h>
+#include "../inc/cc.h"
 #include "cc1.h"
 
 #define SYM(s) ((union unode) {.sym = s})
--- a/cc1/decl.c
+++ b/cc1/decl.c
@@ -3,8 +3,8 @@
 #include <stdint.h>
 #include <string.h>
 
-#include <sizes.h>
-#include <cc.h>
+#include "../inc/sizes.h"
+#include "../inc/cc.h"
 #include "cc1.h"
 
 #define ID_EXPECTED     1
--- a/cc1/error.c
+++ b/cc1/error.c
@@ -4,7 +4,7 @@
 #include <stdint.h>
 #include <stdio.h>
 
-#include <cc.h>
+#include "../inc/cc.h"
 #include "cc1.h"
 
 extern unsigned linenum;
--- a/cc1/expr.c
+++ b/cc1/expr.c
@@ -2,7 +2,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <cc.h>
+#include "../inc/cc.h"
 #include "cc1.h"
 
 static Symbol *zero, *one;
--- a/cc1/lex.c
+++ b/cc1/lex.c
@@ -5,8 +5,8 @@
 #include <string.h>
 #include <ctype.h>
 
-#include <sizes.h>
-#include <cc.h>
+#include "../inc/sizes.h"
+#include "../inc/cc.h"
 #include "cc1.h"
 
 static FILE *yyin;
--- a/cc1/main.c
+++ b/cc1/main.c
@@ -2,7 +2,7 @@
 #include <stdint.h>
 #include <stdio.h>
 
-#include <cc.h>
+#include "../inc/cc.h"
 #include "cc1.h"
 
 extern void init_keywords(void),
--- a/cc1/stmt.c
+++ b/cc1/stmt.c
@@ -3,7 +3,7 @@
 #include <stdint.h>
 #include <stdio.h>
 
-#include <cc.h>
+#include "../inc/cc.h"
 #include "cc1.h"
 
 struct scase {
--- a/cc1/symbol.c
+++ b/cc1/symbol.c
@@ -4,7 +4,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <cc.h>
+#include "../inc/cc.h"
 #include "cc1.h"
 
 #define NR_SYM_HASH 32
--- a/cc1/types.c
+++ b/cc1/types.c
@@ -4,8 +4,8 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <sizes.h>
-#include <cc.h>
+#include "../inc/sizes.h"
+#include "../inc/cc.h"
 #include "cc1.h"
 
 #define NR_TYPE_HASH 16
--- a/cc2/Makefile
+++ b/cc2/Makefile
@@ -1,7 +1,7 @@
 
 OBJS = main.o parser.o cgen.o code.o optm.o
 
-CPPFLAGS = -I../inc
+CPPFLAGS =
 LDFLAGS = -L../lib
 LIBS = -lcc
 
--- a/cc2/cgen.c
+++ b/cc2/cgen.c
@@ -4,7 +4,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 
-#include <cc.h>
+#include "../inc/cc.h"
 #include "cc2.h"
 
 #include <stdio.h>
--- a/cc2/code.c
+++ b/cc2/code.c
@@ -5,7 +5,7 @@
 #include <stdint.h>
 #include <stdio.h>
 
-#include <cc.h>
+#include "../inc/cc.h"
 #include "cc2.h"
 
 
--- a/cc2/main.c
+++ b/cc2/main.c
@@ -4,7 +4,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <cc.h>
+#include "../inc/cc.h"
 
 #include "cc2.h"
 #include "error.h"
--- a/cc2/optm.c
+++ b/cc2/optm.c
@@ -2,7 +2,7 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#include <cc.h>
+#include "../inc/cc.h"
 #include "cc2.h"
 
 
--- a/cc2/parser.c
+++ b/cc2/parser.c
@@ -5,8 +5,8 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <cc.h>
-#include <sizes.h>
+#include "../inc/cc.h"
+#include "../inc/sizes.h"
 
 #include "cc2.h"
 
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -1,6 +1,5 @@
 
 OBJS = die.o xcalloc.o xmalloc.o xrealloc.o xstrdup.o
-CPPFLAGS = -I../inc
 
 all: libcc.a($(OBJS))
 
--- a/lib/die.c
+++ b/lib/die.c
@@ -3,7 +3,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-#include <cc.h>
+#include "../inc/cc.h"
 
 void
 die(const char *fmt, ...)
--- a/lib/xcalloc.c
+++ b/lib/xcalloc.c
@@ -1,6 +1,6 @@
 
 #include <stdlib.h>
-#include <cc.h>
+#include "../inc/cc.h"
 
 void *
 xcalloc(size_t n, size_t size)
--- a/lib/xmalloc.c
+++ b/lib/xmalloc.c
@@ -1,6 +1,6 @@
 
 #include <stdlib.h>
-#include <cc.h>
+#include "../inc/cc.h"
 
 void *
 xmalloc(size_t size)
--- a/lib/xrealloc.c
+++ b/lib/xrealloc.c
@@ -1,6 +1,6 @@
 
 #include <stdlib.h>
-#include <cc.h>
+#include "../inc/cc.h"
 
 void *
 xrealloc(void *buff, register size_t size)
--- a/lib/xstrdup.c
+++ b/lib/xstrdup.c
@@ -1,6 +1,6 @@
 
 #include <string.h>
-#include <cc.h>
+#include "../inc/cc.h"
 
 char *
 xstrdup(const char *s)