# 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) # # Configure: # make configure [] # Build: # make [] build | build- # Install: # make [] [all | | install-] # Uninstall: # make [] uninstall | uninstall- # Clean: # make [] clean | clean- # make [] distclean | distclean- # # where: # is a set of parameters of type = # USE_SJASMPLUS_VERSION: sjasmplus, z00m128 (default). # are these flags: # [BUILD=] [FORCEBUILD=] [FORCECLEAN=] # where values are: # - see included `common.mk'. # is 1 to force build, otherwise do not (default). # is 1 to force clean, otherwise do not (default). # is one of the values of `TARGETS' variable. # # NOTE: `FORCEBUILD' and `FORCECLEAN' are mainly for Windows platform. include common.mk prefix ?= $(shell realpath --relative-base=. $(USE_PREFIX)) ifeq ($(BUILD),mingw32) FORCEBUILD = 1 else ifeq ($(BUILD),mingw64) FORCEBUILD = 1 else BUILD = FORCEBUILD = 0 endif ifdef $(FORCECLEAN) ifneq ($(FORCECLEAN),1) FORCECLEAN = 0 endif endif export BUILD export FORCEBUILD export FORCECLEAN TARGETS=\ sjasmplus\ sdcc\ z88dk\ lodepng\ zx7b\ tools .PHONY: all all: install .PHONY: $(TARGETS) $(TARGETS): | src $(MAKE) -w -C $| prefix=$(shell realpath --relative-to=$| $(prefix)) install-$@ .PHONY:\ 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.';\ echo '# This file is generated automatically by `make configure`.';\ echo 'USE_SJASMPLUS_VERSION=$(USE_SJASMPLUS_VERSION)'; } >conf.mk build clean distclean \ $(foreach t,$(TARGETS),build-$(t) clean-$(t) distclean-$(t)): | src $(MAKE) -w -C $| $@ install uninstall \ $(foreach t,$(TARGETS),install-$(t) uninstall-$(t)): | src $(MAKE) -w -C $| prefix=$(shell realpath --relative-to=$| $(prefix)) $@