scc

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

commit b5a123a0a108eef52d9e7df25e63707a55a32b99
parent 95232a91309714fde82840811c7bae6c53dd5778
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 25 Jan 2016 12:08:58 +0100

Make Makefiles even more user friendly

This commit uses a more clean name for scc flags,
and combine them with use flags, which simplifies
all the other rules in the project.

Diffstat:
Mcc1/Makefile | 2+-
Mcc2/Makefile | 2+-
Mconfig.mk | 8++++----
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/cc1/Makefile b/cc1/Makefile @@ -10,7 +10,7 @@ all: cc1 $(OBJS) : cc1.h ../inc/cc.h ../inc/sizes.h arch/$(ARCH)/arch.h cc1: $(OBJS) ../lib/libcc.a - $(CC) $(SLDFLAGS) $(LDFLAGS) $(OBJS) ../lib/libcc.a -o $@ + $(CC) $(SCC_LDFLAGS) $(OBJS) ../lib/libcc.a -o $@ cpp: cc1 ln -f cc1 cpp diff --git a/cc2/Makefile b/cc2/Makefile @@ -16,7 +16,7 @@ error.h: cc2.h awk -f generror cc2.h > $$$$.h && mv $$$$.h $@ cc2: $(OBJS) ../lib/libcc.a - $(CC) $(SLDFLAGS) $(LDFLAGS) $(OBJS) ../lib/libcc.a -o $@ + $(CC) $(SCC_LDFLAGS) $(OBJS) ../lib/libcc.a -o $@ clean: rm -f $(OBJS) diff --git a/config.mk b/config.mk @@ -14,11 +14,11 @@ MANPREFIX = ${PREFIX}/share/man # AR = ar # for Plan9 add -D_SUSV2_SOURCE -DNBOOL -SCFLAGS = -DNDEBUG -Iarch/$(ARCH) -DPREFIX=\""$(PREFIX)"\" -SLDFLAGS = +SCC_CFLAGS = -DNDEBUG -Iarch/$(ARCH) -DPREFIX=\""$(PREFIX)"\" $(CFLAGS) +SCC_LDFLAGS = $(LDFLAGS) .c.o: - $(CC) $(SCFLAGS) $(CFLAGS) -o $@ -c $< + $(CC) $(SCC_CFLAGS) -o $@ -c $< .c: - $(CC) $(SCFLAGS) $(CFLAGS) -o $@ $< + $(CC) $(SCC_CFLAGS) $(SCC_LDFLAGS) -o $@ $<