From 173957fae99508b18915daf1bd5768172afc44a3 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Mon, 13 May 2019 12:19:13 -0700 Subject: Add qbe submodule to make it easy to build --- .gitmodules | 3 +++ Makefile | 5 +++++ README.md | 7 +++++++ qbe | 1 + 4 files changed, 16 insertions(+) create mode 100644 .gitmodules create mode 160000 qbe 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 index 0000000..014a788 --- /dev/null +++ b/qbe @@ -0,0 +1 @@ +Subproject commit 014a7885bd6d0533b01708df17461cb2e2709e4e -- cgit v1.2.3