diff --git a/modflash/Makefile b/modflash/Makefile index 67624da..4736e50 100644 --- a/modflash/Makefile +++ b/modflash/Makefile @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2021 Ivan Tatarinov +# +# SPDX-License-Identifier: GPL-3.0-or-later +# # Supported environments: # * GNU/Linux # * Windows NT (using MinGW/MSYS/Cygwin/WSL) diff --git a/modflash/README.md b/modflash/README.md index 251c9db..8a3178d 100644 --- a/modflash/README.md +++ b/modflash/README.md @@ -1,3 +1,15 @@ +# Authors + +2021 Ivan Tatarinov + +# Contributors + +No one yet. + +# License + +This document is under [GNU FDL-1.3 or later](http://www.gnu.org/licenses/fdl-1.3.html) license. + # Target File `FLASH.ZX1`. diff --git a/modflash/README.md.license b/modflash/README.md.license new file mode 100644 index 0000000..8393cb5 --- /dev/null +++ b/modflash/README.md.license @@ -0,0 +1,5 @@ +SPDX-FileType: TEXT + +SPDX-FileCopyrightText: 2021 Ivan Tatarinov + +SPDX-License-Identifier: GFDL-1.3-or-later diff --git a/modflash/addcore.bat b/modflash/addcores.bat similarity index 62% rename from modflash/addcore.bat rename to modflash/addcores.bat index f4a4938..fd98da5 100644 --- a/modflash/addcore.bat +++ b/modflash/addcores.bat @@ -1,4 +1,10 @@ @echo off +rem SPDX-FileCopyrightText: 2021 Ivan Tatarinov +rem +rem SPDX-FileNotice: Based on code by Antonio Villena <_@antoniovillena.es> +rem +rem SPDX-License-Identifier: GPL-3.0-or-later + set /a i=2 for /f "eol=# tokens=1,2,3 delims=;" %%a in (cores.txt) do call :AddCore %%a %%b %%c exit /b @@ -15,4 +21,4 @@ exit /b :Error echo ERROR: Exit status %ERRORLEVEL%. Stopped. -exit %ERRORLEVEL% /b +exit /b %ERRORLEVEL% diff --git a/modflash/addcores.sh b/modflash/addcores.sh index 48bb1c4..123c3c0 100755 --- a/modflash/addcores.sh +++ b/modflash/addcores.sh @@ -1,4 +1,10 @@ #!/bin/bash -e +# SPDX-FileCopyrightText: 2021 Ivan Tatarinov +# +# SPDX-FileNotice: Based on code by Antonio Villena <_@antoniovillena.es> +# +# SPDX-License-Identifier: GPL-3.0-or-later + GENROM=./GenRom ADDITEM=./AddItem i=2 diff --git a/modflash/addrom.bat b/modflash/addroms.bat similarity index 65% rename from modflash/addrom.bat rename to modflash/addroms.bat index d82c649..60ada8f 100644 --- a/modflash/addrom.bat +++ b/modflash/addroms.bat @@ -1,4 +1,10 @@ @echo off +rem SPDX-FileCopyrightText: 2021 Ivan Tatarinov +rem +rem SPDX-FileNotice: Based on code by Antonio Villena <_@antoniovillena.es> +rem +rem SPDX-License-Identifier: GPL-3.0-or-later + set /a i=0 for /f "eol=# tokens=1,2,3 delims=;" %%a in (roms.txt) do call :AddROM %%a %%b %%c exit /b @@ -16,4 +22,4 @@ exit /b :Error echo ERROR: Exit status %ERRORLEVEL%. Stopped. -exit %ERRORLEVEL% /b +exit /b %ERRORLEVEL% diff --git a/modflash/addroms.sh b/modflash/addroms.sh index 0b1c013..ae36632 100755 --- a/modflash/addroms.sh +++ b/modflash/addroms.sh @@ -1,4 +1,10 @@ #!/bin/bash -e +# SPDX-FileCopyrightText: 2021 Ivan Tatarinov +# +# SPDX-FileNotice: Based on code by Antonio Villena <_@antoniovillena.es> +# +# SPDX-License-Identifier: GPL-3.0-or-later + GENROM=./GenRom ADDITEM=./AddItem i=0 diff --git a/modflash/make.bat b/modflash/make.bat index 06cb5f5..89304dc 100644 --- a/modflash/make.bat +++ b/modflash/make.bat @@ -1,3 +1,6 @@ +@rem SPDX-FileCopyrightText: 2019 Antonio Villena <_@antoniovillena.es> +@rem +@rem SPDX-FileContributor: 2021 Ivan Tatarinov copy /Y FLASHempty.ZX1 FLASH.ZX1 -call addrom -call addcore +call addroms.bat +call addcores.bat diff --git a/sdk/Makefile b/sdk/Makefile index b003ff0..3b82f73 100644 --- a/sdk/Makefile +++ b/sdk/Makefile @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2021 Ivan Tatarinov +# +# SPDX-License-Identifier: GPL-3.0-or-later +# # Supported environments: # * GNU/Linux # * Windows NT (using MinGW/MSYS/Cygwin/WSL) diff --git a/sdk/README.md b/sdk/README.md new file mode 100644 index 0000000..d176571 --- /dev/null +++ b/sdk/README.md @@ -0,0 +1,137 @@ +# Authors + +2021 Ivan Tatarinov + +# Contributors + +No one yet. + +# License + +This document is under [GNU FDL-1.3 or later](http://www.gnu.org/licenses/fdl-1.3.html) license. + +# 1. General information + +The source code of all tools is in `src` directory. All compiled binaries are placed in `bin` directory. + +## 1.1. Copyright and licensing information for files + +We try to follow [REUSE recommendations](https://reuse.software/tutorial/) on how to easely specify copyright and licensing information to our files. +So we added this information to each source file we used according to [SPDX specification](https://spdx.dev/specifications/). +Check it out by using this [reuse-tool](https://github.com/fsfe/reuse-tool). + +# 2. Using SDK in GNU environment on Linux, FreeBSD etc. + +## 2.1. Build tools + +To build all tools type: + +```bash +make +``` + +To build only **sjasmplus** type: + +```bash +make bin/sjasmplus +``` + +## 2.2. Clean tools + +To clean everything type: + +```bash +make clean +``` + +## 2.3. Tools usage + +These tools are supposed to be used mainly in Makefiles and Bash scripts invoked from Makefiles. + +### 2.3.1. In Makefiles + +To use these tools in a Makefile just include `common.mk` file at the beginning of one like this: + +```make +include ../sdk/common.mk +``` + +Remember to specify correct relative path to it. + +This will set "ZXUNOSDK" environment variable (on first inclusion only) and update your "PATH" environment variable to point to SDK's tools. +These changes are actual for current invocation of "make" utility and all child processes. + +### 2.3.2. In Bash scripts + +Bash scripts are supposed to be invoked from Makefiles where the correct environment is already prepared by "make" utility so nothing must be done for such scripts. + +In other cases you must source `setvars.sh` file in a Bash script like this: + +```bash +source ../sdk/setvars.sh +``` + +or + +```bash +. ../sdk/setvars.sh +``` + +Remember to specify correct relative path to it. + +This has the same behavior as the inclusion of `common.mk` file in a Makefile. + +# 3. Using SDK in GNU environment on Windows + +**NOTE**: compilation of the following tools: + +* sjasmplus + +on Windows platform is disabled right now because of presence of precompiled binaries of them in repository. They are not deleted when cleaning. + +## 3.1. Build tools + +To build all tools type: + +```bash +make +``` + +To build only **sjasmplus** type: + +``` +make bin/sjasmplus.exe +``` + +## 3.2. Clean tools + +To clean everything type: + +```bash +make clean +``` + +## 3.3. Tools usage + +### 3.3.1. In Makefiles + +The usage is similar to one for GNU/Linux, FreeBSD etc. See [2.3.1](#231-in-makefiles). + +### 3.3.2. In Bash scripts + +The usage is similar to one for GNU/Linux, FreeBSD etc. See [2.3.2](#232-in-bash-scripts). + +# 4. Using SDK on Windows without GNU environment + +## 4.1. In batch scripts + +To use these tools in a batch script just call `setvars.bat` file at the beginning of one like this: + +```batch +call ..\sdk\setvars.bat +``` + +Remember to specify correct relative path to it. + +This will set "ZXUNOSDK" environment variable (on first call only) and update your "PATH" environment variable to point to SDK's tools. +These changes are actual for current invocation of command shell and all child processes. diff --git a/sdk/README.md.license b/sdk/README.md.license new file mode 100644 index 0000000..8393cb5 --- /dev/null +++ b/sdk/README.md.license @@ -0,0 +1,5 @@ +SPDX-FileType: TEXT + +SPDX-FileCopyrightText: 2021 Ivan Tatarinov + +SPDX-License-Identifier: GFDL-1.3-or-later diff --git a/sdk/bin/sjasmplus.exe.license b/sdk/bin/sjasmplus.exe.license new file mode 100644 index 0000000..aadfbe1 --- /dev/null +++ b/sdk/bin/sjasmplus.exe.license @@ -0,0 +1,17 @@ +SPDX-FileName: sjasmplus.exe + +SPDX-FileType: BINARY + +SPDX-FileChecksum: SHA1: 0fea7c17d5e83c03466ab99141add32551f16714 + +SPDX-LicenseConcluded: Zlib + +SPDX-LicenseComments: The concluded license is taken from external sources showed in program's banner after program was started. + +SPDX-FileCopyrightText: Copyright 2004-2008 by Aprisobal / http://sjasmplus.sf.net / my@aprisobal.by / + +SPDX-FileComment: SjASMPlus Z80 Cross-Assembler v1.08 (build 07-04-2016) + +SPDX-FileNotice: based on code of SjASM by Sjoerd Mastijn / http://www.xl2s.tk / + +SPDX-FileContributor: Modified 2016 AntonioVillena diff --git a/sdk/common.mk b/sdk/common.mk index 1fc1c5f..ff29570 100644 --- a/sdk/common.mk +++ b/sdk/common.mk @@ -1,5 +1,9 @@ # Common declarations for Makefiles. # +# SPDX-FileCopyrightText: 2021 Ivan Tatarinov +# +# SPDX-License-Identifier: GPL-3.0-or-later +# # Supported environments: # * GNU/Linux # * Windows NT (using MinGW/MSYS/Cygwin/WSL) diff --git a/sdk/setvars.bat b/sdk/setvars.bat index 3c7499b..ffe8fac 100644 --- a/sdk/setvars.bat +++ b/sdk/setvars.bat @@ -1,4 +1,8 @@ @echo off +rem SPDX-FileCopyrightText: 2021 Ivan Tatarinov +rem +rem SPDX-License-Identifier: GPL-3.0-or-later + if not x%ZXUNOSDK% == x exit /b set ZXUNOSDK=%~dp0 set ZXUNOSDK=%ZXUNOSDK:~0,-1% diff --git a/sdk/setvars.sh b/sdk/setvars.sh new file mode 100644 index 0000000..aebd914 --- /dev/null +++ b/sdk/setvars.sh @@ -0,0 +1,10 @@ +#!/bin/bash -e +# SPDX-FileCopyrightText: 2021 Ivan Tatarinov +# +# SPDX-License-Identifier: GPL-3.0-or-later + +if [[ "x$ZXUNOSDK" == x ]]; then + ZXUNOSDK=$(dirname $(realpath "$0")) + PATH=$ZXUNOSDK/bin:$PATH + export ZXUNOSDK +fi diff --git a/sdk/src/Makefile b/sdk/src/Makefile index 8f45159..6cdabdd 100644 --- a/sdk/src/Makefile +++ b/sdk/src/Makefile @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2021 Ivan Tatarinov +# +# SPDX-License-Identifier: GPL-3.0-or-later +# # Supported environments: # * GNU/Linux # * Windows NT (using MinGW/MSYS/Cygwin/WSL) diff --git a/sdk/src/sjasmplus.mk b/sdk/src/sjasmplus.mk index 3d709a1..859cc39 100644 --- a/sdk/src/sjasmplus.mk +++ b/sdk/src/sjasmplus.mk @@ -1,11 +1,15 @@ -# Build: -# make -w -C sjasmplus -f ../sjasmplus.mk -# Clean: -# make -w -C sjasmplus -f ../sjasmplus.mk clean +# SPDX-FileCopyrightText: 2021 Ivan Tatarinov +# +# SPDX-License-Identifier: GPL-3.0-or-later # # Supported environments: # * GNU/Linux # * Windows NT (using MinGW/MSYS/Cygwin/WSL) +# +# Build: +# make -w -C sjasmplus -f ../sjasmplus.mk +# Clean: +# make -w -C sjasmplus -f ../sjasmplus.mk clean ifeq ($(OS),Windows_NT) SJASMPLUS := sjasmplus.exe