diff --git a/sdk/.gitignore b/sdk/.gitignore index 8838f76..e526285 100644 --- a/sdk/.gitignore +++ b/sdk/.gitignore @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: CC0-1.0 -bin/* -lib/* +bin +lib +opt conf.mk diff --git a/sdk/README.md b/sdk/README.md index 3ff7277..7183d83 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -1,16 +1,18 @@ # Authors -2021 Ivan Tatarinov +This document: +* 2021 Ivan Tatarinov # Contributors -No one yet. +This document: No one yet. # Licenses This document is under [GNU FDL-1.3 or later](https://spdx.org/licenses/GFDL-1.3-or-later.html) license. SJAsmPlus Z80 Assembler is distributed under [zlib](https://spdx.org/licenses/Zlib.html) license. SJAsmPlus Z80 Assembler by aprisobal (*z00m128*) is distributed under [BSD 3-Clause "New" or "Revised"](https://spdx.org/licenses/BSD-3-Clause.html) license. +Small Device C Compiler (SDCC) is distributed under [GPL](https://sourceforge.net/projects/sdcc/) licenses. z88dk is distributed under [Clarified Artistic](https://spdx.org/licenses/ClArtistic.html) license. LodePNG C/C++ library is distributed under [zlib](https://spdx.org/licenses/Zlib.html) license. @@ -23,6 +25,7 @@ Directory | Description `bin` | Compiled binaries of tools. `include` | Header files (`.def`, `.h` etc.) to be included in other sources (assembler, C, etc.). `lib` | Libraries, needed for executables (mostly in `bin` directory) to function properly. +`opt` | Optionally installed bundles (like SDK). `src` | The source code of local and downloadable tools. See Makefiles for details. `windows-x86` | Compiled binaries of tools and libraries for Windows x86 (32 bit) platform. @@ -53,6 +56,7 @@ Additional packages for targets: Target | Packages ----|---- `sjasmplus` | cmake libboost-all-dev libxml2-dev +`sdcc` | - `z88dk` | dos2unix libboost-all-dev texinfo texi2html libxml2-dev subversion bison flex zlib1g-dev m4 To use cross-compilation for Windows platform install *mingw-w64* package. @@ -91,6 +95,7 @@ Value of `` | Possible values | Description Value of `TARGET` | Origin | Description ----|----|---- `sjasmplus` | downloaded | SJAsmPlus Z80 Assembler +`sdcc` | downloaded | Small Device C Compiler `z88dk` | downloaded | z88dk `lodepng` | `src/lodepng` | LodePNG library `zx7b` | `src/zx7b` | zx7b @@ -103,6 +108,7 @@ Value of `BUILD` | Target directory | Target system Compiled binaries are installed into `bin` sub-directory of target directory. Compiled libraries are installed into `lib` sub-directory of target directory. +Complex bundles are installed into `opt` sub-directory of target directory. Example: @@ -186,6 +192,7 @@ Target | Dependencies ----|---- all targets | bash git make wget unzip p7zip `sjasmplus` | gcc-g++ cmake libboost-devel +`sdcc` | - `z88dk` | mingw64-i686-gcc-core mingw64-i686-libxml2 patch `lodepng` | gcc-core `zx7b` | gcc-core @@ -219,6 +226,7 @@ where: Value of `TARGET` | Sources origin | Binaries origin (**Quick setup**) | Build from sources ----|----|----|---- `sjasmplus` | downloaded | downloaded (**yes**) | available +`sdcc` | downloaded | downloaded (**yes**) | available `z88dk` | downloaded | downloaded (**yes**) | available `lodepng` | local | precompiled locally (**no**) | available `zx7b` | local | precompiled locally (**no**) | available @@ -296,6 +304,7 @@ These changes are actual for current invocation of command shell and all child p * [Windows commands](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands) * [SJAsmPlus](https://github.com/sjasmplus/sjasmplus) - Z80 Assembler * [SJAsmPlus by aprisobal](https://github.com/z00m128/sjasmplus) - Z80 Assembler +* [SDCC](https://sourceforge.net/projects/sdcc/) - Small Device C Compiler * [Z88DK](https://github.com/z88dk/z88dk) - The Development Kit for Z80 Computers * [LodePNG](https://github.com/lvandeve/lodepng) - PNG encoder and decoder in C and C++ * [Open Source FPGA Foundation Formed to Accelerate Widespread Adoption of Programmable Logic](https://osfpga.org/osfpga-foundation-launched/) - news article (April 8, 2021) diff --git a/sdk/common.mk b/sdk/common.mk index 71b32ad..91ec216 100644 --- a/sdk/common.mk +++ b/sdk/common.mk @@ -10,66 +10,124 @@ ifndef ZXSDK -ZXSDK := $(patsubst %/,%,$(abspath $(dir $(lastword $(MAKEFILE_LIST))))) +# ZXSDK +# Root (if set acts as a flag of the properly configured environment variables) +export ZXSDK = $(patsubst %/,%,$(abspath $(dir $(lastword $(MAKEFILE_LIST))))) +_path = $(ZXSDK) + +# Root of platform specific files ifeq ($(OS),Windows_NT) ifeq ($(PROCESSOR_ARCHITECTURE),X86) - ZXSDK_PLATFORM= $(ZXSDK)/windows-x86 + ZXSDK_PLATFORM = $(ZXSDK)/windows-x86 else ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) - ZXSDK_PLATFORM= $(ZXSDK)/windows-x86 + ZXSDK_PLATFORM = $(ZXSDK)/windows-x86 else ifeq ($(PROCESSOR_ARCHITECTURE),EM64T) - ZXSDK_PLATFORM= $(ZXSDK)/windows-x86 + ZXSDK_PLATFORM = $(ZXSDK)/windows-x86 else $(warning Unsupported platform: "$(PROCESSOR_ARCHITECTURE)") - ZXSDK_PLATFORM= $(ZXSDK)/windows-x86 + ZXSDK_PLATFORM = $(ZXSDK)/windows-x86 endif else ZXSDK_PLATFORM = $(ZXSDK) endif - -Z88DK := $(ZXSDK)/src/z88dk -ZCCCFG := $(Z88DK)/lib/config -PATH := $(ZXSDK_PLATFORM)/bin:$(Z88DK)/bin:$(ZXSDK):$(PATH) - -ifeq ($(OS),Windows_NT) -PATH := $(ZXSDK_PLATFORM)/lib:$(PATH) -# Fix paths under Cygwin for z88dk on Windows -ifeq ($(shell echo $$OSTYPE),cygwin) -ZCCCFG := $(shell cygpath -m $(ZCCCFG)) -endif -else # $(OS)!=Windows_NT -export LD_LIBRARY_PATH:=$(ZXSDK_PLATFORM)/lib -endif # $(OS)!=Windows_NT - -export ZXSDK export ZXSDK_PLATFORM + +# "bin" directory (platform specific) +_path := $(_path):$(ZXSDK_PLATFORM)/bin + +# "lib" directory (platform specific) +ifeq ($(OS),Windows_NT) + _path := $(_path):$(ZXSDK_PLATFORM)/lib +else + export LD_LIBRARY_PATH = $(ZXSDK_PLATFORM)/lib +endif + +# SDCC + +# Root (platform specific) +export SDCCHOME = $(ZXSDK_PLATFORM)/opt/sdcc + +# "bin" directory (platform specific) +_path := $(_path):$(SDCCHOME)/bin + +# "include" directory (platform specific) +ifeq ($(OS),Windows_NT) + SDCCINCLUDE = $(SDCCHOME)/include +else + SDCCINCLUDE = $(SDCCHOME)/share/sdcc/include +endif +export SDCCINCLUDE + +# "lib" directory (platform specific) +ifeq ($(OS),Windows_NT) + SDCCLIB = $(SDCCHOME)/lib +else + SDCCLIB = $(SDCCHOME)/share/sdcc/lib +endif +export SDCCLIB + +# Z88DK + +# Root +Z88DK = $(ZXSDK)/src/z88dk + +# "bin" directory +_path := $(_path):$(Z88DK)/bin + +# Configuration file +ZCCCFG = $(Z88DK)/lib/config +ifeq ($(OS),Windows_NT) + # Fix paths under Cygwin for Z88DK on Windows + ifeq ($(shell echo $$OSTYPE),cygwin) + ZCCCFG = $(shell cygpath -m $(ZCCCFG)) + endif +endif export ZCCCFG -export PATH + +# PATH + +export PATH := $(_path):$(PATH) +undefine _path endif # !ZXSDK +# Default values + -include $(ZXSDK)/conf.mk -ifeq ($(OS),Windows_NT) -EXESUFFIX := .exe -DLLSUFFIX := .dll -else -EXESUFFIX := -DLLSUFFIX := .so -endif - +# C compiler ifeq ($(BUILD),mingw32) -CC := i686-w64-mingw32-gcc -EXESUFFIX := .exe -DLLSUFFIX := .dll -USE_PREFIX ?= $(ZXSDK)/windows-x86 + CC = i686-w64-mingw32-gcc else ifeq ($(BUILD),mingw64) -CC := x86_64-w64-mingw32-gcc -EXESUFFIX := .exe -DLLSUFFIX := .dll -USE_PREFIX ?= $(ZXSDK)/windows-x86_64 + CC = x86_64-w64-mingw32-gcc endif -# Default values -USE_PREFIX ?= $(ZXSDK_PLATFORM) -USE_SJASMPLUS_VERSION ?= z00m128 +# Filename suffixes (platform specific) +ifeq ($(BUILD),mingw32) + EXESUFFIX = .exe + DLLSUFFIX = .dll +else ifeq ($(BUILD),mingw64) + EXESUFFIX = .exe + DLLSUFFIX = .dll +else + ifeq ($(OS),Windows_NT) + EXESUFFIX = .exe + DLLSUFFIX = .dll + else + EXESUFFIX = + DLLSUFFIX = .so + endif +endif + +# Default path where to install files (platform specific) +ifeq ($(BUILD),mingw32) + USE_PREFIX ?= $(ZXSDK)/windows-x86 +else ifeq ($(BUILD),mingw64) + USE_PREFIX ?= $(ZXSDK)/windows-x86_64 +else +USE_PREFIX ?= $(ZXSDK_PLATFORM) +endif + +# Version of SJAsmPlus compiler to use +USE_SJASMPLUS_VERSION ?= z00m128 diff --git a/sdk/extract.sh b/sdk/extract.sh index 47509e3..3cc39cc 100755 --- a/sdk/extract.sh +++ b/sdk/extract.sh @@ -283,7 +283,7 @@ if [[ $o_use_tmp -eq 0 ]]; then ;; .7z) if [[ "$o_subdir" = '.' ]]; then - 7z x -bd -o "$o_output" "$o_input" + 7z x -bd -o"$o_output" "$o_input" else 7z x -bd "$o_input" fi diff --git a/sdk/setenv.bat b/sdk/setenv.bat index 66bcda0..68b09d8 100644 --- a/sdk/setenv.bat +++ b/sdk/setenv.bat @@ -6,7 +6,16 @@ rem SPDX-License-Identifier: GPL-3.0-or-later if not x%ZXSDK% == x exit /b set ZXSDK=%~dp0 set ZXSDK=%ZXSDK:~0,-1% +set _path=%ZXSDK% set ZXSDK_PLATFORM=%ZXSDK%\windows-x86 +set _path=%_path%;%ZXSDK_PLATFORM%\bin +set _path=%_path%;%ZXSDK_PLATFORM%\lib +set SDCCHOME=%ZXSDK_PLATFORM%\opt\sdcc +set _path=%_path%:%SDCCHOME%\bin +set SDCCINCLUDE=%SDCCHOME%\include +set SDCCLIB=%SDCCHOME%\lib set Z88DK=%ZXSDK%\src\z88dk +set _path=%_path%;%Z88DK%\bin set ZCCCFG=%Z88DK%\lib\config -set PATH=%ZXSDK_PLATFORM%\bin;%Z88DK%\bin;%ZXSDK_PLATFORM%\lib;%PATH% +set PATH=%_path%;%PATH% +set _path= \ No newline at end of file diff --git a/sdk/setenv.sh b/sdk/setenv.sh index 8a2cc9e..9e3b14d 100644 --- a/sdk/setenv.sh +++ b/sdk/setenv.sh @@ -2,27 +2,57 @@ # SPDX-FileCopyrightText: 2021 Ivan Tatarinov # # SPDX-License-Identifier: GPL-3.0-or-later +# +# Supported environments: +# * GNU on Linux, FreeBSD etc. +# * GNU on Windows NT (using MinGW/MSYS/Cygwin/WSL) if [[ "x$ZXSDK" == x ]]; then - ZXSDK=$(dirname $(realpath "$BASH_SOURCE")) + export ZXSDK=$(dirname $(realpath "$BASH_SOURCE")) + _path=$ZXSDK if [[ x$OS == xWindows_NT ]]; then + case $PROCESSOR_ARCHITECTURE in + X86|AMD64|EM64T) + ;; + *) + echo "WARNING: Unsupported platform: \"$PROCESSOR_ARCHITECTURE\"" >&2 + ;; + esac ZXSDK_PLATFORM=$ZXSDK/windows-x86 else ZXSDK_PLATFORM=$ZXSDK fi - Z88DK=$ZXSDK/src/z88dk - ZCCCFG=$Z88DK/lib/config - PATH=$ZXSDK_PLATFORM/bin:$Z88DK/bin:$ZXSDK:$PATH + export ZXSDK_PLATFORM + _path=$_path:$ZXSDK_PLATFORM/bin if [[ x$OS == xWindows_NT ]]; then - PATH=$ZXSDK_PLATFORM/lib:$PATH - # Fix paths under Cygwin for z88dk on Windows - if [[ x$OSTYPE == xcygwin ]]; then - ZCCCFG=`cygpath -m $ZCCCFG` - fi + _path=$_path:$ZXSDK_PLATFORM/lib else export LD_LIBRARY_PATH=$ZXSDK_PLATFORM/lib fi - export ZXSDK - export ZXSDK_PLATFORM + export SDCCHOME=$ZXSDK_PLATFORM/opt/sdcc + _path=$_path:$SDCCHOME/bin + if [[ x$OS == xWindows_NT ]]; then + SDCCINCLUDE=$SDCCHOME/include + else + SDCCINCLUDE=$SDCCHOME/share/sdcc/include + fi + export SDCCINCLUDE + if [[ x$OS == xWindows_NT ]]; then + SDCCLIB=$SDCCHOME/lib + else + SDCCLIB=$SDCCHOME/share/sdcc/lib + fi + export SDCCLIB + Z88DK=$ZXSDK/src/z88dk + _path=$_path:$Z88DK/bin + ZCCCFG=$Z88DK/lib/config + if [[ x$OS == xWindows_NT ]]; then + # Fix paths under Cygwin for Z88DK on Windows + if [[ x$OSTYPE == xcygwin ]]; then + ZCCCFG=`cygpath -m $ZCCCFG` + fi + fi export ZCCCFG + PATH=$_path:$PATH + unset _path fi diff --git a/sdk/src/.gitignore b/sdk/src/.gitignore index a0a8ee8..1b0fd50 100644 --- a/sdk/src/.gitignore +++ b/sdk/src/.gitignore @@ -3,6 +3,7 @@ # SPDX-License-Identifier: CC0-1.0 .downloads +sdcc sjasmplus sjasmplus-z00m128 z88dk diff --git a/sdk/src/Makefile b/sdk/src/Makefile index 3740a79..0c62142 100644 --- a/sdk/src/Makefile +++ b/sdk/src/Makefile @@ -38,6 +38,7 @@ INSTALL_PROGRAM ?= $(INSTALL) TARGETS=\ sjasmplus\ + sdcc\ z88dk\ lodepng\ zx7b\ @@ -77,6 +78,7 @@ else $(error Unknown SJAsmPlus version selected: `$(USE_SJASMPLUS_VERSION)') endif +include sdcc.inc.mk include z88dk.inc.mk include lodepng.inc.mk include tools.inc.mk diff --git a/sdk/src/sdcc.inc.mk b/sdk/src/sdcc.inc.mk new file mode 100644 index 0000000..1733973 --- /dev/null +++ b/sdk/src/sdcc.inc.mk @@ -0,0 +1,127 @@ +# sdcc.inc.mk - script to download and build SDCC. +# +# This file is a part of main Makefile. +# +# SPDX-FileCopyrightText: 2021 Ivan Tatarinov +# +# SPDX-License-Identifier: GPL-3.0-or-later + +.downloads/sdcc: + mkdir -p $@ + +.PHONY: $(foreach t,build install uninstall clean distclean,$(t)-sdcc) + +ifeq ($(_DoBuild),1) + +SDCC_ARCHIVE = .downloads/sdcc/sdcc-src-4.1.0.tar.bz2 +SDCC_ARCHIVE_SHA256 = 81edf776d5a2dc61a4b5c3408929db7b25874d69c46e4a71b116be1322fd533f +SDCC_ARCHIVE_TYPE = .tar.bz2 +SDCC_ARCHIVE_SUBDIR = sdcc + +.downloads/sdcc/sdcc-src-4.1.0.tar.bz2: | .downloads/sdcc + wget -c https://sourceforge.net/projects/sdcc/files/sdcc/4.1.0/$(@F)/download -O $@ + +sdcc/.extracted: $(SDCC_ARCHIVE) + rm -rf $(@D) + extract.sh $<\ + --sha256 $(SDCC_ARCHIVE_SHA256)\ + --type $(SDCC_ARCHIVE_TYPE)\ + --subdir $(SDCC_ARCHIVE_SUBDIR)\ + --output $(@D) + touch $@ + +build-sdcc: | sdcc/.extracted sdcc.mk + $(MAKE) -w -C sdcc -f ../sdcc.mk + +install-sdcc: | sdcc/.extracted sdcc.mk + $(MAKE) -w -C sdcc -f ../sdcc.mk prefix=$(SDCCHOME) install + + ifeq ($(_DoClean),1) + +uninstall-sdcc: | sdcc/.extracted sdcc.mk + $(MAKE) -w -C sdcc -f ../sdcc.mk prefix=$(SDCCHOME) uninstall + +clean-sdcc: | sdcc/.extracted sdcc.mk + $(MAKE) -w -C sdcc -f ../sdcc.mk clean + +distclean-sdcc: + rm -rf sdcc + + else # !_DoClean + +uninstall-sdcc\ +clean-sdcc\ +distclean-sdcc:; + + endif # !_DoClean + +endif # _DoBuild + +ifeq ($(_UsePrecompiledOnWindows),1) + +SDCC_ARCHIVE = .downloads/sdcc/sdcc-4.1.0-setup.exe +SDCC_ARCHIVE_SHA256 = cbf064c9f1a3f9a73db6d2c8ba3a43563fa3a2d2966f52cf5a571a3064222ed8 +SDCC_ARCHIVE_TYPE = .7z +SDCC_ARCHIVE_SUBDIR = . + +SDCC_SUBDIRS=\ + bin\ + doc\ + include\ + lib\ + non-free + +.downloads/sdcc/sdcc-4.1.0-setup.exe: | .downloads/sdcc + wget -c https://sourceforge.net/projects/sdcc/files/sdcc-win32/4.1.0/$(@F)/download -O $@ + +sdcc/.extracted: $(SDCC_ARCHIVE) + rm -rf $(@D) + extract.sh $<\ + --sha256 $(SDCC_ARCHIVE_SHA256)\ + --type $(SDCC_ARCHIVE_TYPE)\ + --subdir $(SDCC_ARCHIVE_SUBDIR)\ + --output $(@D) + touch $@ + +build-sdcc: sdcc/.extracted + +install-sdcc: | sdcc/.extracted + cd sdcc;\ + { echo '# This file was automatically generated by Make.';\ + echo '.PHONY: install';\ + echo 'install:\';\ + find $(SDCC_SUBDIRS) -type f\ + | sed -Ee 's,(.+), $$(DEST)$$(prefix)/\1\\,';\ + echo '';\ + find $(SDCC_SUBDIRS) -type d\ + | sed -Ee 's,(.+),$$(prefix)/\1\\,';\ + echo -e ':\n\tmkdir -p $$@';\ + for d in $(SDCC_SUBDIRS); do\ + if [ $$d = bin ]; then\ + find $$d -type f\ + | awk '{print gensub(/^(.+)\/([^/]+)/, "$$(DEST)$$(prefix)/\\1/\\2: \\1/\\2 | $$(DEST)$$(prefix)/\\1\n\t$$(INSTALL_PROGRAM) -m 755 $$< $$@", "g")}';\ + else\ + find $$d -type f\ + | awk '{print gensub(/^(.+)\/([^/]+)/, "$$(DEST)$$(prefix)/\\1/\\2: \\1/\\2 | $$(DEST)$$(prefix)/\\1\n\t$$(INSTALL) -m 644 $$< $$@", "g")}';\ + fi;\ + done; } >install.mk;\ + $(MAKE) -w -f install.mk DEST=$(DEST) prefix=$(prefix) INSTALL=$(INSTALL) INSTALL_PROGRAM=$(INSTALL_PROGRAM) install + + ifeq ($(_DoClean),1) + +uninstall-sdcc: + test '$(SDCCHOME)' = . || rm -rf $(SDCCHOME) + +clean-sdcc\ +distclean-sdcc: + rm -rf sdcc + + else # !_DoClean + +uninstall-sdcc\ +clean-sdcc\ +distclean-sdcc:; + + endif # !_DoClean + +endif # _UsePrecompiledOnWindows diff --git a/sdk/src/sdcc.mk b/sdk/src/sdcc.mk new file mode 100644 index 0000000..72151b3 --- /dev/null +++ b/sdk/src/sdcc.mk @@ -0,0 +1,51 @@ +# sdcc.mk - build and install SDCC from sources. +# +# SPDX-FileCopyrightText: 2021 Ivan Tatarinov +# +# SPDX-License-Identifier: GPL-3.0-or-later +# +# Supported environments: +# * GNU on Linux, FreeBSD etc. +# * GNU on Windows NT (using MinGW/MSYS/Cygwin/WSL) +# +# Build: +# make [BUILD=] -w -C sdcc -f ../sdcc.mk [all | build] +# Install / Uninstall: +# make [BUILD=] [prefix=] -w -C sdcc -f ../sdcc.mk install | uninstall +# Clean: +# make [BUILD=] -w -C sdcc -f ../sdcc.mk clean | distclean +# +# where: +# is one of: mingw32, mingw64. +# is a prefix directory to install files into. + +include ../../common.mk + +# Use absolute path for install/uninstall (a feature of SDCC build process) + +prefix ?= $(USE_PREFIX)/opt/sdcc + +.PHONY: all +all: build + +$(DESTDIR)$(prefix): + mkdir -p $@ + +Makefile: configure + ./configure + +.PHONY: build +build: | Makefile + $(MAKE) + +.PHONY: install +install: | Makefile $(DESTDIR)$(prefix) + $(MAKE) prefix=$(shell realpath $(DESTDIR)$(prefix)) $@ + +.PHONY: uninstall +uninstall: | Makefile + $(MAKE) prefix=$(shell realpath $(DESTDIR)$(prefix)) $@ + +.PHONY: clean distclean +clean distclean: | Makefile + $(MAKE) $@ diff --git a/sdk/src/sjasmplus-z00m128.inc.mk b/sdk/src/sjasmplus-z00m128.inc.mk index 6ad1375..b468b35 100644 --- a/sdk/src/sjasmplus-z00m128.inc.mk +++ b/sdk/src/sjasmplus-z00m128.inc.mk @@ -88,7 +88,7 @@ sjasmplus-z00m128/.extracted: $(SJASMPLUS_ARCHIVE) install-sjasmplus: $(DESTDIR)$(bindir)/sjasmplus$(EXESUFFIX) $(DESTDIR)$(bindir)/sjasmplus$(EXESUFFIX): sjasmplus-z00m128/sjasmplus$(EXESUFFIX) | $(DESTDIR)$(bindir) - $(INSTALL_PROGRAM) $< $@ + $(INSTALL_PROGRAM) -m 755 $< $@ ifeq ($(_DoClean),1) diff --git a/sdk/src/sjasmplus-z00m128.mk b/sdk/src/sjasmplus-z00m128.mk index 4cdf0c7..dfc0b6a 100644 --- a/sdk/src/sjasmplus-z00m128.mk +++ b/sdk/src/sjasmplus-z00m128.mk @@ -45,7 +45,7 @@ $(srcdir)/sjasmplus$(EXESUFFIX): | Makefile install: $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t)) $(DESTDIR)$(bindir)/sjasmplus$(EXESUFFIX): sjasmplus$(EXESUFFIX) | $(DESTDIR)$(bindir) - $(INSTALL_PROGRAM) $< $@ + $(INSTALL_PROGRAM) -m 755 $< $@ .PHONY: uninstall uninstall: diff --git a/sdk/src/sjasmplus.inc.mk b/sdk/src/sjasmplus.inc.mk index 2a0efb5..e12279d 100644 --- a/sdk/src/sjasmplus.inc.mk +++ b/sdk/src/sjasmplus.inc.mk @@ -102,7 +102,7 @@ sjasmplus/.extracted: $(SJASMPLUS_ARCHIVE) install-sjasmplus: $(DESTDIR)$(bindir)/sjasmplus$(EXESUFFIX) $(DESTDIR)$(bindir)/sjasmplus$(EXESUFFIX): sjasmplus/sjasmplus$(EXESUFFIX) | $(DESTDIR)$(bindir) - $(INSTALL_PROGRAM) $< $@ + $(INSTALL_PROGRAM) -m 755 $< $@ ifeq ($(_DoClean),1) diff --git a/sdk/src/sjasmplus.mk b/sdk/src/sjasmplus.mk index 70fcc0d..7feb102 100644 --- a/sdk/src/sjasmplus.mk +++ b/sdk/src/sjasmplus.mk @@ -54,7 +54,7 @@ build/Makefile: | build install: $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t)) $(DESTDIR)$(bindir)/sjasmplus$(EXESUFFIX): build/sjasmplus$(EXESUFFIX) | $(DESTDIR)$(bindir) - $(INSTALL_PROGRAM) $< $@ + $(INSTALL_PROGRAM) -m 755 $< $@ .PHONY: uninstall uninstall: diff --git a/sdk/src/tools/Makefile b/sdk/src/tools/Makefile index c149f1f..58eefd5 100644 --- a/sdk/src/tools/Makefile +++ b/sdk/src/tools/Makefile @@ -68,7 +68,7 @@ install: $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t)) # $1 = target define install_bin_rule = $$(DESTDIR)$$(bindir)/$1: build/$1 | $$(DESTDIR)$$(bindir) - $$(INSTALL_PROGRAM) $$< $$@ + $$(INSTALL_PROGRAM) -m 755 $$< $$@ endef $(foreach t,$(BINS),$(eval $(call install_bin_rule,$(t)))) diff --git a/sdk/src/zx7b/Makefile b/sdk/src/zx7b/Makefile index 823104c..9546493 100644 --- a/sdk/src/zx7b/Makefile +++ b/sdk/src/zx7b/Makefile @@ -51,10 +51,10 @@ build/dzx7b$(EXESUFFIX): $(srcdir)/dzx7b.c Makefile | build install: $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t)) $(DESTDIR)$(bindir)/zx7b$(EXESUFFIX): build/zx7b$(EXESUFFIX) | $(DESTDIR)$(bindir) - $(INSTALL_PROGRAM) $< $@ + $(INSTALL_PROGRAM) -m 755 $< $@ $(DESTDIR)$(bindir)/dzx7b$(EXESUFFIX): build/dzx7b$(EXESUFFIX) | $(DESTDIR)$(bindir) - $(INSTALL_PROGRAM) $< $@ + $(INSTALL_PROGRAM) -m 755 $< $@ .PHONY: uninstall uninstall: diff --git a/sdk/windows-x86/.gitignore b/sdk/windows-x86/.gitignore new file mode 100644 index 0000000..7d03c7c --- /dev/null +++ b/sdk/windows-x86/.gitignore @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2021 Ivan Tatarinov +# +# SPDX-License-Identifier: CC0-1.0 + +opt diff --git a/software/esxdos/Makefile b/software/esxdos/Makefile index e98202b..410f7cf 100644 --- a/software/esxdos/Makefile +++ b/software/esxdos/Makefile @@ -126,21 +126,12 @@ ESXDOS_ARCHIVE_TYPE = .zip ESXDOS_ARCHIVE_SUBDIR = . build/.extracted: $(ESXDOS_ARCHIVE) | build - echo '$(ESXDOS_ARCHIVE_SHA256) $<' >$<.sha256 - sha256sum -c $<.sha256 - rm -f $<.sha256 rm -rf $(@D) - test '$(@D)' = '$(ESXDOS_ARCHIVE_SUBDIR)' -o '$(ESXDOS_ARCHIVE_SUBDIR)' = . || rm -rf $(ESXDOS_ARCHIVE_SUBDIR) -ifeq ($(ESXDOS_ARCHIVE_TYPE),.zip) - ifeq ($(ESXDOS_ARCHIVE_SUBDIR),.) - unzip -nq $< -d $(@D) - else - unzip -nq $< - endif -else - $(error Not implemented) -endif - test '$(@D)' = '$(ESXDOS_ARCHIVE_SUBDIR)' -o '$(ESXDOS_ARCHIVE_SUBDIR)' = . || mv $(ESXDOS_ARCHIVE_SUBDIR) $(@D) + extract.sh $<\ + --sha256 $(ESXDOS_ARCHIVE_SHA256)\ + --type $(ESXDOS_ARCHIVE_TYPE)\ + --subdir $(ESXDOS_ARCHIVE_SUBDIR)\ + --output $(@D) touch $@ .downloads/esxdos/esxdos089.zip: | .downloads/esxdos @@ -202,9 +193,6 @@ uninstall: .PHONY: clean clean: - rm -f\ - .downloads/esxdos/esxdos089.zip.sha256\ - .downloads/esxdos rm -rf build/* .PHONY: distclean