From 35a0332d1dcf2dbd743e5a24cc6f7d2b15fb8b8c Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 21 Jul 2022 07:13:21 -0700 Subject: Install a txrlisp hard link. * Makefile (LN): New variable. On platforms where you can't hard link, this can be replaced with some other command. Possibly "true" not to have the alternative executable name created at all. (HARDLINK): New macro. (install): Use HARDLINK to create a link named txrlisp pointing to the same file as txr in the destination directory. * txr.c (txr_main): If the executable ends with "lisp" (or "lisp.exe" on Windows), then default the txr_lisp_p variable to t, which has the effect as if --lisp had been processed. * txr.1: Documented. --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 4ca6058f..6aa30b3a 100644 --- a/Makefile +++ b/Makefile @@ -164,6 +164,8 @@ $(call SH,$(TXR) --in-package=sys --compile=$<:$@.tmp) $(call SH,mv $@.tmp $@) endef +LN := ln + ifneq ($(top_srcdir),) dbg/%.o: $(top_srcdir)%.c $(call COMPILE_C_WITH_DEPS,$(DBG_ONLY_FLAGS)) @@ -514,12 +516,23 @@ define INSTALL done) endef +define HARDLINK + $(call ABBREV3,HARDLINK,$(1),$(2)) + $(call SH,$(LN) -f $(1) $(2)) +endef + PREINSTALL := : .PHONY: install install: $(PROG) $(V)$(PREINSTALL) $(call INSTALL,0755,txr$(EXE),$(DESTDIR)$(bindir)) + $(call HARDLINK,\ + $(DESTDIR)$(bindir)/txr$(EXE),\ + $(DESTDIR)$(bindir)/txrlisp$(EXE)) + $(call HARDLINK,\ + $(DESTDIR)$(bindir)/txr$(EXE),\ + $(DESTDIR)$(bindir)/txrvm$(EXE)) $(call INSTALL,0444,$(top_srcdir)LICENSE,$(DESTDIR)$(datadir)) $(call INSTALL,0444,$(top_srcdir)METALICENSE,$(DESTDIR)$(datadir)) $(call INSTALL,0444,$(top_srcdir)txr.1,$(DESTDIR)$(mandir)/man1) -- cgit v1.2.3