commit 46581a56e603443824033e5c86584d5f9d5f8558 parent cf3c7d70e2ab88fb14f6346885e09c1e278339b4 Author: Drew DeVault <sir@cmpwn.com> Date: Wed, 9 Feb 2022 08:31:12 +0100 make: add install target I would not necessarily advise using this until the hosted compiler works. Signed-off-by: Drew DeVault <sir@cmpwn.com> Diffstat:
M | Makefile | | | 11 | ++++++++++- |
A | scripts/install-mods | | | 44 | ++++++++++++++++++++++++++++++++++++++++++++ |
2 files changed, 54 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile @@ -93,4 +93,13 @@ check: .bin/hare-tests all: .bin/hare .bin/harec2 .bin/haredoc -.PHONY: all clean check .bin/harec2 .bin/haredoc +install: all docs + mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1 \ + $(DESTDIR)$(SRCDIR)/hare/stdlib $(DESTDIR)$(LOCALSRCDIR) + install -m755 .bin/hare $(DESTDIR)$(BINDIR)/hare + install -m755 .bin/haredoc $(DESTDIR)$(BINDIR)/haredoc + install -m644 docs/hare.1 $(DESTDIR)$(MANDIR)/man1/hare.1 + install -m644 docs/haredoc.1 $(DESTDIR)$(MANDIR)/man1/haredoc.1 + ./scripts/install-mods "$(DESTDIR)$(SRCDIR)/hare/stdlib" + +.PHONY: all clean check install .bin/harec2 .bin/haredoc diff --git a/scripts/install-mods b/scripts/install-mods @@ -0,0 +1,44 @@ +#!/bin/sh +modules="ascii +bufio +bytes +compress +crypto +dirs +encoding +endian +errors +fmt +fnmatch +format +fs +getopt +hare +hash +io +iobus +linux +math +mime +net +os +path +rt +shlex +slice +sort +strconv +strings +strio +temp +time +types +unix +uuid" +IFS=" +" +for mod in $modules +do + printf 'install %s\n' "$mod" + cp -R $mod $1 +done