commit 605a70a66aa6c34a0aee9929a54cfc9ed95575e8 parent 82a2d87352daaec9df3c0076efd30c85820878e0 Author: Dridi Boukelmoune <dridi.boukelmoune@gmail.com> Date: Sun, 11 Feb 2024 23:54:29 +0100 Makefile: Build haredoc(1) with LDLINKFLAGS This variable is part of the configs but was not applied to haredoc. To avoid this situation where the configuration for harec2 and haredoc diverges, a shared HARE_BUILD_ENV variable collects all the variables needed to configure a hare build execution. Diffstat:
M | Makefile | | | 13 | +++++++------ |
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile @@ -44,19 +44,20 @@ $(BINOUT)/hare: $(OBJS) @printf 'LD\t%s\n' "$@" @$(LD) $(LDLINKFLAGS) -T $(RTSCRIPT) -o $@ $(OBJS) +HARE_BUILD_ENV = HAREPATH=. HAREC="$(HAREC)" QBE="$(QBE)" AS="$(AS)" \ + LD="$(LD)" HAREFLAGS="$(HAREFLAGS)" HARECFLAGS="$(HARECFLAGS)" \ + QBEFLAGS="$(QBEFLAGS)" ASFLAGS="$(ASFLAGS)" LDLINKFLAGS="$(LDLINKFLAGS)" + $(BINOUT)/harec2: $(BINOUT)/hare @printf 'HARE\t%s\n' "$@" - @env HAREPATH=. HAREC="$(HAREC)" QBE="$(QBE)" AS="$(AS)" LD="$(LD)" \ - HAREFLAGS="$(HAREFLAGS)" HARECFLAGS="$(HARECFLAGS)" \ - QBEFLAGS="$(QBEFLAGS)" ASFLAGS="$(ASFLAGS)" \ - LDLINKFLAGS="$(LDLINKFLAGS)" \ + @env $(HARE_BUILD_ENV) \ $(BINOUT)/hare build $(HARE_DEFINES) -o $(BINOUT)/harec2 cmd/harec $(BINOUT)/haredoc: $(BINOUT)/hare @mkdir -p $(BINOUT) @printf 'HARE\t%s\n' "$@" - @env HAREPATH=. HAREC="$(HAREC)" QBE="$(QBE)" $(BINOUT)/hare build \ - $(HARE_DEFINES) -o $(BINOUT)/haredoc ./cmd/haredoc + @env $(HARE_BUILD_ENV) \ + $(BINOUT)/hare build $(HARE_DEFINES) -o $(BINOUT)/haredoc ./cmd/haredoc docs/html: $(BINOUT)/haredoc mkdir -p docs/html