shithub: scc

Download patch

ref: 9478b030c2bbf311afc73b119177f14cd8f8e545
parent: d551e92f989a1c010e684f6d9f1ee07539c836a5
author: Roberto E. Vargas Caballero <[email protected]>
date: Thu Sep 21 05:03:24 EDT 2017

Move library geneartion rule to libdep.mk

In this way this rule is known by all the interested makefiles.
To avoid having the library rule as default a single all: is
added.

--- a/as/Makefile
+++ b/as/Makefile
@@ -15,9 +15,6 @@
 as: $(OBJ)
 	$(CC) $(SCC_LDFLAGS) $(OBJ) -lscc -o $@
 
-$(LIBDIR)/libscc.a: $(LIB-OBJ)
-	cd $(LIBDIR) && $(MAKE)
-
 dep: ../config.mk Makefile
 	./gendep.sh $(TARGETS)
 	touch dep
--- a/cc1/Makefile
+++ b/cc1/Makefile
@@ -18,9 +18,6 @@
 	mkdir -p ../rootdir/libexec/scc/
 	cp cc1-* ../rootdir/libexec/scc/
 
-$(LIBDIR)/libscc.a: $(LIB-OBJ)
-	cd $(LIBDIR) && $(MAKE)
-
 dep: ../config.mk Makefile
 	./gendep.sh $(TARGETS)
 	touch dep
--- a/cc2/Makefile
+++ b/cc2/Makefile
@@ -20,9 +20,6 @@
 	MKQBE=${MKQBE} ./gendep.sh $(TARGETS)
 	touch dep
 
-$(LIBDIR)/libscc.a: $(LIB-OBJ)
-	cd $(LIBDIR) && $(MAKE)
-
 main.o: error.h
 
 error.h: cc2.h
--- a/lib/scc/libdep.mk
+++ b/lib/scc/libdep.mk
@@ -6,3 +6,8 @@
           $(LIBDIR)/xrealloc.o \
           $(LIBDIR)/xstrdup.o \
           $(LIBDIR)/alloc.o \
+
+all:
+
+$(LIBDIR)/libscc.a: $(LIB-OBJ)
+	cd $(LIBDIR) && $(MAKE)