scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit c72e4f86d583352e5ede355a2b1923a7df615669
parent 61f2ecbb9662397475b8ce43cf8d3a902db3e118
Author: Quentin Rameau <quinq@fifth.space>
Date:   Wed, 11 May 2016 17:40:49 +0200

Add a compile option to chose between C89 and C99

Diffstat:
Mcc1/Makefile | 5++++-
Mcc2/Makefile | 5++++-
Mconfig.mk | 3+++
Rinc/sizes.h -> inc/sizes_c89.h | 0
4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/cc1/Makefile b/cc1/Makefile @@ -7,7 +7,10 @@ OBJS = types.o decl.o lex.o error.o symbol.o main.o expr.o \ all: cc1 -$(OBJS) : cc1.h ../inc/cc.h ../inc/sizes.h arch/$(ARCH)/arch.h +../inc/sizes.h: + cp ../inc/sizes_$(STD).h $@ + +$(OBJS): cc1.h ../inc/cc.h ../inc/sizes.h arch/$(ARCH)/arch.h cc1: $(OBJS) ../lib/libcc.a $(CC) $(SCC_LDFLAGS) $(OBJS) ../lib/libcc.a -o $@ diff --git a/cc2/Makefile b/cc2/Makefile @@ -8,8 +8,11 @@ OBJS = main.o parser.o peep.o symbol.o node.o code.o\ all: cc2 +../inc/sizes.h: + cp ../inc/sizes_$(STD).h $@ + +$(OBJS): cc2.h ../inc/sizes.h -$(OBJS): cc2.h main.o: error.h error.h: cc2.h diff --git a/config.mk b/config.mk @@ -4,6 +4,9 @@ VERSION = 0.1 # Customize below to fit your system ARCH = z80 DRIVER = posix +# Remove inc/sizes.h if STD is changed +# can be c89 or c99 +STD = c89 # paths PREFIX = $(HOME) diff --git a/inc/sizes.h b/inc/sizes_c89.h