diff options
| -rw-r--r-- | Makefile | 21 | ||||
| -rw-r--r-- | README | 8 | ||||
| -rw-r--r-- | config.mk | 12 |
3 files changed, 39 insertions, 2 deletions
@@ -13,4 +13,23 @@ prtmib$(EXE): $(SRC) $(HDR) clean: -$(RM) prtmib$(EXE) -.PHONY: all clean +ifeq ($(OS),Windows_NT) +install: all + -mkdir "$(subst /,\,$(DESTDIR)$(BINDIR))" + copy /Y prtmib$(EXE) "$(subst /,\,$(DESTDIR)$(BINDIR)/prtmib$(EXE))" + @echo installed to $(DESTDIR)$(BINDIR)/prtmib$(EXE) + +uninstall: + -$(RM) "$(subst /,\,$(DESTDIR)$(BINDIR)/prtmib$(EXE))" +else +install: all + mkdir -p "$(DESTDIR)$(BINDIR)" + cp -f prtmib$(EXE) "$(DESTDIR)$(BINDIR)/prtmib$(EXE)" + chmod 755 "$(DESTDIR)$(BINDIR)/prtmib$(EXE)" + @echo installed to $(DESTDIR)$(BINDIR)/prtmib$(EXE) + +uninstall: + rm -f "$(DESTDIR)$(BINDIR)/prtmib$(EXE)" +endif + +.PHONY: all clean install uninstall @@ -39,12 +39,18 @@ Build Windows (MinGW, default config.mk): make + make install as(1) and ld(1) must be the MinGW ones; config.mk prepends MINGWBIN to PATH so a stock prompt is enough. Linux: edit config.mk (comment the Windows block, uncomment Linux), - then make. `RM = rm -f` on Unix. + then make && make install. `RM = rm -f` on Unix. + + Install path (override with PREFIX=...): + Windows: %USERPROFILE%\.local\bin (add to PATH if it is not) + Linux: /usr/local/bin (often needs sudo) + make uninstall removes the binary. Hosts, community, timeouts, thresholds: config.h. Recompile. @@ -1,5 +1,17 @@ # prtmib — site/toolchain knobs. Edit this, not the Makefile. # +# Install: make install +# Windows: %USERPROFILE%\.local\bin +# Linux: /usr/local/bin +# Override: make PREFIX=... install + +ifeq ($(OS),Windows_NT) +PREFIX ?= $(USERPROFILE)/.local +else +PREFIX ?= /usr/local +endif +BINDIR ?= $(PREFIX)/bin + # Windows (this machine): MinGW-w64 gcc. LLVM clang in PATH targets MSVC # and needs the VS developer prompt; MinGW does not. # as/ld live next to gcc; export PATH so the driver finds them. |
