shithub: scc

Download patch

ref: fbe5607a97aadbcd97103d6c7937a2e5a13ed4c3
parent: 07af36a891fae600532b83aa2b677a8a6041b756
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Thu Oct 7 15:05:09 EDT 2021

build: Add submodule for qbe

Qbe is an external dependency for scc, and to make easy
to bootstrap scc is better to add it like a submodule,
in a way that we can install it at the same time than
any other part of scc.

git/query: bad hash bb16529b34a844c6e15f8837950585761122106e
--- /dev/null
+++ b/.gitmodules
@@ -1,0 +1,3 @@
+[submodule "src/cmd/qbe"]
+	path = src/cmd/qbe
+	url = git://c9x.me/qbe.git
--- a/src/cmd/Makefile
+++ b/src/cmd/Makefile
@@ -1,6 +1,7 @@
 .POSIX:
 
 DIRS   =\
+	qbe\
 	ld\
 	as\
 	cc\
@@ -17,8 +18,20 @@
 	$(BINDIR)/objdump\
 	$(BINDIR)/objcopy\
 	$(BINDIR)/addr2line\
+	$(BINDIR)/qbe\
 
 all: $(TARGET) $(DIRS)
+
+qbe: qbe/.git
+
+qbe/.git:
+	git submodule init qbe
+	git submodule update
+
+qbe/obj/qbe: qbe
+
+$(BINDIR)/qbe: qbe/obj/qbe
+	cp qbe/obj/qbe $@
 
 $(BINDIR)/nm: nm.o $(LIBMACH) $(LIBSCC)
 	$(CC) $(PROJ_LDFLAGS) nm.o -lmach -lscc -o $@