nexus-am/Makefile.check

27 lines
684 B
Makefile
Raw Normal View History

2019-06-14 03:04:24 +08:00
## Always build "default"
2019-03-21 17:32:08 +08:00
.DEFAULT_GOAL = default
2019-06-14 03:04:24 +08:00
## Ignore checks for make clean
ifneq ($(MAKECMDGOALS),clean)
2017-06-02 20:20:51 +08:00
2019-06-14 03:04:24 +08:00
## Check: Environment variable $AM_HOME must exist
ifeq ($(AM_HOME),)
2017-06-02 20:20:51 +08:00
$(error Environment variable AM_HOME must be defined.)
endif
2019-06-14 03:04:24 +08:00
## Check: Environment variable $ARCH must be in the supported list
ARCH ?= native
2019-02-17 23:13:38 +08:00
ARCHS := $(basename $(notdir $(shell ls $(AM_HOME)/am/arch/*.mk)))
2019-06-14 03:04:24 +08:00
ifeq ($(filter $(ARCHS), $(ARCH)), )
2017-06-02 20:20:51 +08:00
$(error Invalid ARCH. Supported: $(ARCHS))
endif
2019-06-14 03:04:24 +08:00
## ARCH=x86-qemu -> ISA=x86; PLATFORM=qemu
2019-02-17 22:42:11 +08:00
ARCH_SPLIT = $(subst -, ,$(ARCH))
ISA ?= $(word 1,$(ARCH_SPLIT))
PLATFORM ?= $(word 2,$(ARCH_SPLIT))
2019-03-21 17:32:08 +08:00
include $(AM_HOME)/am/arch/$(ARCH).mk
2017-05-21 22:10:24 +08:00
endif