Commit | Line | Data |
---|---|---|
b2441318 | 1 | # SPDX-License-Identifier: GPL-2.0 |
3ee7b3fa | 2 | |
051f278e | 3 | ifdef building_out_of_srctree |
b513adf4 MY |
4 | |
5 | symlinks := $(patsubst $(srctree)/$(src)/%,%,$(wildcard $(srctree)/$(src)/*.py)) | |
6 | ||
7 | quiet_cmd_symlink = SYMLINK $@ | |
8 | cmd_symlink = ln -fsn $(patsubst $(obj)/%,$(abspath $(srctree))/$(src)/%,$@) $@ | |
9 | ||
10 | extra-y += $(symlinks) | |
11 | $(addprefix $(obj)/, $(symlinks)): FORCE | |
12 | $(call if_changed,symlink) | |
13 | ||
3ee7b3fa | 14 | endif |
3ee7b3fa | 15 | |
f197d75f KB |
16 | quiet_cmd_gen_constants_py = GEN $@ |
17 | cmd_gen_constants_py = \ | |
18 | $(CPP) -E -x c -P $(c_flags) $< > $@ ;\ | |
19 | sed -i '1,/<!-- end-c-headers -->/d;' $@ | |
20 | ||
1e5ff84f MY |
21 | extra-y += constants.py |
22 | $(obj)/constants.py: $(src)/constants.py.in FORCE | |
834a3529 | 23 | $(call if_changed_dep,gen_constants_py) |
f197d75f | 24 | |
b513adf4 | 25 | clean-files := *.pyc *.pyo |