mirror of https://github.com/zxdos/zxuno.git
Updated Makefiles in `software/`, `Makefile` to follow GNU standards
This commit is contained in:
parent
5d1a21d50b
commit
f8e6de6bb3
108
Makefile
108
Makefile
|
|
@ -1,17 +1,27 @@
|
|||
# Updates content of SD directory.
|
||||
#
|
||||
# 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 the project:
|
||||
# make [all]
|
||||
# Compile only:
|
||||
# make build | build-<TARGET>
|
||||
# Install:
|
||||
# make install | install-<TARGET>
|
||||
# Uninstall:
|
||||
# make uninstall | uninstall-<TARGET>
|
||||
# Clean:
|
||||
# make clean
|
||||
# make clean | clean-<TARGET>
|
||||
# make distclean | distclean-<TARGET>
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2021 Ivan Tatarinov <ivan-tat@ya.ru>
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# where:
|
||||
# <TARGET> is one of the values for `TARGETS' variable.
|
||||
|
||||
include sdk/common.mk
|
||||
|
||||
|
|
@ -20,65 +30,75 @@ prefix ?= SD
|
|||
exec_prefix ?= $(prefix)
|
||||
bindir ?= $(exec_prefix)/BIN
|
||||
|
||||
INSTALL ?= install
|
||||
INSTALL_PROGRAM ?= $(INSTALL)
|
||||
RM = rm -f
|
||||
TARGETS=\
|
||||
utils\
|
||||
software
|
||||
|
||||
SOFTWARE_TARGETS=\
|
||||
ESPRST\
|
||||
IWCONFIG
|
||||
SOFTWARE_SUBDIRS=\
|
||||
esprst\
|
||||
iwconfig
|
||||
|
||||
.PHONY: all
|
||||
all:\
|
||||
install-utils\
|
||||
install-software
|
||||
all: $(foreach t,$(TARGETS),install-$(t))
|
||||
@echo 'Done.'
|
||||
|
||||
# utils
|
||||
|
||||
.PHONY: build-utils
|
||||
build-utils: | utils
|
||||
$(MAKE) -w -C $| bindir=$(shell realpath --relative-to=$| $(bindir))
|
||||
|
||||
.PHONY: install-utils
|
||||
install-utils: | utils
|
||||
$(MAKE) -w -C $| bindir=$(shell realpath --relative-to=$| $(bindir)) install
|
||||
|
||||
.PHONY: uninstall-utils
|
||||
uninstall-utils: | utils
|
||||
$(MAKE) -w -C $| bindir=$(shell realpath --relative-to=$| $(bindir)) uninstall
|
||||
|
||||
.PHONY: clean-utils
|
||||
clean-utils: | utils
|
||||
$(MAKE) -w -C $| clean
|
||||
|
||||
.PHONY: uninstall-utils
|
||||
uninstall-utils: clean-utils | utils
|
||||
$(MAKE) -w -C $| bindir=$(shell realpath --relative-to=$| $(bindir)) uninstall
|
||||
.PHONY: distclean-utils
|
||||
distclean-utils: | utils
|
||||
$(MAKE) -w -C $| distclean
|
||||
|
||||
# software
|
||||
|
||||
.PHONY: build-software
|
||||
build-software: | software
|
||||
$(MAKE) -w -C $| bindir=$(shell realpath --relative-to=$| $(bindir))
|
||||
|
||||
.PHONY: install-software
|
||||
install-software: $(foreach t,$(SOFTWARE_TARGETS),$(DESTDIR)$(bindir)/$(t))
|
||||
|
||||
$(DESTDIR)$(bindir)/ESPRST: software/esprst/esprst
|
||||
$(INSTALL) $< $@
|
||||
|
||||
$(DESTDIR)$(bindir)/IWCONFIG: software/iwconfig/IWCONFIG
|
||||
$(INSTALL) $< $@
|
||||
|
||||
software/esprst/esprst: | software/esprst
|
||||
$(MAKE) -w -C $|
|
||||
|
||||
software/iwconfig/IWCONFIG: | software/iwconfig
|
||||
$(MAKE) -w -C $|
|
||||
|
||||
.PHONY: clean-software
|
||||
clean-software: |\
|
||||
software/esprst\
|
||||
software/iwconfig
|
||||
$(MAKE) -w -C software/esprst clean
|
||||
$(MAKE) -w -C software/iwconfig clean
|
||||
install-software: | software
|
||||
for d in $(SOFTWARE_SUBDIRS); do d=$|/$$d; $(MAKE) -w -C $$d bindir=$$(realpath --relative-to=$$d $(bindir)) install; done
|
||||
|
||||
.PHONY: uninstall-software
|
||||
uninstall-software: clean-software
|
||||
$(RM) $(foreach t,$(SOFTWARE_TARGETS),$(DESTDIR)$(bindir)/$(t))
|
||||
uninstall-software: | software
|
||||
for d in $(SOFTWARE_SUBDIRS); do d=$|/$$d; $(MAKE) -w -C $$d bindir=$$(realpath --relative-to=$$d $(bindir)) uninstall; done
|
||||
|
||||
# clean
|
||||
.PHONY: clean-software
|
||||
clean-software: | software
|
||||
for d in $(SOFTWARE_SUBDIRS); do d=$|/$$d; $(MAKE) -w -C $$d bindir=$$(realpath --relative-to=$$d $(bindir)) clean; done
|
||||
|
||||
.PHONY: distclean-software
|
||||
distclean-software: | software
|
||||
for d in $(SOFTWARE_SUBDIRS); do d=$|/$$d; $(MAKE) -w -C $$d bindir=$$(realpath --relative-to=$$d $(bindir)) distclean; done
|
||||
|
||||
# all
|
||||
|
||||
.PHONY: build
|
||||
build: $(foreach t,$(TARGETS),build-$(t))
|
||||
|
||||
.PHONY: install
|
||||
install: $(foreach t,$(TARGETS),install-$(t))
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall: $(foreach t,$(TARGETS),uninstall-$(t))
|
||||
|
||||
.PHONY: clean
|
||||
clean:\
|
||||
uninstall-utils\
|
||||
uninstall-software
|
||||
clean: $(foreach t,$(TARGETS),clean-$(t))
|
||||
|
||||
.PHONY: distclean
|
||||
distclean: $(foreach t,$(TARGETS),distclean-$(t))
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
esprst
|
||||
build
|
||||
|
|
|
|||
|
|
@ -1,15 +1,82 @@
|
|||
# SPDX-FileCopyrightText: Copyright (C) 2019 Alexander Sharikhin
|
||||
#
|
||||
# SPDX-FileContributor: 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 [<TARGET> ...]
|
||||
# Install / Uninstall:
|
||||
# make [prefix=<PREFIX>] install | uninstall
|
||||
# Clean:
|
||||
# make clean | distclean
|
||||
#
|
||||
# where:
|
||||
# <TARGET> is one of values for `BINS' variable prefixed with "build/"
|
||||
# (see target `all' below).
|
||||
# <PREFIX> is a prefix directory to install files into.
|
||||
|
||||
include ../../sdk/common.mk
|
||||
|
||||
.PHONY: all
|
||||
all: esprst
|
||||
# Use uppercase for FAT filesystem
|
||||
srcdir = .
|
||||
prefix ?= .
|
||||
exec_prefix ?= $(prefix)
|
||||
bindir ?= $(exec_prefix)/BIN
|
||||
|
||||
esprst: main.asm uart.asm ring.asm
|
||||
sjasmplus $<
|
||||
# Disable execution mode for FAT filesystem
|
||||
INSTALL ?= install
|
||||
INSTALL_PROGRAM ?= $(INSTALL) -m 644
|
||||
RM = rm -f
|
||||
|
||||
AS = sjasmplus
|
||||
ifeq ($(USE_SJASMPLUS_VERSION),sjasmplus)
|
||||
AFLAGS = --nobanner
|
||||
else ifeq ($(USE_SJASMPLUS_VERSION),z00m128)
|
||||
AFLAGS = --nologo
|
||||
else
|
||||
AFLAGS =
|
||||
endif
|
||||
|
||||
BINS=\
|
||||
ESPRST
|
||||
|
||||
.PHONY: all
|
||||
all: $(foreach t,$(BINS),build/$(t))
|
||||
|
||||
build\
|
||||
$(DESTDIR)$(bindir):
|
||||
mkdir -p $@
|
||||
|
||||
build/ESPRST: $(srcdir)/main.asm\
|
||||
$(srcdir)/uart.asm\
|
||||
$(srcdir)/ring.asm\
|
||||
| build
|
||||
$(AS) $(AFLAGS) --raw=$@ $<
|
||||
|
||||
# $1 = target
|
||||
define install_bin_rule =
|
||||
$$(DESTDIR)$$(bindir)/$1: build/$1 | $$(DESTDIR)$$(bindir)
|
||||
$$(INSTALL_PROGRAM) $$< $$@
|
||||
endef
|
||||
|
||||
$(foreach t,$(BINS),$(eval $(call install_bin_rule,$(t))))
|
||||
|
||||
.PHONY: install
|
||||
install: $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t))
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
$(RM) $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t))
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f esprst
|
||||
rm -f $(foreach t,$(BINS),build/$(t))
|
||||
|
||||
.PHONY: distclean
|
||||
distclean:
|
||||
rm -rf build/*
|
||||
|
|
|
|||
|
|
@ -90,4 +90,4 @@ cmd_info defb "AT+GMR", 13, 10, 0
|
|||
response_ok defb "OK", 13, 10, 0
|
||||
response_er defb "ready", 0
|
||||
|
||||
SAVEBIN "esprst", Start, $ - Start
|
||||
; SAVEBIN "esprst", Start, $ - Start
|
||||
|
|
|
|||
|
|
@ -2,6 +2,4 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
*.bin
|
||||
*.def
|
||||
IWCONFIG
|
||||
build
|
||||
|
|
|
|||
|
|
@ -1,15 +1,74 @@
|
|||
# SPDX-FileCopyrightText: Copyright (C) 2019 Alexander Sharikhin
|
||||
#
|
||||
# SPDX-FileContributor: 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 [<TARGET> ...]
|
||||
# Install / Uninstall:
|
||||
# make [prefix=<PREFIX>] install | uninstall
|
||||
# Clean:
|
||||
# make clean | distclean
|
||||
#
|
||||
# where:
|
||||
# <TARGET> is one of values for `BINS' variable prefixed with "build/"
|
||||
# (see target `all' below).
|
||||
# <PREFIX> is a prefix directory to install files into.
|
||||
|
||||
include ../../sdk/common.mk
|
||||
|
||||
.PHONY: all
|
||||
all: IWCONFIG
|
||||
# Use uppercase for FAT filesystem
|
||||
srcdir = .
|
||||
prefix ?= .
|
||||
exec_prefix ?= $(prefix)
|
||||
bindir ?= $(exec_prefix)/BIN
|
||||
|
||||
IWCONFIG: iwconfig.c
|
||||
zcc +zx -vn -startup=30 -clib=new $< -SO3 -o $@ -subtype=dot -create-app
|
||||
# Disable execution mode for FAT filesystem
|
||||
INSTALL ?= install
|
||||
INSTALL_PROGRAM ?= $(INSTALL) -m 644
|
||||
RM = rm -f
|
||||
|
||||
BINS=\
|
||||
IWCONFIG
|
||||
|
||||
# `zcc' compiler's behavior:
|
||||
# * produces binary file in source's directory only
|
||||
# * creates temporary files
|
||||
TMPS=\
|
||||
$(foreach t,$(BINS),$(t)_CODE.bin $(t)_UNASSIGNED.bin)
|
||||
|
||||
.PHONY: all
|
||||
all: $(foreach t,$(BINS),build/$(t))
|
||||
|
||||
build\
|
||||
$(DESTDIR)$(bindir):
|
||||
mkdir -p $@
|
||||
|
||||
build/IWCONFIG: $(srcdir)/iwconfig.c | build
|
||||
zcc +zx -vn -startup=30 -clib=new $< -SO3 -o $(@F) -subtype=dot -create-app
|
||||
# Workaround for zcc:
|
||||
rm -f $(TMPS)
|
||||
mv $(@F) $@
|
||||
|
||||
$(DESTDIR)$(bindir)/%: build/% | $(DESTDIR)$(bindir)
|
||||
cp $< $@
|
||||
|
||||
.PHONY: install
|
||||
install: $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t))
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
$(RM) $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t))
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f *.bin *.def IWCONFIG
|
||||
rm -f $(BINS) $(TMPS) $(foreach t,$(BINS),build/$(t))
|
||||
|
||||
.PHONY: distclean
|
||||
distclean:
|
||||
rm -rf build/*
|
||||
|
|
|
|||
|
|
@ -2,7 +2,4 @@
|
|||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
*.tap
|
||||
player.bin
|
||||
ugoph.bin
|
||||
.vscode
|
||||
build
|
||||
|
|
|
|||
|
|
@ -1,15 +1,83 @@
|
|||
# SPDX-FileCopyrightText: Copyright (C) 2019 Alexander Sharikhin
|
||||
#
|
||||
# SPDX-FileContributor: 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 [<TARGET> ...]
|
||||
# Install / Uninstall:
|
||||
# make [prefix=<PREFIX>] install | uninstall
|
||||
# Clean:
|
||||
# make clean | distclean
|
||||
#
|
||||
# where:
|
||||
# <TARGET> is one of values for `BINS' variable prefixed with "build/"
|
||||
# (see target `all' below).
|
||||
# <PREFIX> is a prefix directory to install files into.
|
||||
|
||||
include ../../sdk/common.mk
|
||||
|
||||
.PHONY: all
|
||||
all: ugoph.bin
|
||||
# Use uppercase for FAT filesystem
|
||||
srcdir = .
|
||||
prefix ?= .
|
||||
exec_prefix ?= $(prefix)
|
||||
bindir ?= $(exec_prefix)/BIN
|
||||
|
||||
ugoph.bin ugoph.tap: main.asm tscreen.asm keyboard.asm utils.asm wifi.asm gopher.asm render.asm textrender.asm uart.asm ring.asm esxdos.asm vtpl.asm
|
||||
sjasmplus $<
|
||||
# Disable execution mode for FAT filesystem
|
||||
INSTALL ?= install
|
||||
INSTALL_PROGRAM ?= $(INSTALL) -m 644
|
||||
RM = rm -f
|
||||
|
||||
AS = sjasmplus
|
||||
ifeq ($(USE_SJASMPLUS_VERSION),sjasmplus)
|
||||
AFLAGS = --nobanner
|
||||
else ifeq ($(USE_SJASMPLUS_VERSION),z00m128)
|
||||
AFLAGS = --nologo
|
||||
else
|
||||
AFLAGS =
|
||||
endif
|
||||
|
||||
BINS=\
|
||||
UGOPH
|
||||
|
||||
.PHONY: all
|
||||
all: $(foreach t,$(BINS),build/$(t))
|
||||
|
||||
build\
|
||||
$(DESTDIR)$(bindir):
|
||||
mkdir -p $@
|
||||
|
||||
build/UGOPH: $(srcdir)/main.asm\
|
||||
$(srcdir)/tscreen.asm\
|
||||
$(srcdir)/keyboard.asm\
|
||||
$(srcdir)/utils.asm\
|
||||
$(srcdir)/wifi.asm\
|
||||
$(srcdir)/gopher.asm\
|
||||
$(srcdir)/render.asm\
|
||||
$(srcdir)/textrender.asm\
|
||||
$(srcdir)/uart.asm\
|
||||
$(srcdir)/ring.asm\
|
||||
$(srcdir)/esxdos.asm\
|
||||
$(srcdir)/vtpl.asm\
|
||||
| build
|
||||
$(AS) $(AFLAGS) --raw=$@ $<
|
||||
|
||||
.PHONY: install
|
||||
install: $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t))
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
$(RM) $(foreach t,$(BINS),$(DESTDIR)$(bindir)/$(t))
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f ugoph.bin ugoph.tap
|
||||
rm -f $(foreach t,$(BINS),build/$(t))
|
||||
|
||||
.PHONY: distclean
|
||||
distclean:
|
||||
rm -rf build/*
|
||||
|
|
|
|||
|
|
@ -92,5 +92,5 @@ player
|
|||
DISPLAY "Player ends: ", $
|
||||
ENT
|
||||
eop equ $
|
||||
SAVEBIN "ugoph.bin", Start, $ - Start
|
||||
SAVETAP "ugoph.tap", Start
|
||||
; SAVEBIN "ugoph.bin", Start, $ - Start
|
||||
; SAVETAP "ugoph.tap", Start
|
||||
|
|
|
|||
Loading…
Reference in New Issue