shithub: scc

Download patch

ref: 419ebc8cada738e12a89dfe4d47a414b7dde96f3
parent: 03f8c7437ba2ebab0071e163525bdc03770ec082
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Dec 4 13:44:00 EST 2018

[libc] Avoid inclusion of scc headers

--- a/scripts/rules.mk
+++ b/scripts/rules.mk
@@ -9,9 +9,11 @@
 LIBEXEC    = $(PROJECTDIR)/libexec/scc
 CRTDIR     = $(PROJECTDIR)/lib/scc
 
+INCLUDE    = -I$(INCDIR)/scc \
+
 SCC_CFLAGS = $(MORECFLAGS) \
              $(SYSCFLAGS) \
-             -I$(INCDIR)/scc \
+             $(INCLUDE) \
              -g \
              $(CFLAGS)
 
--- a/src/libc/Makefile
+++ b/src/libc/Makefile
@@ -1,8 +1,9 @@
 .POSIX:
+
 PROJECTDIR =../..
 include $(PROJECTDIR)/scripts/rules.mk
+include rules.mk
 
-MORECFLAGS = -I$(INCDIR) -I$(INCDIR)/bits/$(SYS) -I$(INCDIR)/bits/$(ARCH)
 TARGET = $(CRTDIR)/$(ARCH)-$(SYS)/libc.a
 DIRS = arch\
        assert\
--- a/src/libc/arch/Makefile
+++ b/src/libc/arch/Makefile
@@ -1,6 +1,7 @@
 .POSIX:
 PROJECTDIR =../../..
 include $(PROJECTDIR)/scripts/rules.mk
+include ../rules.mk
 
 DIRS = amd64 arm32 arm64
 
--- a/src/libc/arch/amd64/Makefile
+++ b/src/libc/arch/amd64/Makefile
@@ -1,6 +1,7 @@
 .POSIX:
 PROJECTDIR =../../../..
 include $(PROJECTDIR)/scripts/rules.mk
+include ../../rules.mk
 
 OBJS = longjmp.o setjmp.o
 DIRS = netbsd openbsd dragonfly linux
--- a/src/libc/arch/amd64/dragonfly/Makefile
+++ b/src/libc/arch/amd64/dragonfly/Makefile
@@ -1,7 +1,7 @@
 .POSIX:
 PROJECTDIR =../../../../..
 include $(PROJECTDIR)/scripts/rules.mk
-include ../../rules.mk
+include ../../../rules.mk
 
 OBJS  = _Exit.o \
         _close.o \
--- a/src/libc/arch/amd64/linux/Makefile
+++ b/src/libc/arch/amd64/linux/Makefile
@@ -1,7 +1,7 @@
 .POSIX:
 PROJECTDIR =../../../../..
 include $(PROJECTDIR)/scripts/rules.mk
-include ../../rules.mk
+include ../../../rules.mk
 
 OBJS  = _Exit.o \
         _close.o \
--- a/src/libc/arch/amd64/netbsd/Makefile
+++ b/src/libc/arch/amd64/netbsd/Makefile
@@ -1,7 +1,7 @@
 .POSIX:
 PROJECTDIR =../../../../..
 include $(PROJECTDIR)/scripts/rules.mk
-include ../../rules.mk
+include ../../../rules.mk
 
 OBJS  = _Exit.o \
         _close.o \
--- a/src/libc/arch/amd64/openbsd/Makefile
+++ b/src/libc/arch/amd64/openbsd/Makefile
@@ -1,7 +1,7 @@
 .POSIX:
 PROJECTDIR =../../../../..
 include $(PROJECTDIR)/scripts/rules.mk
-include ../../rules.mk
+include ../../../rules.mk
 
 OBJS  = _Exit.o \
         _close.o \
--- a/src/libc/arch/arm32/Makefile
+++ b/src/libc/arch/arm32/Makefile
@@ -1,6 +1,7 @@
 .POSIX:
 PROJECTDIR =../../../..
 include $(PROJECTDIR)/scripts/rules.mk
+include ../../rules.mk
 
 OBJS = longjmp.o setjmp.o
 DIRS = linux
--- a/src/libc/arch/arm32/linux/Makefile
+++ b/src/libc/arch/arm32/linux/Makefile
@@ -1,7 +1,7 @@
 .POSIX:
 PROJECTDIR =../../../../..
 include $(PROJECTDIR)/scripts/rules.mk
-include ../../rules.mk
+include ../../../rules.mk
 
 OBJS  = _Exit.o \
         _close.o \
--- a/src/libc/arch/arm64/Makefile
+++ b/src/libc/arch/arm64/Makefile
@@ -1,6 +1,7 @@
 .POSIX:
 PROJECTDIR =../../../..
 include $(PROJECTDIR)/scripts/rules.mk
+include ../../rules.mk
 
 OBJS = longjmp.o setjmp.o
 DIRS = linux
--- a/src/libc/arch/arm64/linux/Makefile
+++ b/src/libc/arch/arm64/linux/Makefile
@@ -1,7 +1,7 @@
 .POSIX:
 PROJECTDIR =../../../../..
 include $(PROJECTDIR)/scripts/rules.mk
-include ../../rules.mk
+include ../../../rules.mk
 
 OBJS  = _Exit.o \
         _close.o \
--- a/src/libc/arch/rules.mk
+++ /dev/null
@@ -1,6 +1,0 @@
-MORECFLAGS = -w -I$(INCDIR) -I$(INCDIR)/bits/$(SYS) -I$(INCDIR)/bits/$(ARCH)
-
-SYSERRNO = $(INCDIR)/bits/$(SYS)/sys/errno.h
-
-_sys_errlist.c: $(SYSERRNO)
-	../../mkerrstr $(SYSERRNO)
--- a/src/libc/assert/Makefile
+++ b/src/libc/assert/Makefile
@@ -1,8 +1,7 @@
 .POSIX:
 PROJECTDIR =../../..
 include $(PROJECTDIR)/scripts/rules.mk
-
-MORECFLAGS = -w -I$(INCDIR) -I$(INCDIR)/bits/$(SYS) -I$(INCDIR)/bits/$(ARCH)
+include ../rules.mk
 
 OBJS = __assert.o\
        assert.o\
--- a/src/libc/ctype/Makefile
+++ b/src/libc/ctype/Makefile
@@ -1,8 +1,7 @@
 .POSIX:
 PROJECTDIR =../../..
 include $(PROJECTDIR)/scripts/rules.mk
-
-MORECFLAGS = -w -I$(INCDIR) -I$(INCDIR)/bits/$(SYS) -I$(INCDIR)/bits/$(ARCH)
+include ../rules.mk
 
 OBJS = ctype.o\
        isalnum.o\
--- a/src/libc/locale/Makefile
+++ b/src/libc/locale/Makefile
@@ -1,8 +1,7 @@
 .POSIX:
 PROJECTDIR =../../..
 include $(PROJECTDIR)/scripts/rules.mk
-
-MORECFLAGS = -w -I$(INCDIR) -I$(INCDIR)/bits/$(SYS) -I$(INCDIR)/bits/$(ARCH)
+include ../rules.mk
 
 OBJS = localeconv.o\
        setlocale.o\
--- /dev/null
+++ b/src/libc/rules.mk
@@ -1,0 +1,7 @@
+INCLUDE    = -I$(INCDIR) -I$(INCDIR)/bits/$(SYS) -I$(INCDIR)/bits/$(ARCH)
+MORECFLAGS = -w
+
+SYSERRNO = $(INCDIR)/bits/$(SYS)/sys/errno.h
+
+_sys_errlist.c: $(SYSERRNO)
+	../../mkerrstr $(SYSERRNO)
--- a/src/libc/stdio/Makefile
+++ b/src/libc/stdio/Makefile
@@ -1,8 +1,7 @@
 .POSIX:
 PROJECTDIR =../../..
 include $(PROJECTDIR)/scripts/rules.mk
-
-MORECFLAGS = -w -I$(INCDIR) -I$(INCDIR)/bits/$(SYS) -I$(INCDIR)/bits/$(ARCH)
+include ../rules.mk
 
 OBJS = __getc.o\
        __putc.o\
--- a/src/libc/stdlib/Makefile
+++ b/src/libc/stdlib/Makefile
@@ -1,8 +1,7 @@
 .POSIX:
 PROJECTDIR =../../..
 include $(PROJECTDIR)/scripts/rules.mk
-
-MORECFLAGS = -w -I$(INCDIR) -I$(INCDIR)/bits/$(SYS) -I$(INCDIR)/bits/$(ARCH)
+include ../rules.mk
 
 OBJS = abort.o\
        abs.o\
--- a/src/libc/string/Makefile
+++ b/src/libc/string/Makefile
@@ -1,8 +1,7 @@
 .POSIX:
 PROJECTDIR =../../..
 include $(PROJECTDIR)/scripts/rules.mk
-
-MORECFLAGS = -w -I$(INCDIR) -I$(INCDIR)/bits/$(SYS) -I$(INCDIR)/bits/$(ARCH)
+include ../rules.mk
 
 OBJS = memchr.o\
        memcmp.o\
--- a/src/libc/time/Makefile
+++ b/src/libc/time/Makefile
@@ -1,8 +1,7 @@
 .POSIX:
 PROJECTDIR =../../..
 include $(PROJECTDIR)/scripts/rules.mk
-
-MORECFLAGS = -w -I$(INCDIR) -I$(INCDIR)/bits/$(SYS) -I$(INCDIR)/bits/$(ARCH)
+include ../rules.mk
 
 OBJS = _daysyear.o\
        asctime.o\