mirror of https://github.com/zxdos/zxuno.git
sdk: added alternative `sjasmplus` compiler by aprisobal
* sdk: `sjasmplus` compiler by aprisobal is default now
This commit is contained in:
parent
5e33fd17f3
commit
a16b6046bd
|
@ -0,0 +1,5 @@
|
|||
# SPDX-FileCopyrightText: 2021 Ivan Tatarinov <ivan-tat@ya.ru>
|
||||
#
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
conf.mk
|
12
sdk/Makefile
12
sdk/Makefile
|
@ -6,6 +6,8 @@
|
|||
# * GNU on Linux, FreeBSD etc.
|
||||
# * GNU on Windows NT (using MinGW/MSYS/Cygwin/WSL)
|
||||
#
|
||||
# Configure:
|
||||
# make configure [<CFG_PARAMS>]
|
||||
# Build:
|
||||
# make [<FLAGS>] build | build-<TARGET>
|
||||
# Install:
|
||||
|
@ -17,6 +19,8 @@
|
|||
# make [<FLAGS>] distclean | distclean-<TARGET>
|
||||
#
|
||||
# where:
|
||||
# <CFG_PARAMS> is a set of parameters of type <CFG_VAR>=<VALUE>
|
||||
# USE_SJASMPLUS_VERSION: sjasmplus, z00m128 (default).
|
||||
# <FLAGS> are these flags:
|
||||
# [BUILD=<BUILD>] [FORCEBUILD=<FB_FLAG>] [FORCECLEAN=<FC_FLAG>]
|
||||
# where values are:
|
||||
|
@ -62,8 +66,14 @@ $(TARGETS): | src
|
|||
$(MAKE) -w -C $| prefix=$(shell realpath --relative-to=$| $(prefix)) install-$@
|
||||
|
||||
.PHONY:\
|
||||
build install uninstall clean distclean\
|
||||
configure build install uninstall clean distclean\
|
||||
$(foreach t,$(TARGETS),build-$(t) install-$(t) uninstall-$(t) clean-$(t) distclean-$(t))
|
||||
|
||||
configure:
|
||||
@echo '# This is a local configuration file for Make.' >conf.mk;\
|
||||
echo '# This file is generated automatically by `make configure`.' >>conf.mk;\
|
||||
echo 'USE_SJASMPLUS_VERSION=$(USE_SJASMPLUS_VERSION)' >>conf.mk
|
||||
|
||||
build install uninstall clean distclean \
|
||||
$(foreach t,$(TARGETS),build-$(t) install-$(t) uninstall-$(t) clean-$(t) distclean-$(t)): | src
|
||||
$(MAKE) -w -C $| prefix=$(shell realpath --relative-to=$| $(prefix)) $@
|
||||
|
|
|
@ -10,6 +10,7 @@ No one yet.
|
|||
|
||||
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.
|
||||
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.
|
||||
|
||||
|
@ -71,6 +72,8 @@ Go to the project's root directory, enter `sdk` sub-directory and type one of th
|
|||
|
||||
Command | Description
|
||||
----|----
|
||||
`make configure` | Configure build with default values (on first call)
|
||||
`make configure <CFG_PARAMS>` | Configure build with explicit values
|
||||
`make` | Build and install all tools from sources
|
||||
`make <TARGET>` | Build and install only the TARGET from sources
|
||||
`make BUILD=<BUILD>` | Cross-build and install all tools from sources for Windows platform
|
||||
|
@ -78,6 +81,12 @@ Command | Description
|
|||
|
||||
where:
|
||||
|
||||
`<CFG_PARAMS>` is a series of parameters of type `<CFG_VAR>=<VALUE>`.
|
||||
|
||||
Value of `<CFG_VAR>` | Possible values | Description
|
||||
----|----|----
|
||||
`USE_SJASMPLUS_VERSION` | `sjasmplus`, `z00m128` | Version of SJAsmPlus Z80 Compiler to use. Default is `z00m128` (aprisobal).
|
||||
|
||||
Value of `TARGET` | Origin | Description
|
||||
----|----|----
|
||||
`sjasmplus` | downloaded | SJAsmPlus Z80 Assembler
|
||||
|
@ -194,6 +203,8 @@ Go to the project's root directory, enter `sdk` sub-directory and type one of th
|
|||
|
||||
Command | Description
|
||||
----|----
|
||||
`make configure` | Configure build with default values (on first call)
|
||||
`make configure <CFG_PARAMS>` | Configure build with explicit values
|
||||
`make` | **Quick setup** of all tools (download precompiled binaries and install them)
|
||||
`make <TARGET>` | **Qucik setup** of the TARGET only
|
||||
`make FORCEBUILD=1` | Build and install all tools from sources
|
||||
|
@ -201,6 +212,8 @@ Command | Description
|
|||
|
||||
where:
|
||||
|
||||
`<CFG_PARAMS>` is a series of parameters as described in [2.2](#22-build-tools).
|
||||
|
||||
Value of `TARGET` | Sources origin | Binaries origin (**Quick setup**) | Build from sources
|
||||
----|----|----|----
|
||||
`sjasmplus` | downloaded | downloaded (**yes**) | available
|
||||
|
@ -280,6 +293,7 @@ These changes are actual for current invocation of command shell and all child p
|
|||
* [cmd](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) - command interpreter in Windows
|
||||
* [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
|
||||
* [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)
|
||||
|
|
|
@ -31,6 +31,11 @@ export PATH
|
|||
|
||||
endif # !ZXSDK
|
||||
|
||||
-include $(ZXSDK)/conf.mk
|
||||
|
||||
# Default values
|
||||
USE_SJASMPLUS_VERSION ?= z00m128
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
EXESUFFIX := .exe
|
||||
DLLSUFFIX := .dll
|
||||
|
|
|
@ -9,6 +9,11 @@ sjasmplus-win32.7z
|
|||
sjasmplus-win32.7z.sha256
|
||||
sjasmplus-win64.7z
|
||||
sjasmplus-win64.7z.sha256
|
||||
sjasmplus-z00m128
|
||||
sjasmplus-z00m128-src.tgz
|
||||
sjasmplus-z00m128-src.tgz.sha256
|
||||
sjasmplus-z00m128-win32.zip
|
||||
sjasmplus-z00m128-win32.zip.sha256
|
||||
z88dk
|
||||
z88dk-src.tgz
|
||||
z88dk-src.tgz.sha256
|
||||
|
|
115
sdk/src/Makefile
115
sdk/src/Makefile
|
@ -53,25 +53,24 @@ distclean: $(foreach t,$(TARGETS),distclean-$(t))
|
|||
|
||||
_DoBuild:=1
|
||||
_UsePrecompiledOnWindows:=0
|
||||
_DoClean:=1
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
ifneq ($(FORCEBUILD),1)
|
||||
_DoBuild:=0
|
||||
_UsePrecompiledOnWindows:=1
|
||||
endif
|
||||
endif
|
||||
|
||||
_DoClean:=1
|
||||
ifeq ($(OS),Windows_NT)
|
||||
ifneq ($(FORCECLEAN),1)
|
||||
_DoClean:=0
|
||||
endif
|
||||
endif
|
||||
endif # $(OS)==Windows_NT
|
||||
|
||||
# sjasmplus
|
||||
|
||||
.PHONY: $(foreach a,build install uninstall clean distclean,$(a)-sjasmplus)
|
||||
|
||||
ifeq ($(USE_SJASMPLUS_VERSION),sjasmplus)
|
||||
|
||||
ifeq ($(_DoBuild),1)
|
||||
|
||||
build-sjasmplus: | sjasmplus/.extracted sjasmplus.mk
|
||||
|
@ -95,14 +94,14 @@ install-sjasmplus: | sjasmplus/.extracted sjasmplus.mk
|
|||
ifeq ($(_DoClean),1)
|
||||
|
||||
uninstall-sjasmplus: | sjasmplus.mk
|
||||
if test -f sjasmplus; then\
|
||||
if test -d sjasmplus; then\
|
||||
$(MAKE) -w -C sjasmplus -f ../sjasmplus.mk prefix=$(shell realpath --relative-to=sjasmplus $(prefix)) uninstall;\
|
||||
else\
|
||||
rm -f $(DESTDIR)$(bindir)/sjasmplus$(EXESUFFIX);\
|
||||
fi
|
||||
|
||||
clean-sjasmplus: | sjasmplus.mk
|
||||
if test -f sjasmplus; then $(MAKE) -w -C sjasmplus -f ../sjasmplus.mk clean; fi
|
||||
if test -d sjasmplus; then $(MAKE) -w -C sjasmplus -f ../sjasmplus.mk clean; fi
|
||||
|
||||
else # !_DoClean
|
||||
|
||||
|
@ -176,6 +175,108 @@ distclean-sjasmplus:;
|
|||
|
||||
endif # !_DoClean
|
||||
|
||||
else ifeq ($(USE_SJASMPLUS_VERSION),z00m128)
|
||||
|
||||
ifeq ($(_DoBuild),1)
|
||||
|
||||
build-sjasmplus: | sjasmplus-z00m128/.extracted sjasmplus-z00m128.mk
|
||||
$(MAKE) -w -C sjasmplus -f ../sjasmplus-z00m128.mk prefix=$(shell realpath --relative-to=sjasmplus-z00m128 $(prefix))
|
||||
|
||||
sjasmplus-z00m128/.extracted: sjasmplus-z00m128-src.tgz
|
||||
echo '114807bf53d3526b4d1ae7d40f3050b9ee98220df74931efc1e6d1fe5aba3d02 $<' >$<.sha256
|
||||
sha256sum -c $<.sha256
|
||||
rm -f $<.sha256
|
||||
rm -rf $(@D) sjasmplus-1.18.2
|
||||
tar -xzf $<
|
||||
mv sjasmplus-1.18.2 $(@D)
|
||||
touch $@
|
||||
|
||||
sjasmplus-z00m128-src.tgz:
|
||||
wget -c https://github.com/z00m128/sjasmplus/archive/refs/tags/v1.18.2.tar.gz -O $@
|
||||
|
||||
install-sjasmplus: | sjasmplus-z00m128/.extracted sjasmplus-z00m128.mk
|
||||
$(MAKE) -w -C sjasmplus-z00m128 -f ../sjasmplus-z00m128.mk prefix=$(shell realpath --relative-to=sjasmplus-z00m128 $(prefix)) install
|
||||
|
||||
ifeq ($(_DoClean),1)
|
||||
|
||||
uninstall-sjasmplus: | sjasmplus-z00m128.mk
|
||||
if test -d sjasmplus-z00m128; then\
|
||||
$(MAKE) -w -C sjasmplus-z00m128 -f ../sjasmplus-z00m128.mk prefix=$(shell realpath --relative-to=sjasmplus-z00m128 $(prefix)) uninstall;\
|
||||
else\
|
||||
rm -f $(DESTDIR)$(bindir)/sjasmplus$(EXESUFFIX);\
|
||||
fi
|
||||
|
||||
clean-sjasmplus: | sjasmplus-z00m128.mk
|
||||
if test -d sjasmplus-z00m128; then $(MAKE) -w -C sjasmplus-z00m128 -f ../sjasmplus-z00m128.mk clean; fi
|
||||
|
||||
else # !_DoClean
|
||||
|
||||
uninstall-sjasmplus clean-sjasmplus:;
|
||||
|
||||
endif # !_DoClean
|
||||
endif # _DoBuild
|
||||
|
||||
ifeq ($(_UsePrecompiledOnWindows),1)
|
||||
|
||||
build-sjasmplus: sjasmplus-z00m128/sjasmplus$(EXESUFFIX)
|
||||
|
||||
sjasmplus-z00m128/sjasmplus$(EXESUFFIX): | sjasmplus-z00m128/.extracted
|
||||
|
||||
SJASMPLUS_ARCHIVE := sjasmplus-z00m128-win32.zip
|
||||
SJASMPLUS_ARCHIVE_SHA256 := 848bca2522d6febbf3e3c48c634731ecd61899166f5922ed15857e8063c3dc4b
|
||||
|
||||
sjasmplus-z00m128/.extracted: $(SJASMPLUS_ARCHIVE)
|
||||
echo '$(SJASMPLUS_ARCHIVE_SHA256) $<' >$<.sha256
|
||||
sha256sum -c $<.sha256
|
||||
rm -f $<.sha256
|
||||
rm -rf $(@D)
|
||||
unzip -nq $<
|
||||
mv sjasmplus-1.18.2.win $(@D)
|
||||
touch $@
|
||||
|
||||
sjasmplus-z00m128-win32.zip:
|
||||
wget -c https://github.com/z00m128/sjasmplus/releases/download/v1.18.2/sjasmplus-1.18.2.win.zip -O $@
|
||||
|
||||
install-sjasmplus: $(DESTDIR)$(bindir)/sjasmplus$(EXESUFFIX)
|
||||
|
||||
$(DESTDIR)$(bindir)/sjasmplus$(EXESUFFIX): sjasmplus-z00m128/sjasmplus$(EXESUFFIX)
|
||||
$(INSTALL_PROGRAM) $< $@
|
||||
|
||||
ifeq ($(_DoClean),1)
|
||||
|
||||
uninstall-sjasmplus:
|
||||
rm -f $(DESTDIR)$(bindir)/sjasmplus$(EXESUFFIX)
|
||||
|
||||
clean-sjasmplus:
|
||||
rm -rf sjasmplus-z00m128
|
||||
|
||||
else # !_DoClean
|
||||
|
||||
uninstall-sjasmplus clean-sjasmplus:;
|
||||
|
||||
endif # !_DoClean
|
||||
endif # _UsePrecompiledOnWindows
|
||||
|
||||
ifeq ($(_DoClean),1)
|
||||
|
||||
distclean-sjasmplus:
|
||||
rm -rf sjasmplus-z00m128
|
||||
rm -f\
|
||||
sjasmplus-z00m128-src.tgz\
|
||||
sjasmplus-z00m128-src.tgz.sha256\
|
||||
sjasmplus-z00m128-win32.zip\
|
||||
sjasmplus-z00m128-win32.zip.sha256
|
||||
|
||||
else # !_DoClean
|
||||
|
||||
distclean-sjasmplus:;
|
||||
|
||||
endif # !_DoClean
|
||||
|
||||
else
|
||||
$(error Unknown SJAsmPlus version selected: `$(USE_SJASMPLUS_VERSION)')
|
||||
endif
|
||||
|
||||
# z88dk
|
||||
|
||||
.PHONY: $(foreach a,build install uninstall clean distclean,$(a)-z88dk)
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
# SPDX-FileCopyrightText: 2021 Ivan Tatarinov <ivan-tat@ya.ru>
|
||||
#
|
||||
# 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=<BUILD>] -w -C sjasmplus-z00m128 -f ../sjasmplus-z00m128.mk
|
||||
# Install / Uninstall:
|
||||
# make [BUILD=<BUILD>] [prefix=<PREFIX>] -w -C sjasmplus-z00m128 -f ../sjasmplus-z00m128.mk install | uninstall
|
||||
# Clean:
|
||||
# make [BUILD=<BUILD>] -w -C sjasmplus-z00m128 -f ../sjasmplus-z00m128.mk clean
|
||||
#
|
||||
# where:
|
||||
# <BUILD> - see included `common.mk'.
|
||||
# <PREFIX> is a prefix directory to install files into.
|
||||
|
||||
include ../../common.mk
|
||||
|
||||
srcdir = .
|
||||
prefix ?= /usr/local
|
||||
exec_prefix ?= $(prefix)
|
||||
bindir ?= $(exec_prefix)/bin
|
||||
|
||||
INSTALL ?= install
|
||||
INSTALL_PROGRAM ?= $(INSTALL)
|
||||
|
||||
BINS = sjasmplus$(EXESUFFIX)
|
||||
|
||||
.PHONY: all
|
||||
all: $(foreach t,$(BINS),build/$(t))
|
||||
|
||||
build\
|
||||
$(DESTDIR)$(bindir):
|
||||
mkdir -p $@
|
||||
|
||||
sjasmplus$(EXESUFFIX): | Makefile
|
||||
$(MAKE) clean
|
||||
$(MAKE)
|
||||
|
||||
.PHONY: install
|
||||
install: $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t))
|
||||
|
||||
$(DESTDIR)$(bindir)/sjasmplus$(EXESUFFIX): sjasmplus$(EXESUFFIX) | $(DESTDIR)$(bindir)
|
||||
$(INSTALL_PROGRAM) $< $@
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
rm -f $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t))
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(MAKE) clean
|
||||
|
||||
.PHONY: distclean
|
||||
distclean: clean
|
|
@ -29,9 +29,6 @@ INSTALL_PROGRAM ?= $(INSTALL)
|
|||
|
||||
BINS = sjasmplus$(EXESUFFIX)
|
||||
|
||||
.PHONY: all
|
||||
all: $(foreach t,$(BINS),build/$(t))
|
||||
|
||||
ifeq ($(BUILD),mingw32)
|
||||
CMAKEFLAGS := -DCMAKE_TOOLCHAIN_FILE=../Toolchain-mingw32.cmake
|
||||
else ifeq ($(BUILD),mingw64)
|
||||
|
|
Loading…
Reference in New Issue