From a32ff22a9c3a587cf696603d7f7a15ec4893e2d7 Mon Sep 17 00:00:00 2001 From: Damien Ciabrini Date: Tue, 19 Mar 2024 19:39:54 +0100 Subject: [PATCH] Fix installation of SDCC files for deb/ubuntu deb packages are built with a special libexecdir value, which makes SDCC install some files in /usr/lib instead of /usr/z80-neogeo-ihx/lib Since SDCC4.4 we no longer build support library or C library for the z80, and on ubuntu this breaks later cleanup steps in install targets. Update the install targets to fix installation on all supported nightly packages (deb, rpm, brew, msys2). --- Makefile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index f7e91b3..8998498 100644 --- a/Makefile +++ b/Makefile @@ -369,16 +369,18 @@ install-ngsdcc: $(BUILD)/ngsdcc rm -rf "$(DESTDIR)$(prefix)/z80-neogeo-ihx/include/asm/$$d"; \ rm -rf "$(DESTDIR)$(prefix)/z80-neogeo-ihx/include/$$d"; \ done && \ - find $(DESTDIR)$(prefix)/z80-neogeo-ihx/lib/ -mindepth 1 -type d -empty -delete && \ - mkdir -p $(DESTDIR)$(prefix)/z80-neogeo-ihx/bin && \ - (cd $(DESTDIR)$(prefix)/bin; \ + if [ -d "$(DESTDIR)$(prefix)/z80-neogeo-ihx/lib" ]; then \ + find "$(DESTDIR)$(prefix)/z80-neogeo-ihx/lib" -mindepth 1 -type d -empty -delete; \ + fi && \ + mkdir -p "$(DESTDIR)$(prefix)/z80-neogeo-ihx/bin" && \ + (cd "$(DESTDIR)$(prefix)/bin"; \ for f in `find . -name 'z80-neogeo-ihx-*'`; do \ fbase=`echo $$f | cut -d- -f4`; \ - mv $$f $(DESTDIR)$(prefix)/z80-neogeo-ihx/bin/$$fbase; \ - echo "#!/bin/sh" > $(DESTDIR)$(prefix)/bin/$$f; \ - echo "PATH=$(prefix)/z80-neogeo-ihx/bin:\$$PATH" >> $(DESTDIR)$(prefix)/bin/$$f; \ - echo "$(prefix)/z80-neogeo-ihx/bin/$$fbase \$$@" >> $(DESTDIR)$(prefix)/bin/$$f; \ - chmod 755 $(DESTDIR)$(prefix)/bin/$$f; \ + mv $$f "$(DESTDIR)$(prefix)/z80-neogeo-ihx/bin/$$fbase"; \ + echo "#!/bin/sh" > "$(DESTDIR)$(prefix)/bin/$$f"; \ + echo "PATH=$(prefix)/z80-neogeo-ihx/bin:\$$PATH" >> "$(DESTDIR)$(prefix)/bin/$$f"; \ + echo "$(prefix)/z80-neogeo-ihx/bin/$$fbase \$$@" >> "$(DESTDIR)$(prefix)/bin/$$f"; \ + chmod 755 "$(DESTDIR)$(prefix)/bin/$$f"; \ done)