-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
177 lines (136 loc) · 4.87 KB
/
Makefile
File metadata and controls
177 lines (136 loc) · 4.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#
# Top level Makefile
#
# Top level Makefile for rm_pm_hal project
#
# Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com/
# ALL RIGHTS RESERVED
#
# No make, you have no idea what you are doing
.SUFFIXES:
# Please don't remove intermediate files
.SECONDARY:
_lparen := (
_rparen := )
filter_var = $(if $(strip $(foreach chr,% $(_lparen) $(_rparen) * ^ [ ] + < > @ ?,$(findstring $(chr),$(1)))),,$(1))
_VARIABLES := $(foreach v,$(.VARIABLES),$(call filter_var,$(v)))
$(foreach v,$(_VARIABLES),$(if $(findstring environment,$(origin $v)),$(eval override $v := $(subst \,/,$(strip $($(v)))))))
$(foreach v,$(_VARIABLES),$(if $(findstring command line,$(origin $v)),$(eval override $v := $(subst \,/,$(strip $($(v)))))))
ifneq ($(call realpath,$(if $O,$O,.)),$(call realpath,$(CURDIR)))
# User is trying to build in special directory
_objtree_build:
@mkdir -p $O
@$(MAKE) -C $O -f $(CURDIR)/$(word 1,$(MAKEFILE_LIST)) \
--no-print-directory O= BUILD_SRC=$(CURDIR) $(MAKECMDGOALS)
PHONY += _objtree_build
Makefile: ;
%:: _objtree_build ; @:
else
DEFAULT_TARGET=am62x_lpm_stub_gp
all: targets
PHONY += all
V ?= 0
build_quiet = $V
TARGET_SOC = $(shell echo $(CONFIG_SOC_FOLDER_STRING))
BUILD_SRC := .
srctree = $(BUILD_SRC)
srcroot = $(srctree)
include $(srcroot)/build/build.paths
include $(srcroot)/build/build.inc
include $(srcroot)/build/build.config
include $(srcroot)/build/build.githooks
# Process top-level build.mk
ifeq ($(fresh_clean),0)
$(call _recurse_inc,$(srctree)/)
# Need vars assigned for build.rules
include $(srctree)/build/build.rules
# Temporary workaround, add built-in.o
extra-y += $(obj)/built-in.o
# Include autogenerated dependancies
-include $(foreach p,$(build_files),$(call add_dot,\
$(addsuffix .cmd,$($p)) $(addsuffix .d,$($p)))))
# Separate any nonsecurity components into a separate object list
obj-nonsec-y=$(filter-out tifs/src/hs/%,$(filter-out tifs/src/security/%,$(obj-y)))
# Build a list of security objects
obj-security-y=$(filter tifs/src/security/%,$(obj-y))
obj-security-y+=$(filter tifs/src/hs/%,$(obj-y))
# Build list of security objects relevant for boot
# On some k3 variants, this stays in DMSC IRAM
obj-security-boot-y=$(filter tifs/src/security/core/%,$(obj-security-y))
obj-security-boot-y+=$(filter tifs/src/security/boot/%,$(obj-security-y))
obj-security-boot-y+=$(filter tifs/src/security/secure_rm/%,$(obj-security-y))
# Remove security objects related to boot from the list
obj-security-other-y=$(filter-out tifs/src/security/boot/%,$(filter-out tifs/src/security/core/%,$(filter-out tifs/src/security/secure_rm/%,$(obj-security-y))))
# Collect all obj-y's
$(obj)/built-in.o: $(obj-nonsec-y) FORCE
$(call make,rule_ld_o_o)
$(obj)/security_boot.o: $(obj-security-boot-y) FORCE
$(call make,rule_ld_o_o)
$(obj)/security_other.o: $(obj-security-other-y) FORCE
$(call make,rule_ld_o_o)
# Make sure all our destination directories exist
$(shell mkdir -p $(foreach f,$(build_files),$(dir $($f))))
# Ensure that autodep headers get a chance to rebuild before they are
# dependancy checked
prepare_headers: $(prepare_headers-y)
PHONY += prepare_headers
targets: $(target-y)
PHONY += targets
endif
define NL
endef
$(objtree)/include/config.h: $(objtree)/.config
@echo 'GEN '$@
@$(SH) $(srctree)/scripts/generate_config $^ $(SCMVERSION) > $@
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)) $(wildcard $(patsubst %,$1%,$2))
foreach_cmd=$(foreach f,$2,$1 $(f)$(NL))
clean:
$(call foreach_cmd,@-rm -f,$(foreach f,$(build_files),$($f)))
@-rm -f tags ctags
@-rm -f $(clean_scripts)
$(call foreach_cmd,@rm -f,$(call rwildcard,$(srctree)/,*.map))
$(call foreach_cmd,@rm -f,$(call rwildcard,$(srctree)/,*.xml))
$(call foreach_cmd,@rm -f,$(call rwildcard,$(srctree)/,*.pyc))
@-rm -f .config
@-rm -fr scripts/git-hooks/indent/stageFiles
@-rm -fr scripts/git-hooks/indent/temp
@-rm -f $(call rwildcard,$(srctree)/,.*.cmd .*.d)
$(call foreach_cmd,@rm -f,$(call rwildcard,$(srctree)/,.*.cmd .*.d))
@-rm -f cscope.files cscope.out cscope.in.out cscope.po.out
PHONY += clean
distclean: clean clean_docs
@-rm -f .config
@rm -f $(call rwildcard,$(srctree)/,.*.cmd .*.d)
$(call foreach_cmd,@rm -f,$(call rwildcard,$(srctree)/,.*.cmd .*.d))
PHONY += distclean
ifneq ($(WIN_GITPATH),)
git_cmd = "$(WIN_GITPATH)/git.exe"
else
git_cmd = "git"
endif
gitsync:
$(git_cmd) submodule init && $(git_cmd) submodule sync && \
$(git_cmd) submodule update --init && \
echo 'Git submodules: nothin to sync'
endif
#
# ctags and cscope args
#
TAG_SUBDIRS := $(srctree)
FIND := find
FINDFLAGS := -L
tags ctags:
@echo -n "Generating ctags..."
@ctags -w -o ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \
-name '*.[chS]' -print`
@ln -s ctags tags
@echo "Done!"
cscope:
@echo -n "Generating cscope data..."
@$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) -name '*.[chS]' -print > \
cscope.files
@cscope -b -q -k
@echo "Done!"
FORCE:
PHONY += FORCE
.PHONY: $(PHONY)