aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--Makefile5
-rw-r--r--README.md7
m---------qbe0
4 files changed, 15 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..34fa6a8
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "qbe"]
+ path = qbe
+ url = https://git.sr.ht/~mcf/qbe
diff --git a/Makefile b/Makefile
index 1157ffe..19d2906 100644
--- a/Makefile
+++ b/Makefile
@@ -82,6 +82,11 @@ bootstrap: stage2 stage3
check: all
@CCQBE=./cc-qbe ./runtests
+.PHONY: qbe
+qbe:
+ git submodule update --init qbe
+ $(MAKE) -C qbe
+
.PHONY: clean
clean:
rm -rf cc $(DRIVER_OBJ) cc-qbe $(OBJ) stage2 stage3
diff --git a/README.md b/README.md
index c183a9d..5ab7c46 100644
--- a/README.md
+++ b/README.md
@@ -51,6 +51,13 @@ string arrays (`static char *[]`):
You may also want to customize your environment or `config.mk` with the
appropriate `CC`, `CFLAGS` and `LDFLAGS`.
+If you don't have QBE installed, you can build it from the included
+submodule (NOTE: BSD users will need to use gmake here), then add it to
+your PATH so that the driver will be able to run it.
+
+ make qbe
+ PATH=$PWD/qbe/obj:$PATH
+
Once this is done, you can build with
make
diff --git a/qbe b/qbe
new file mode 160000
+Subproject 014a7885bd6d0533b01708df17461cb2e2709e4