scc

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

commit 186c076403b545365d3c8b1a9bfd8fa9d24fcac5
parent 14e42234afd219c5d4fd4afd03509cf67cdc5145
Author: Lucas Gabriel Vuotto <lvuotto92@gmail.com>
Date:   Wed, 23 Aug 2017 12:36:50 -0300

Fix build in OpenBSD

$(LIB-OBJ) wasn't expanding because it was defined after the rule
libcc.a was used. The include of libdep.mk was added to the end
to avoid having the rule defined in it as the default rule in
the makefile, but with this change this is not a problem anymore.

Signed-off-by: Lucas Gabriel Vuotto <lvuotto92@gmail.com>

Diffstat:
cc1/Makefile | 4++--
cc2/Makefile | 4++--
driver/posix/Makefile | 5++---
lib/cc/Makefile | 7+++----
lib/cc/libdep.mk | 2--
5 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/cc1/Makefile b/cc1/Makefile @@ -4,10 +4,11 @@ # Makefile is only used as a template for makefile. # If you modify Makefile remember to run make dep +LIBDIR = ../lib/cc include ../config.mk +include $(LIBDIR)/libdep.mk MOREFLAGS = -I../inc/$(STD) -LIBDIR = ../lib/cc 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 @@ -34,4 +35,3 @@ clean: distclean: clean rm -f makefile -include ../lib/cc/libdep.mk diff --git a/cc2/Makefile b/cc2/Makefile @@ -4,10 +4,11 @@ # Makefile is only used as a template for makefile. # If you modify Makefile remember to run make dep +LIBDIR = ../lib/cc include ../config.mk +include $(LIBDIR)/libdep.mk MOREFLAGS = -I../inc/$(STD) -LIBDIR = ../lib/cc OBJ = main.o parser.o peep.o symbol.o node.o code.o optm.o HDR = cc2.h ../inc/$(STD)/cstd.h ../inc/cc.h @@ -36,4 +37,3 @@ clean: distclean: clean rm -f makefile -include ../lib/cc/libdep.mk diff --git a/driver/posix/Makefile b/driver/posix/Makefile @@ -1,9 +1,9 @@ # See LICENSE file for copyright and license details. .POSIX: -include ../../config.mk - LIBDIR = ../../lib/cc +include ../../config.mk +include $(LIBDIR)/libdep.mk OBJ = scc.o HDR = config.h \ @@ -43,4 +43,3 @@ clean: distclean: clean rm -f config.h -include ../../lib/cc/libdep.mk diff --git a/lib/cc/Makefile b/lib/cc/Makefile @@ -1,13 +1,13 @@ # See LICENSE file for copyright and license details. .POSIX: -include ../../config.mk - LIBDIR = ./ +include ../../config.mk +include libdep.mk all: libcc.a -libcc.a: +libcc.a: $(LIB-OBJ) ar $(ARFLAGS) $@ $? ranlib $@ @@ -17,4 +17,3 @@ clean: rm -f *.o *.a distclean: clean -include libdep.mk diff --git a/lib/cc/libdep.mk b/lib/cc/libdep.mk @@ -6,5 +6,3 @@ LIB-OBJ = $(LIBDIR)/debug.o \ $(LIBDIR)/xmalloc.o \ $(LIBDIR)/xrealloc.o \ $(LIBDIR)/xstrdup.o \ - -$(LIBDIR)/libcc.a: $(LIB-OBJ)