2016-01-30 14:41:36 -08:00
|
|
|
# routines and rules to print some helpful stuff
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#$(warning MAKECMDGOALS = $(MAKECMDGOALS))
|
|
|
|
|
|
|
|
|
|
# print some help and exit
|
|
|
|
|
ifeq ($(firstword $(MAKECMDGOALS)),help)
|
|
|
|
|
do-nothing=1
|
|
|
|
|
|
|
|
|
|
.PHONY: help
|
|
|
|
|
help:
|
2016-02-04 12:25:22 -08:00
|
|
|
@echo "LK build system quick help"
|
|
|
|
|
@echo "Individual projects are built into a build-<project> directory"
|
|
|
|
|
@echo "Output binary is located at build-<project>/lk.bin"
|
2025-07-18 21:32:05 -07:00
|
|
|
@echo ""
|
2016-02-04 12:25:22 -08:00
|
|
|
@echo "Environment or command line variables controlling build:"
|
|
|
|
|
@echo "PROJECT = <project name>"
|
|
|
|
|
@echo "TOOLCHAIN_PREFIX = <absolute path to toolchain or relative path with prefix>"
|
2025-07-18 21:32:05 -07:00
|
|
|
@echo "WERROR = 1 : treat warnings as errors"
|
|
|
|
|
@echo "DEBUG = 0,1,2 : set debug level (0=NONE, 1=INFO, 2=DEBUG), default is 2"
|
|
|
|
|
@echo "BUILDDIR = <path to build directory> (default is build-<project>)"
|
|
|
|
|
@echo "BUILDDIR_SUFFIX = <suffix to add to build directory> (default is empty)"
|
2016-02-04 12:25:22 -08:00
|
|
|
@echo ""
|
|
|
|
|
@echo "Special make targets:"
|
|
|
|
|
@echo "make help: This help"
|
|
|
|
|
@echo "make list: List of buildable projects"
|
|
|
|
|
@echo "make clean: cleans build of current project"
|
|
|
|
|
@echo "make spotless: removes all build directories"
|
2024-05-09 20:27:54 -07:00
|
|
|
@echo "make tags: run ctags on all of the source files for the current project"
|
2016-02-04 12:25:22 -08:00
|
|
|
@echo "make <project>: try to build project named <project>"
|
|
|
|
|
@echo ""
|
2021-09-18 16:51:15 -07:00
|
|
|
@echo "make list-arch: print the architecture of the current project"
|
|
|
|
|
@echo "make list-toolchain: print the computed toolchain prefix of the current project"
|
|
|
|
|
@echo ""
|
2016-02-04 12:25:22 -08:00
|
|
|
@echo "Examples:"
|
|
|
|
|
@echo "PROJECT=testproject make"
|
|
|
|
|
@echo "PROJECT=testproject make clean"
|
|
|
|
|
@echo "make testproject"
|
|
|
|
|
@echo "make testproject clean"
|
|
|
|
|
@echo ""
|
|
|
|
|
@echo "output will be in build-testproject/"
|
2025-07-18 21:32:05 -07:00
|
|
|
@echo ""
|
|
|
|
|
@echo "Check the project/ directory for available projects"
|
|
|
|
|
@echo "and their rules.mk files for more information."
|
2016-01-30 14:41:36 -08:00
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
# list projects
|
|
|
|
|
ifeq ($(firstword $(MAKECMDGOALS)),list)
|
|
|
|
|
do-nothing=1
|
|
|
|
|
|
|
|
|
|
# get a list of all the .mk files in the top level project directories
|
|
|
|
|
PROJECTS:=$(basename $(strip $(foreach d,$(LKINC),$(wildcard $(d)/project/*.mk))))
|
2016-02-04 14:14:59 -06:00
|
|
|
PROJECTS:=$(shell basename -a $(PROJECTS))
|
2016-01-30 14:41:36 -08:00
|
|
|
|
|
|
|
|
.PHONY: list
|
|
|
|
|
list:
|
|
|
|
|
@echo 'List of all buildable projects: (look in project/ directory)'; \
|
2018-11-30 22:44:24 -08:00
|
|
|
for p in $(sort $(PROJECTS)); do \
|
2016-01-30 14:41:36 -08:00
|
|
|
echo $$p; \
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
# vim: set syntax=make noexpandtab
|