mirror of https://github.com/zxdos/zxuno.git
sdk: followed GNU standards in `src/sjasmplus.mk`
This commit is contained in:
parent
73794aaf2e
commit
cbacdd5d66
15
sdk/Makefile
15
sdk/Makefile
|
@ -12,13 +12,10 @@
|
||||||
# make [BUILD=<BUILD>] [FORCECLEAN=<FC_FLAG>] clean
|
# make [BUILD=<BUILD>] [FORCECLEAN=<FC_FLAG>] clean
|
||||||
#
|
#
|
||||||
# where:
|
# where:
|
||||||
# <BUILD> is one of: mingw32, mingw64.
|
# <BUILD> - see included `common.mk'.
|
||||||
# <FB_FLAG> is 1 to force build, otherwise do not (default).
|
# <FB_FLAG> is 1 to force build, otherwise do not (default).
|
||||||
# <FC_FLAG> is 1 to force clean, otherwise do not (default).
|
# <FC_FLAG> is 1 to force clean, otherwise do not (default).
|
||||||
# <TARGET> is one of: sjasmplus, z88dk, zx7b, tools
|
# <TARGET> is one of: sjasmplus, z88dk, zx7b, tools
|
||||||
#
|
|
||||||
# Notes:
|
|
||||||
# BUILD, FORCEBUILD, FORCECLEAN variables may be set in user's environment.
|
|
||||||
|
|
||||||
include common.mk
|
include common.mk
|
||||||
|
|
||||||
|
@ -46,13 +43,9 @@ export FORCECLEAN
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: sjasmplus z88dk zx7b tools
|
all: sjasmplus z88dk zx7b tools
|
||||||
|
|
||||||
.PHONY: sjasmplus z88dk
|
.PHONY: sjasmplus z88dk zx7b tools
|
||||||
sjasmplus z88dk: | src
|
sjasmplus z88dk zx7b tools: | src
|
||||||
$(MAKE) -w -C $| external-$@
|
$(MAKE) -w -C $| install-$@
|
||||||
|
|
||||||
.PHONY: zx7b tools
|
|
||||||
zx7b tools: | src
|
|
||||||
$(MAKE) -w -C $| local-$@
|
|
||||||
|
|
||||||
.PHONY: clean dist-clean
|
.PHONY: clean dist-clean
|
||||||
clean dist-clean: | src
|
clean dist-clean: | src
|
||||||
|
|
|
@ -7,33 +7,35 @@
|
||||||
# * GNU on Windows NT (using MinGW/MSYS/Cygwin/WSL)
|
# * GNU on Windows NT (using MinGW/MSYS/Cygwin/WSL)
|
||||||
#
|
#
|
||||||
# Build:
|
# Build:
|
||||||
# make [BUILD=<BUILD>] [FORCEBUILD=<FB_FLAG>] [<TARGET>]
|
# make [BUILD=<BUILD>] [FORCEBUILD=<FB_FLAG>] [install-<TARGET>]
|
||||||
# Clean:
|
# Clean:
|
||||||
# make [BUILD=<BUILD>] [FORCECLEAN=<FC_FLAG>] clean|dist-clean
|
# make [BUILD=<BUILD>] [FORCECLEAN=<FC_FLAG>] clean|dist-clean
|
||||||
#
|
#
|
||||||
# where:
|
# where:
|
||||||
# <BUILD> is one of: mingw32, mingw64.
|
# <BUILD> - see included `common.mk'.
|
||||||
# <FB_FLAG> is 1 to force build, otherwise do not (default).
|
# <FB_FLAG> is 1 to force build, otherwise do not (default).
|
||||||
# <FC_FLAG> is 1 to force clean, otherwise do not (default).
|
# <FC_FLAG> is 1 to force clean, otherwise do not (default).
|
||||||
# <TARGET> is one of:
|
# <TARGET> is one of:
|
||||||
# * external-sjasmplus
|
# * sjasmplus
|
||||||
# * external-z88dk
|
# * z88dk
|
||||||
# * local-zx7b
|
# * zx7b
|
||||||
# * local-tools
|
# * tools
|
||||||
#
|
|
||||||
# Notes:
|
|
||||||
# BUILD, FORCEBUILD, FORCECLEAN variables may be set in user's environment.
|
|
||||||
|
|
||||||
include ../common.mk
|
include ../common.mk
|
||||||
|
|
||||||
INSTALLDIR=../bin
|
prefix ?= ..
|
||||||
|
exec_prefix ?= $(prefix)
|
||||||
|
bindir ?= $(exec_prefix)/bin
|
||||||
|
|
||||||
|
INSTALL ?= install
|
||||||
|
INSTALL_PROGRAM ?= $(INSTALL)
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all:\
|
all:\
|
||||||
external-sjasmplus\
|
install-sjasmplus\
|
||||||
external-z88dk\
|
install-z88dk\
|
||||||
local-zx7b\
|
install-zx7b\
|
||||||
local-tools
|
install-tools
|
||||||
|
|
||||||
_DoBuild:=1
|
_DoBuild:=1
|
||||||
_UsePrecompiledOnWindows:=0
|
_UsePrecompiledOnWindows:=0
|
||||||
|
@ -54,17 +56,12 @@ endif
|
||||||
|
|
||||||
# sjasmplus
|
# sjasmplus
|
||||||
|
|
||||||
.PHONY: external-sjasmplus clean-sjasmplus
|
.PHONY: install-sjasmplus clean-sjasmplus
|
||||||
|
|
||||||
external-sjasmplus: $(INSTALLDIR)/sjasmplus$(EXESUFFIX)
|
|
||||||
|
|
||||||
ifeq ($(_DoBuild),1)
|
ifeq ($(_DoBuild),1)
|
||||||
|
|
||||||
$(INSTALLDIR)/sjasmplus$(EXESUFFIX): sjasmplus/build/sjasmplus$(EXESUFFIX)
|
install-sjasmplus: | sjasmplus/.extracted sjasmplus.mk
|
||||||
cp $< $@
|
$(MAKE) -w -C sjasmplus -f ../sjasmplus.mk prefix=$(shell realpath --relative-to=sjasmplus $(prefix)) install
|
||||||
|
|
||||||
sjasmplus/build/sjasmplus$(EXESUFFIX): | sjasmplus/.extracted sjasmplus.mk
|
|
||||||
$(MAKE) -w -C sjasmplus -f ../sjasmplus.mk
|
|
||||||
|
|
||||||
sjasmplus/.extracted: sjasmplus-src.tgz
|
sjasmplus/.extracted: sjasmplus-src.tgz
|
||||||
echo 'f3f6d28af19880ed2cb427b6b427e9bd42371929c7d263dac840fb71de1302d6 $<' >$<.sha256
|
echo 'f3f6d28af19880ed2cb427b6b427e9bd42371929c7d263dac840fb71de1302d6 $<' >$<.sha256
|
||||||
|
@ -78,16 +75,18 @@ sjasmplus/.extracted: sjasmplus-src.tgz
|
||||||
sjasmplus-src.tgz:
|
sjasmplus-src.tgz:
|
||||||
wget -c https://github.com/sjasmplus/sjasmplus/archive/refs/tags/20190306.1.tar.gz -O $@
|
wget -c https://github.com/sjasmplus/sjasmplus/archive/refs/tags/20190306.1.tar.gz -O $@
|
||||||
|
|
||||||
clean-sjasmplus:
|
clean-sjasmplus: | sjasmplus.mk
|
||||||
if test -d 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
|
||||||
rm -f $(INSTALLDIR)/sjasmplus$(EXESUFFIX)
|
if test -d sjasmplus; then $(MAKE) -w -C sjasmplus -f ../sjasmplus.mk prefix=$(shell realpath --relative-to=sjasmplus $(prefix)) uninstall; fi
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(_UsePrecompiledOnWindows),1)
|
ifeq ($(_UsePrecompiledOnWindows),1)
|
||||||
|
|
||||||
$(INSTALLDIR)/sjasmplus$(EXESUFFIX): sjasmplus/sjasmplus$(EXESUFFIX)
|
install-sjasmplus: $(DESTDIR)$(bindir)/sjasmplus$(EXESUFFIX)
|
||||||
cp $< $@
|
|
||||||
|
$(DESTDIR)$(bindir)/sjasmplus$(EXESUFFIX): sjasmplus/sjasmplus$(EXESUFFIX)
|
||||||
|
$(INSTALL_PROGRAM) $< $@
|
||||||
|
|
||||||
sjasmplus/sjasmplus$(EXESUFFIX): | sjasmplus/.extracted
|
sjasmplus/sjasmplus$(EXESUFFIX): | sjasmplus/.extracted
|
||||||
|
|
||||||
|
@ -115,14 +114,14 @@ sjasmplus-win64.7z:
|
||||||
|
|
||||||
clean-sjasmplus:
|
clean-sjasmplus:
|
||||||
rm -rf sjasmplus
|
rm -rf sjasmplus
|
||||||
rm -f $(INSTALLDIR)/sjasmplus$(EXESUFFIX)
|
rm -f $(DESTDIR)$(bindir)/sjasmplus$(EXESUFFIX)
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
.PHONY: dist-clean-sjasmplus
|
.PHONY: distclean-sjasmplus
|
||||||
dist-clean-sjasmplus:
|
distclean-sjasmplus:
|
||||||
rm -rf sjasmplus
|
rm -rf sjasmplus
|
||||||
rm -f $(INSTALLDIR)/sjasmplus$(EXESUFFIX)
|
rm -f $(DESTDIR)$(bindir)/sjasmplus$(EXESUFFIX)
|
||||||
rm -f\
|
rm -f\
|
||||||
sjasmplus-src.tgz\
|
sjasmplus-src.tgz\
|
||||||
sjasmplus-src.tgz.sha256\
|
sjasmplus-src.tgz.sha256\
|
||||||
|
@ -133,7 +132,7 @@ dist-clean-sjasmplus:
|
||||||
|
|
||||||
# z88dk
|
# z88dk
|
||||||
|
|
||||||
.PHONY: external-z88dk clean-z88dk
|
.PHONY: install-z88dk clean-z88dk
|
||||||
|
|
||||||
Z88DK_TARGETS:=\
|
Z88DK_TARGETS:=\
|
||||||
asmpp.pl\
|
asmpp.pl\
|
||||||
|
@ -157,7 +156,7 @@ Z88DK_TARGETS:=\
|
||||||
z88dk-zx7$(EXESUFFIX)\
|
z88dk-zx7$(EXESUFFIX)\
|
||||||
zcc$(EXESUFFIX)
|
zcc$(EXESUFFIX)
|
||||||
|
|
||||||
external-z88dk: z88dk/.done
|
install-z88dk: z88dk/.done
|
||||||
|
|
||||||
ifeq ($(_DoBuild),1)
|
ifeq ($(_DoBuild),1)
|
||||||
|
|
||||||
|
@ -220,24 +219,24 @@ dist-clean-z88dk:
|
||||||
|
|
||||||
# zx7b
|
# zx7b
|
||||||
|
|
||||||
.PHONY: local-zx7b clean-zx7b distclean-zx7b
|
.PHONY: install-zx7b clean-zx7b distclean-zx7b
|
||||||
|
|
||||||
ifeq ($(_DoBuild),1)
|
ifeq ($(_DoBuild),1)
|
||||||
|
|
||||||
local-zx7b: | zx7b
|
install-zx7b: | zx7b
|
||||||
$(MAKE) -w -C $| prefix=../.. install
|
$(MAKE) -w -C $| prefix=$(shell realpath --relative-to=$| $(prefix)) install
|
||||||
|
|
||||||
clean-zx7b: | zx7b
|
clean-zx7b: | zx7b
|
||||||
$(MAKE) -w -C $| clean
|
$(MAKE) -w -C $| clean
|
||||||
$(MAKE) -w -C $| prefix=../.. uninstall
|
$(MAKE) -w -C $| prefix=$(shell realpath --relative-to=$| $(prefix)) uninstall
|
||||||
|
|
||||||
distclean-zx7b: | zx7b
|
distclean-zx7b: | zx7b
|
||||||
$(MAKE) -w -C $| distclean
|
$(MAKE) -w -C $| distclean
|
||||||
$(MAKE) -w -C $| prefix=../.. uninstall
|
$(MAKE) -w -C $| prefix=$(shell realpath --relative-to=$| $(prefix)) uninstall
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
local-zx7b:;
|
install-zx7b:;
|
||||||
|
|
||||||
clean-zx7b:;
|
clean-zx7b:;
|
||||||
|
|
||||||
|
@ -247,24 +246,24 @@ endif
|
||||||
|
|
||||||
# tools
|
# tools
|
||||||
|
|
||||||
.PHONY: local-tools clean-tools distclean-tools
|
.PHONY: install-tools clean-tools distclean-tools
|
||||||
|
|
||||||
ifeq ($(_DoBuild),1)
|
ifeq ($(_DoBuild),1)
|
||||||
|
|
||||||
local-tools: | tools
|
install-tools: | tools
|
||||||
$(MAKE) -w -C $| prefix=../.. install
|
$(MAKE) -w -C $| prefix=$(shell realpath --relative-to=$| $(prefix)) install
|
||||||
|
|
||||||
clean-tools: | tools
|
clean-tools: | tools
|
||||||
$(MAKE) -w -C $| clean
|
$(MAKE) -w -C $| clean
|
||||||
$(MAKE) -w -C $| prefix=../.. uninstall
|
$(MAKE) -w -C $| prefix=$(shell realpath --relative-to=$| $(prefix)) uninstall
|
||||||
|
|
||||||
distclean-tools: | tools
|
distclean-tools: | tools
|
||||||
$(MAKE) -w -C $| distclean
|
$(MAKE) -w -C $| distclean
|
||||||
$(MAKE) -w -C $| prefix=../.. uninstall
|
$(MAKE) -w -C $| prefix=$(shell realpath --relative-to=$| $(prefix)) uninstall
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
local-tools:;
|
install-tools:;
|
||||||
|
|
||||||
clean-tools:;
|
clean-tools:;
|
||||||
|
|
||||||
|
@ -281,7 +280,7 @@ endif
|
||||||
|
|
||||||
.PHONY: dist-clean
|
.PHONY: dist-clean
|
||||||
ifeq ($(_DoClean),1)
|
ifeq ($(_DoClean),1)
|
||||||
dist-clean: dist-clean-sjasmplus dist-clean-z88dk distclean-zx7b distclean-tools
|
dist-clean: distclean-sjasmplus dist-clean-z88dk distclean-zx7b distclean-tools
|
||||||
else
|
else
|
||||||
dist-clean: dist-clean-sjasmplus dist-clean-z88dk
|
dist-clean: distclean-sjasmplus dist-clean-z88dk
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -8,17 +8,30 @@
|
||||||
#
|
#
|
||||||
# Build:
|
# Build:
|
||||||
# make [BUILD=<BUILD>] -w -C sjasmplus -f ../sjasmplus.mk
|
# make [BUILD=<BUILD>] -w -C sjasmplus -f ../sjasmplus.mk
|
||||||
|
# Install / Uninstall:
|
||||||
|
# make [BUILD=<BUILD>] [prefix=<PREFIX>] -w -C sjasmplus -f ../sjasmplus.mk install | uninstall
|
||||||
# Clean:
|
# Clean:
|
||||||
# make [BUILD=<BUILD>] -w -C sjasmplus -f ../sjasmplus.mk clean
|
# make [BUILD=<BUILD>] -w -C sjasmplus -f ../sjasmplus.mk clean
|
||||||
#
|
#
|
||||||
# where:
|
# where:
|
||||||
# <BUILD> is one of: mingw32, mingw64.
|
# <BUILD> - see included `common.mk'.
|
||||||
#
|
# <PREFIX> is a prefix directory to install files into.
|
||||||
# Notes:
|
|
||||||
# BUILD variable may be set in user's environment.
|
|
||||||
|
|
||||||
include ../../common.mk
|
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))
|
||||||
|
|
||||||
ifeq ($(BUILD),mingw32)
|
ifeq ($(BUILD),mingw32)
|
||||||
CMAKEFLAGS := -DCMAKE_TOOLCHAIN_FILE=../Toolchain-mingw32.cmake
|
CMAKEFLAGS := -DCMAKE_TOOLCHAIN_FILE=../Toolchain-mingw32.cmake
|
||||||
else ifeq ($(BUILD),mingw64)
|
else ifeq ($(BUILD),mingw64)
|
||||||
|
@ -27,15 +40,33 @@ else
|
||||||
CMAKEFLAGS :=
|
CMAKEFLAGS :=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: $(foreach t,$(BINS),build/$(t))
|
||||||
|
|
||||||
|
build\
|
||||||
|
$(DESTDIR)$(bindir):
|
||||||
|
mkdir -p $@
|
||||||
|
|
||||||
build/sjasmplus$(EXESUFFIX): | build/Makefile
|
build/sjasmplus$(EXESUFFIX): | build/Makefile
|
||||||
$(MAKE) -w -C build
|
$(MAKE) -w -C build
|
||||||
|
|
||||||
build/Makefile: | build
|
build/Makefile: | build
|
||||||
cd $| && cmake $(CMAKEFLAGS) ..
|
cd $| && cmake $(CMAKEFLAGS) ..
|
||||||
|
|
||||||
build:
|
.PHONY: install
|
||||||
mkdir $@
|
install: $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t))
|
||||||
|
|
||||||
|
$(DESTDIR)$(bindir)/sjasmplus$(EXESUFFIX): build/sjasmplus$(EXESUFFIX) | $(DESTDIR)$(bindir)
|
||||||
|
$(INSTALL_PROGRAM) $< $@
|
||||||
|
|
||||||
|
.PHONY: uninstall
|
||||||
|
uninstall:
|
||||||
|
rm -f $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t))
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -rf build
|
rm -f $(foreach t,$(BINS),build/$(t))
|
||||||
|
|
||||||
|
.PHONY: distclean
|
||||||
|
distclean:
|
||||||
|
rm -rf build/*
|
||||||
|
|
|
@ -63,7 +63,7 @@ $(foreach t,$(BINS),$(eval $(call install_bin_rule,$(t))))
|
||||||
|
|
||||||
.PHONY: uninstall
|
.PHONY: uninstall
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f $(foreach t,$(BINS),$(DESTDIR)$(exec_prefix)/bin/$(t))
|
rm -f $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t))
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
|
|
@ -50,7 +50,7 @@ $(DESTDIR)$(bindir)/zx7b$(EXESUFFIX): build/zx7b$(EXESUFFIX) | $(DESTDIR)$(bindi
|
||||||
|
|
||||||
.PHONY: uninstall
|
.PHONY: uninstall
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f $(foreach t,$(BINS),$(DESTDIR)$(exec_prefix)/bin/$(t))
|
rm -f $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t))
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
|
Loading…
Reference in New Issue