Build.include (9095bf25ea08135a5b74875dd0e3eeaddc4218a0) | Build.include (9564a8cf422d7b58f6e857e3546d346fa970191e) |
---|---|
1### 2# build: Generic definitions 3# 4# Lots of this code have been borrowed or heavily inspired from parts 5# of kbuild code, which is not credited, but mostly developed by: 6# 7# Copyright (C) Sam Ravnborg <sam@mars.ravnborg.org>, 2015 8# Copyright (C) Linus Torvalds <torvalds@linux-foundation.org>, 2015 9# 10 11### 12# Convenient variables 13comma := , 14squote := ' | 1### 2# build: Generic definitions 3# 4# Lots of this code have been borrowed or heavily inspired from parts 5# of kbuild code, which is not credited, but mostly developed by: 6# 7# Copyright (C) Sam Ravnborg <sam@mars.ravnborg.org>, 2015 8# Copyright (C) Linus Torvalds <torvalds@linux-foundation.org>, 2015 9# 10 11### 12# Convenient variables 13comma := , 14squote := ' |
15pound := \# |
|
15 16### 17# Name of target with a '.' as filename prefix. foo/bar.o => foo/.bar.o 18dot-target = $(dir $@).$(notdir $@) 19 20### 21# filename of target with directory and extension stripped 22basetarget = $(basename $(notdir $@)) --- 15 unchanged lines hidden (view full) --- 38# Echo command 39# Short version is used, if $(quiet) equals `quiet_', otherwise full one. 40echo-cmd = $(if $($(quiet)cmd_$(1)),\ 41 echo ' $(call escsq,$($(quiet)cmd_$(1)))';) 42 43### 44# Replace >$< with >$$< to preserve $ when reloading the .cmd file 45# (needed for make) | 16 17### 18# Name of target with a '.' as filename prefix. foo/bar.o => foo/.bar.o 19dot-target = $(dir $@).$(notdir $@) 20 21### 22# filename of target with directory and extension stripped 23basetarget = $(basename $(notdir $@)) --- 15 unchanged lines hidden (view full) --- 39# Echo command 40# Short version is used, if $(quiet) equals `quiet_', otherwise full one. 41echo-cmd = $(if $($(quiet)cmd_$(1)),\ 42 echo ' $(call escsq,$($(quiet)cmd_$(1)))';) 43 44### 45# Replace >$< with >$$< to preserve $ when reloading the .cmd file 46# (needed for make) |
46# Replace >#< with >\#< to avoid starting a comment in the .cmd file | 47# Replace >#< with >$(pound)< to avoid starting a comment in the .cmd file |
47# (needed for make) 48# Replace >'< with >'\''< to be able to enclose the whole string in '...' 49# (needed for the shell) | 48# (needed for make) 49# Replace >'< with >'\''< to be able to enclose the whole string in '...' 50# (needed for the shell) |
50make-cmd = $(call escsq,$(subst \#,\\\#,$(subst $$,$$$$,$(cmd_$(1))))) | 51make-cmd = $(call escsq,$(subst $(pound),$$(pound),$(subst $$,$$$$,$(cmd_$(1))))) |
51 52### 53# Find any prerequisites that is newer than target or that does not exist. 54# PHONY targets skipped in both cases. 55any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^) 56 57### 58# Copy dependency data into .cmd file --- 42 unchanged lines hidden --- | 52 53### 54# Find any prerequisites that is newer than target or that does not exist. 55# PHONY targets skipped in both cases. 56any-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^) 57 58### 59# Copy dependency data into .cmd file --- 42 unchanged lines hidden --- |