neorv32/sw/example/makefile

84 lines
2.0 KiB
Makefile

#-------------------------------------------------------------------------------
# Make defaults and targets
#-------------------------------------------------------------------------------
# Modify this variable to fit your NEORV32 setup (neorv32 home folder)
OSFLAG :=
ifeq ($(OS),Windows_NT)
.SUFFIXES:
.DEFAULT_GOAL := help
TOPTARGETS := exe clean_all check info all
SUBDIRS := $(wildcard */.)
# ignore dummy folders (starting with '~')
DUMMYDIRS := $(wildcard ~*/.)
SUBDIRS := $(filter-out $(DUMMYDIRS), $(SUBDIRS))
$(TOPTARGETS): $(SUBDIRS)
$(SUBDIRS):
@$(MAKE) -C $@ $(MAKECMDGOALS)
.PHONY: $(TOPTARGETS) $(SUBDIRS)
#-------------------------------------------------------------------------------
# Help
#-------------------------------------------------------------------------------
help:
@echo "Build / clean up all projects"
@echo "Targets:"
@echo " help - show this text"
@echo " check - check toolchain"
@echo " info - show makefile configuration"
@echo " exe - create executables from all projects"
@echo " all - create executables and boot images from all projects"
@echo " clean_all - clean up everything"
else
.SUFFIXES:
.DEFAULT_GOAL := help
TOPTARGETS := exe clean_all check info all
SUBDIRS := $(wildcard */.)
# ignore dummy folders (starting with '~')
DUMMYDIRS := $(wildcard ~*/.)
SUBDIRS := $(filter-out $(DUMMYDIRS), $(SUBDIRS))
$(TOPTARGETS): $(SUBDIRS)
$(SUBDIRS):
@set -e
@$(MAKE) -C $@ $(MAKECMDGOALS)
.PHONY: $(TOPTARGETS) $(SUBDIRS)
#-------------------------------------------------------------------------------
# Help
#-------------------------------------------------------------------------------
help:
@echo "Build / clean up all projects"
@echo "Targets:"
@echo " help - show this text"
@echo " check - check toolchain"
@echo " info - show makefile configuration"
@echo " exe - create executables from all projects"
@echo " all - create executables and boot images from all projects"
@echo " clean_all - clean up everything"
endif