ref: cac66e2141e706818050206cb6d20f246209cf1a
parent: a115b80c0660473027f0a4ae009b7534e8d5f8d8
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sun Aug 19 07:57:51 EDT 2018
Add standard flags always
--- a/ar/Makefile
+++ b/ar/Makefile
@@ -4,8 +4,9 @@
include $(PROJECTDIR)/rules.mk
include $(LIBSCC)/libdep.mk
-OBJ = main.o $(DRIVER)/driver.o
+OBJ = main.o $(DRIVER)/driver.o
MORECFLAGS = -I$(DRIVER)
+STDCFLAGS =
all: $(BINDIR)/ar
--- a/as/Makefile
+++ b/as/Makefile
@@ -5,7 +5,7 @@
include $(LIBSCC)/libdep.mk
OBJ = main.o symbol.o ins.o parser.o expr.o myro.o
-MORECFLAGS = -I$(INCDIR)/$(STD) $(STDCFLAGS)
+MORECFLAGS = -I$(INCDIR)/$(STD)
TARGETS = $(LIBEXEC)/as-amd64 $(LIBEXEC)/as-i386 \
$(LIBEXEC)/as-i286 $(LIBEXEC)/as-z80
--- a/as/deps.mk
+++ b/as/deps.mk
@@ -1,3 +1,4 @@
+parser.o: $(PROJECTDIR)/inc/$(STD)/cstd.h
#deps
expr.o: ../inc/scc.h
--- a/cc1/Makefile
+++ b/cc1/Makefile
@@ -5,7 +5,7 @@
include $(PROJECTDIR)/rules.mk
include $(LIBSCC)/libdep.mk
-MORECFLAGS = -I$(INCDIR)/$(STD) $(STDCFLAGS)
+MORECFLAGS = -I$(INCDIR)/$(STD)
OBJ = types.o decl.o lex.o error.o symbol.o main.o expr.o \
code.o stmt.o cpp.o fold.o init.o builtin.o
--- a/cc2/Makefile
+++ b/cc2/Makefile
@@ -4,7 +4,7 @@
include $(PROJECTDIR)/rules.mk
include $(LIBSCC)/libdep.mk
-MORECFLAGS = -I$(PROJECTDIR)/inc/$(STD) $(STDCFLAGS)
+MORECFLAGS = -I$(PROJECTDIR)/inc/$(STD)
OBJ = main.o parser.o peep.o symbol.o node.o code.o optm.o
--- a/driver/posix/Makefile
+++ b/driver/posix/Makefile
@@ -11,6 +11,8 @@
SYSLST = amd64-sysv-linux-elf z80-scc-none-none \
i386-sysv-linux-elf amd64-sysv-openbsd-elf
+STDCFLAGS =
+
TARGETS = $(BINDIR)/scc $(BINDIR)/scpp
all: $(TARGETS)
--- a/lib/coff32/Makefile
+++ b/lib/coff32/Makefile
@@ -5,8 +5,6 @@
include $(PROJECTDIR)/rules.mk
include objlst.mk
-MORECFLAGS = $(STDCFLAGS)
-
all: libcoff32.a
libcoff32.a: $(LIBCOFF32-OBJ)
--- a/lib/scc/Makefile
+++ b/lib/scc/Makefile
@@ -4,8 +4,6 @@
include $(PROJECTDIR)/rules.mk
include objlst.mk
-MORECFLAGS = $(STDCFLAGS)
-
all: libscc.a
libscc.a: $(LIBSCC-OBJ)
--- a/nm/Makefile
+++ b/nm/Makefile
@@ -4,8 +4,6 @@
include $(PROJECTDIR)/rules.mk
include $(LIBSCC)/libdep.mk
-MORECFLAGS = $(STDCFLAGS)
-
OBJ = main.o coff32.o formats.o
all: $(BINDIR)/nm
--- a/objdump/Makefile
+++ b/objdump/Makefile
@@ -5,7 +5,6 @@
include $(LIBSCC)/libdep.mk
OBJ = main.o
-MORECFLAGS = $(STDCFLAGS)
all: $(BINDIR)/objdump
--- a/rules.mk
+++ b/rules.mk
@@ -6,7 +6,7 @@
LIBSCC = $(PROJECTDIR)/lib/scc
LIBCOFF32 = $(PROJECTDIR)/lib/coff32
-SCC_CFLAGS = $(MORECFLAGS) $(SYSCFLAGS) -g $(CFLAGS)
+SCC_CFLAGS = $(MORECFLAGS) $(SYSCFLAGS) $(STDCFLAGS) -g $(CFLAGS)
SCC_LDFLAGS = $(MORELFLAGS) -L$(LIBSCC) -g $(LDFLAGS)