1# -*- coding: utf-8; mode: makefile-gmake -*-
4 @echo ' make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build'
5 @echo ' make V=2 [targets] 2 => give reason for rebuild of target'
7quiet_cmd_common_clean = CLEAN $@
10 find . -name '*.orig' -exec rm -f {} + ;\
11 find . -name '*.rej' -exec rm -f {} + ;\
12 find . -name '*~' -exec rm -f {} + ;\
13 find . -name '*.bak' -exec rm -f {} + ;\
16ifeq ($(shell which fmt >/dev/null 2>&1; echo $$?), 0)
22# For a minimal *make-environment*, I'am using the gnu-tools from:
24# - GNU MCU Eclipse Windows Build Tools, which brings 'make', 'rm' etc.
25# https://github.com/gnu-mcu-eclipse/windows-build-tools/releases
27# - git for Windows, which brings 'find', 'grep' etc.
28# https://git-scm.com/download/win
33# System-dependent normalization of the path name
35# usage: $(call normpath,/path/to/file)
38ifeq ($(OS),Windows_NT)
39 normpath = $(subst /,\,$1)
43# stolen from linux/Makefile
46ifeq ("$(origin V)", "command line")
53ifeq ($(KBUILD_VERBOSE),1)
61# stolen from linux/scripts/Kbuild.include
67#" this comment is only for emacs highlighting
69#' this comment is only for emacs highlighting
71space := $(empty) $(empty)
72space_escape := _-_SPACE_-_
74# Find any prerequisites that is newer than target or that does not exist.
75# PHONY targets skipped in both cases.
76any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)
79# why - tell why a a target got build
81# Output (listed in the order they are checked):
82# (1) - due to target is PHONY
83# (2) - due to target missing
84# (3) - due to: file1.h file2.h
85# (4) - due to command line change
86# (5) - due to missing .cmd file
87# (6) - due to target not in $(targets)
88# (1) PHONY targets are always build
89# (2) No target, so we better build it
90# (3) Prerequisite is newer than target
91# (4) The command line stored in the file named dir/.target.cmd
92# differed from actual command line. This happens when compiler
94# (5) No dir/.target.cmd file (used to store command line)
95# (6) No dir/.target.cmd file and target not listed in $(targets)
96# This is a good hint that there is a bug in the kbuild file
97ifeq ($(KBUILD_VERBOSE),2)
99 $(if $(filter $@, $(PHONY)),- due to target is PHONY, \
100 $(if $(wildcard $@), \
101 $(if $(strip $(any-prereq)),- due to: $(any-prereq), \
103 $(if $(cmd_$@),- due to command line change, \
104 $(if $(filter $@, $(targets)), \
105 - due to missing .cmd file, \
106 - due to $(notdir $@) not in $$(targets) \
111 - due to target missing \
115echo-why = $(call escsq, $(strip $(why)))
119# Escape single quote for use in echo statements
120escsq = $(subst $(squote),'\$(squote)',$1)
123# Short version is used, if $(quiet) equals `quiet_', otherwise full one.
124echo-cmd = $(if $($(quiet)cmd_$(1)),echo '$(call escsq,$($(quiet)cmd_$(1)))$(echo-why)';)
127cmd = @$(echo-cmd) $(cmd_$(1))
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list