From 1f75196ebb960ab2521a19db28efcb93657b8470 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Thu, 29 Aug 2024 09:44:18 +0200 Subject: [PATCH] reduce usage of @PREFIX@ --- Makefile | 9 +++------ dist/saturn40g | 8 +++++--- dist/saturn48gx | 8 +++++--- dist/saturn49g | 8 +++++--- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index b1d068e..8adfadc 100644 --- a/Makefile +++ b/Makefile @@ -139,12 +139,9 @@ get-roms: install: dist/saturn dist/pack dist/saturn.cat dist/Saturn.ad manual install -m 755 -d -- $(DESTDIR)$(PREFIX)/bin install -c -m 755 dist/saturn $(DESTDIR)$(PREFIX)/bin/saturn - sed "s|@PREFIX@|$(PREFIX)|g" dist/saturn48gx > $(DESTDIR)$(PREFIX)/bin/saturn48gx - chmod 755 $(DESTDIR)$(PREFIX)/bin/saturn48gx - sed "s|@PREFIX@|$(PREFIX)|g" dist/saturn49g > $(DESTDIR)$(PREFIX)/bin/saturn49g - chmod 755 $(DESTDIR)$(PREFIX)/bin/saturn49g - sed "s|@PREFIX@|$(PREFIX)|g" dist/saturn40g > $(DESTDIR)$(PREFIX)/bin/saturn40g - chmod 755 $(DESTDIR)$(PREFIX)/bin/saturn40g + install -c -m 755 dist/saturn $(DESTDIR)$(PREFIX)/bin/saturn48gx + install -c -m 755 dist/saturn $(DESTDIR)$(PREFIX)/bin/saturn40g + install -c -m 755 dist/saturn $(DESTDIR)$(PREFIX)/bin/saturn49g install -c -m 644 dist/saturn.cat $(DESTDIR)$(PREFIX)/bin/saturn.cat #FIXME install -m 755 -d -- $(DESTDIR)$(PREFIX)/share/locale/C/LC_MESSAGES diff --git a/dist/saturn40g b/dist/saturn40g index 614595f..ab89bfd 100755 --- a/dist/saturn40g +++ b/dist/saturn40g @@ -1,17 +1,19 @@ #!/bin/bash -eu +cd "$(dirname "$0")" ; CWD=$(pwd) + STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state} STATEDIR=$STATE_HOME/saturn/40g mkdir -p "$STATEDIR" if [ ! -e "$STATEDIR"/rom.39g ]; then - if [ ! -d @PREFIX@/share/saturn/ROMs/ ]; then + if [ ! -d ../share/saturn/ROMs/ ]; then echo "Error: No ROMs/ dir found" exit 1 fi if [ ! -d "$STATEDIR"/../ROMs ]; then - cp -R @PREFIX@/share/saturn/ROMs/ "$STATEDIR"/../ROMs + cp -R ../share/saturn/ROMs/ "$STATEDIR"/../ROMs fi make -C "$STATEDIR"/../ROMs rom.39g cp "$STATEDIR"/../ROMs/rom.39g "$STATEDIR"/rom.39g @@ -22,4 +24,4 @@ if [ ! -e "$STATEDIR"/ram ]; then RAM=-reset fi -@PREFIX@/bin/saturn -face hp40 -hw hp40 -stateDir "$STATEDIR" -rom rom.39g $RAM "$@" +./saturn -face hp40 -hw hp40 -stateDir "$STATEDIR" -rom rom.39g $RAM "$@" diff --git a/dist/saturn48gx b/dist/saturn48gx index e38263c..f800e76 100755 --- a/dist/saturn48gx +++ b/dist/saturn48gx @@ -1,17 +1,19 @@ #!/bin/bash -eu +cd "$(dirname "$0")" ; CWD=$(pwd) + STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state} STATEDIR=$STATE_HOME/saturn/48gx mkdir -p "$STATEDIR" if [ ! -e "$STATEDIR"/gxrom-r ]; then - if [ ! -d @PREFIX@/share/saturn/ROMs/ ]; then + if [ ! -d ../share/saturn/ROMs/ ]; then echo "Error: No ROMs/ dir found" exit 1 fi if [ ! -d "$STATEDIR"/../ROMs ]; then - cp -R @PREFIX@/share/saturn/ROMs/ "$STATEDIR"/../ROMs + cp -R ../share/saturn/ROMs/ "$STATEDIR"/../ROMs fi make -C "$STATEDIR"/../ROMs gxrom-r cp "$STATEDIR"/../ROMs/gxrom-r "$STATEDIR"/gxrom-r @@ -25,4 +27,4 @@ fi [ ! -e "$STATEDIR"/port1 ] && dd if=/dev/zero of="$STATEDIR"/port1 bs=1k count=128 [ ! -e "$STATEDIR"/port2 ] && dd if=/dev/zero of="$STATEDIR"/port2 bs=1k count=4096 -@PREFIX@/bin/saturn -face hp48 -hw hp48 -stateDir "$STATEDIR" -rom gxrom-r $RAM -port1 port1 -port2 port2 "$@" +./saturn -face hp48 -hw hp48 -stateDir "$STATEDIR" -rom gxrom-r $RAM -port1 port1 -port2 port2 "$@" diff --git a/dist/saturn49g b/dist/saturn49g index 5aba05b..5db5277 100755 --- a/dist/saturn49g +++ b/dist/saturn49g @@ -1,17 +1,19 @@ #!/bin/bash -eu +cd "$(dirname "$0")" ; CWD=$(pwd) + STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state} STATEDIR=$STATE_HOME/saturn/49g mkdir -p "$STATEDIR" if [ ! -e "$STATEDIR"/rom.49g ]; then - if [ ! -d @PREFIX@/share/saturn/ROMs/ ]; then + if [ ! -d ../share/saturn/ROMs/ ]; then echo "Error: No ROMs/ dir found" exit 1 fi if [ ! -d "$STATEDIR"/../ROMs ]; then - cp -R @PREFIX@/share/saturn/ROMs/ "$STATEDIR"/../ROMs + cp -R ../share/saturn/ROMs/ "$STATEDIR"/../ROMs fi make -C "$STATEDIR"/../ROMs rom.49g cp "$STATEDIR"/../ROMs/rom.49g "$STATEDIR"/rom.49g @@ -22,4 +24,4 @@ if [ ! -e "$STATEDIR"/ram ]; then RAM=-reset fi -@PREFIX@/bin/saturn -face hp49 -hw hp49 -stateDir "$STATEDIR" -rom rom.49g $RAM "$@" +./saturn -face hp49 -hw hp49 -stateDir "$STATEDIR" -rom rom.49g $RAM "$@"