summaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/sandbox-compile-test'Sascha Hauer2020-06-113-0/+82
|\
| * sandbox: define CONFIG_64BIT as appropriateAhmad Fatoum2020-06-031-0/+9
| | | | | | | | | | | | | | | | | | | | | | All 64-bit architectures are supposed to define CONFIG_64BIT to support the relevant 64-bit MMIO accessors. The sandbox architecture is a bit of a special case, because barebox uses the toolchain default and doesn't force a bitness. Add 64BIT as promptless symbol, which reflects the pointer size of the target platform. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: import Linux Kconfig.includeAhmad Fatoum2020-06-032-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | With this include, we can have goodies like $(cc-option ...) and $(success ...) inside our Kconfig files. gcc-version also now becomes available. While unused for now, it can allow us to selectively turn on warnings on new GCC versions, which were previously disabled because of their too high false positive rate. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2020-06-111-0/+1
|\ \ | |/ |/|
| * scripts: .gitignore: ignore mvebuimg binaryAhmad Fatoum2020-06-031-0/+1
| | | | | | | | | | | | | | | | If selected, we generate a mvebuimg binary that should be ignored by version control. Add .gitignore entry to do so. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: switch over to thin archiveMasahiro Yamada2020-05-252-18/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting v4.13, Linux always uses thin archive instead of relocatable ELF to combine builtin objects. The thin archive is basically a text file that only contains paths to object files. As Linux commit 98ced886dd79 mentioned, this has a lot of benefits: - save disk space for builds - speed-up building a little - fix some issues when liking a giant executable (for example, allyesconfig on ARM Linux) - work better with dead code elimination The last one is important for barebox because pbl highly relies on the dead code elimination (-f{function,data}-sections and --gc-sections) dropping symbols that are unreachable from the linker's entry point. The dead code elimination does not work if the same symbol names are used in the pevious incremental link mechanism because the same name symbols all go into the same section. Commit a83c97f2a406 ("ARM: socfpga: generate smaller images when multiple boards are selected") worked around it by giving a dedicate section to each of the same name symbols. This workaround can go away. built-in.o was renamed to built-in.a since it is now an archive. built-in-pbl.o was renamed to built-in.pbl.a for consistency. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: unify barebox and pbl build commandsMasahiro Yamada2020-05-252-29/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current Linux uses the unified build command for built-in objects and module objects. This is possible because part-of-module is set to y when the target is being built for a module. If so, quiet_modtag is set to [M], and modkern_cflags is set to KBUILD_CFLAGS_MODULE instead of KBUILD_CFLAGS_KERNEL. Currently, barebox uses a separate build command for pbl, but the difference between cmd_cc_o_c and cmd_pbl_cc_o_c is just "-D__PBL__ $(PBL_CPPFLAGS)". By using the same approach as Linux, they can be unified. Set part-of-pbl flag to y when the target is being built for pbl. Merge cmd_as_o_S and cmd_link_o_target as well. This also changes the shortlog style as follows: PBLCC -> CC [P] PBLAS -> AS [P] PBLLD -> LD [P] This is more consistent with the policy in the Linux build system. In Linux, a capital letter enclosed square blackets indicates which target the object is being built for. CC object built for built-in CC [M] object built for modules CC [U] object built for userspace (proposed for Linux 5.8-rc1) The idea behind this is we use the same compiler $(CC) for them. Only the difference is the compiler flags. On the other hand, host programs are compiled by a different tool, $(HOSTCC), hence the shortlog is 'HOSTCC'. Barebox supports module builds (it seems), but the [P] notation does not conflict with [M] because pbl has a limited memory footprint. We never expect pbl can support the module feature. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: resync modkern_{c, a}flags and quiet_modtag with Linux 5.7-rc6Masahiro Yamada2020-05-202-27/+20
| | | | | | | | | | | | | | | | | | | | The latest Linux calculates them more simply; part-of-module is set when the target is being built for a module. Also, rename real-objs-{y,m} to real-obj-{y,m}. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: append $(bbenv-y) to obj-y earlierMasahiro Yamada2020-05-201-6/+5
| | | | | | | | | | | | | | You can save one line. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: resync mkdir code with Linux 5.7-rc6Masahiro Yamada2020-05-203-19/+12
| | | | | | | | | | | | | | | | | | Kbuild automatically creates the output directories for O= builds. Previously it called mkdir too much. Linux optimized this a lot. Let's import the outcome so it works faster. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: remove obj-dtb-y, pbl-dtb-y, lwl-dtb-y syntaxMasahiro Yamada2020-05-202-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The embedded DTBs are compiled by the chain of pattern rules as follows: %.dts -> %.dtb -> %.dtb.S -> %.dtb.o for barebox proper %.dts -> %.dtb -> %.dtb.S -> %.dtb.pbl.o for pbl Barebox introduced {obj,pbl,lwl}-dtb-y syntax to put the intermediate files into extra-y. The purposes of doing so were: [1] prevent GNU Make from deleting the intermediate files [2] include .*.cmd files In contrast, Linux does not use a special syntax for embedding DTBs into the kernel. For example, as you see in arch/sh/boot/dts/Makefile of Linux 5.6, obj-y += <basename>.dtb.o ... just works. This is because scripts/Kbuild.include specifies .SECONDARY to cater to [1], and scripts/Makefile.build adds the intermediates to 'targets' to deal with [2]. Barebox had already imported the same code from Linux, so you can use obj-y instead of obj-dtb-y, like Linux. pbl-dtb-y and lwl-dtb-y are barebox-specific cases, so I added the %.dtb.pbl.o pattern to intermediate_targets. Going forward, please use obj-y, pbl-y, or lwl-y. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: rename pbl object pbl-*.o to *.pbl.oMasahiro Yamada2020-05-202-4/+4
|/ | | | | | | | | | | | | | | | | | Currently, pbl objects are output to: <directory-path>/pbl-<basename>.o This commit changes as follows: <directory-path>/<basename>.pbl.o The motivation is not only to get rid of the ugly code introduced by commit 257abdaa36c8 ("Do not rm the path from pbl-y target"), but also to make it easier to remove obj-dtb-y, pbl-dtb-y, lwl-dtb-y syntax in the next commit. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/stm32'Sascha Hauer2020-05-141-0/+1
|\
| * scripts: add stm32image to .gitignoreLucas Stach2020-05-121-0/+1
| | | | | | | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2020-05-1437-121/+6
|\ \
| * | scripts: bareboximd: fix write_file error handlingSteffen Trumtrar2020-05-051-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | write will never return 0 on POSIX conformant systems. Remove this error path. Also, close the file on error. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imd: fix uninitialized variable readAhmad Fatoum2020-04-291-4/+1
| | | | | | | | | | | | | | | | | | | | | Errors are propagated in the loop and ret is never set. Remove it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | treewide: remove references to CREDITSUwe Kleine-König2020-04-2737-111/+0
| |/ | | | | | | | | | | | | | | The CREDITS file was removed from barebox in 2015 by commit 6570288f2d97 ("Remove the CREDITS file"). Remove references to it from several files. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/kconfig'Sascha Hauer2020-05-141-0/+329
|\ \
| * | scripts: kconfig-lint.py: extend for undefined symbol detectionAhmad Fatoum2020-04-291-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the script by some code from the official list_undefined.py example[1] to further detect symbols we are using, but haven't defined anywhere. [1]: https://github.com/ulfalizer/Kconfiglib/blob/35a60b7/examples/list_undefined.py Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: import Zephyr scripts/kconfig/lint.py into bareboxAhmad Fatoum2020-04-291-0/+306
| |/ | | | | | | | | | | | | | | | | | | | | | | This kconfig linter can do some useful analysis to find problems in our Kconfig files. Import it into barebox source tree with the changes necessary to be usable. The results of running it should be taken with a grain of salt and verified with grep. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/kbuild'Sascha Hauer2020-05-1427-505/+533
|\ \
| * | kbuild: resync top Makefile, mkmakefile, tags.sh with Linux 5.7-rc4Masahiro Yamada2020-05-125-139/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The prologue of the build system is not specific to Linux or Barebox. Paritially resync with Linux 5.7-rc4 - In Linux, $(objtree) is always '.', and $(srctree) might be relative. I am keeping both absolute for now to avoid unexpected breakage. - I did not resync single target for now. We need to touch Makefile.build a lot if we want to resync it. - 'export CDPATH=' is Barebox-only code, which was added by commit 6cc8d0544658 ("Makefile: disable CDPATH"). Keep it. - KBUILD_SRC no longer exists in the upstream Linux. I replaced it with building_out_of_srctree. - scripts/mkmakefile does not contain anything specific to Linux or Barebox. Resync it with Linux 5.7-rc4 - scripts/tags was imported from Linux 3.6 with some cherry-picks on top of that. Resync it with Linux 5.7-rc4 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | kbuild: sync scripts/Kbuild.include with Linux 5.7-rc2Masahiro Yamada2020-05-041-20/+22
| | | | | | | | | | | | | | | | | | | | | More random cherry-picks for scripts/Kbuild.include Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | kbuild: sync if_changed and friends with Linux 5.7-rc2Masahiro Yamada2020-05-042-82/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resync cmd, if_change, if_changed_dep, and if_changed_rule. Clean up the users of if_changed_rule. I deleted the modversions rule. It is dead code because barebox does not define CONFIG_MODVERSIONS. It does not work without scripts/genksyms/ anyway. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | kbuild: sync filechk rule with Linux 5.7-rc2Masahiro Yamada2020-05-041-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'filechk' in the latest Linux works more simply, reliably. - Do not show CHK every time - Delete the *.tmp file when the filechk_$(1) fails - Do not open the first prerequisite. This is unneeded in most cases. I deleted pointeless dependency on Makefile. Also delete the meaningless assignment to 'targets' because filechk does not generate .cmd file. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | kbuild: use $(SRCARCH) to point to the arch directoryMasahiro Yamada2020-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A couple of arch directories in Linux are biarch, that is, a single arch/*/ directory supports both 32-bit and 64-bit. In old days of Linux, they started as separated directories. arm/arm64 is the exceptional case, but the other architectures were unified. e.g.) arch/i386, arch/x86_64 -> arch/x86 arch/sh, arch/sh64 -> arch/sh arch/sparc, arch/sparc64 -> arch/sparc Linux commit 6752ed90da03 ("Kbuild: allow arch/xxx to use a different source path") introduced SRCARCH to point to the arch directory, still allowing to pass in the former ARCH=i386 or ARCH=x86_64. The top Makefile in Linux converts ARCH to SRCARCH as follows: # Additional ARCH settings for x86 ifeq ($(ARCH),i386) SRCARCH := x86 endif ifeq ($(ARCH),x86_64) SRCARCH := x86 endif So, if you follow the upstream Kbuild convention, using arch/$(SRCARCH) is the correct way to point to the arch directory. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | modpost: sync mk_elfconfig.c with Linux 5.7-rc2Masahiro Yamada2020-04-273-11/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Just get rid of the argument $(ARCH), then hardcode MODULE_SYMBOL_PREFIX. This should have no impact because none of v850, h8300, blackfin is supported by barebox. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | kconfig: update to Linux 5.7-rc2Masahiro Yamada2020-04-2716-219/+248
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous sync was Linux 5.5. This updates Kconfig to Linux 5.7-rc2. Highlights: - add yes2modconfig and mod2yesconfig, which are useful for coping with syzbot configs in Linux - remove include/config/tristate.conf - show more precise help - fix various issues of 'make xconfig' Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | kbuild: prefix compiler flag variables with KBUILD_Masahiro Yamada2020-04-276-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In old days, Linux also used to use well-known variables such CFLAGS, CPPFLAGS, etc. They were prefixed with KBUILD_ presumably for preventing users from overriding them accidentally. Rename as follows: CFLAGS -> KBUILD_CFLAGS AFLAGS -> KBUILD_AFLAGS CPPFLAGS -> KBUILD_CPPFLAGS LDFLAGS -> KBUILD_LDFLAGS HOSTCFLAGS -> KBUILD_HOSTCFLAGS HOSTCXXFLAGS -> KBUILD_HOSTCXXFLAGS HOSTLDFLAGS -> KBUILD_HOSTLDFLAGS HOST_LOADLIBES -> KBUILD_HOSTLDLIBS HOSTCFLAGS, HOSTCXXFLAGS, HOSTLDFLAGS, HOSTLDLIBS are re-used to allow users to pass-in additional flags to the host compiler. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | kbuild: support ccflags-y, asflags-y, cppflags-y, and ldflags-yMasahiro Yamada2020-04-271-4/+8
| |/ | | | | | | | | | | | | | | | | | | Some Makefiles use ccflags-y, but it is not actually supported. Support ccflags-y, asflags-y, cppflags-y, and ldflags-y like Linux. Remove the workaround in drivers/pci/Makefile. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / kbuild: add $(always-y) to 'targets'Masahiro Yamada2020-05-041-1/+1
|/ | | | | | | | | | | I missed to sync this line in commit 421108c51da4 ("kbuild: rename hostprogs-y/always to hostprogs/always-y"). Since then, the files in always(-y) are needlessly rebuilt. Fixes: 421108c51da4 ("kbuild: rename hostprogs-y/always to hostprogs/always-y") Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dtc: remove redundant YYLOC global declarationLucas Stach2020-04-271-1/+0
| | | | | | | Same as the upstream fix for building dtc with gcc 10. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/zynq'Sascha Hauer2020-04-161-2/+7
|\
| * scripts: zynq_mkimage: remove compiler warningMichael Graichen2020-04-141-2/+7
| | | | | | | | | | | | | | | | | | Fixes a warning while compiling zynq_mkimage.c scripts/zynq_mkimage.c:312:2: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] fread returns the number bytes read, if it is not equal to st_size some error has happend Signed-off-by: Michael Graichen <michael.graichen@hotmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fixdep: update to Linux 5.7-rc1Masahiro Yamada2020-04-153-33/+49
| | | | | | | | | | | | | | | | | | scripts/basic/ works for barebox as drop-in. Update scripts/basic/ to Linux 5.7-rc1. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: update flex and bison rules to Linux 5.7-rc1Masahiro Yamada2020-04-152-23/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | Import the following commits from Linux, and re-sync. - 6ba7dc6616ce "kbuild: make bison create C file and header in a single pattern rule" - cf8dfd15e5fb "kbuild: move flex and bison rules to Makefile.host" Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: rename hostprogs-y/always to hostprogs/always-yMasahiro Yamada2020-04-154-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ Linux commit 5f2fb52fac15a8a8e10ce020dd532504a8abfc4e ] In old days, the "host-progs" syntax was used for specifying host programs. It was renamed to the current "hostprogs-y" in 2004. It is typically useful in scripts/Makefile because it allows Kbuild to selectively compile host programs based on the kernel configuration. This commit renames like follows: always -> always-y hostprogs-y -> hostprogs So, scripts/Makefile will look like this: always-$(CONFIG_BUILD_BIN2C) += ... always-$(CONFIG_KALLSYMS) += ... ... hostprogs := $(always-y) $(always-m) I think this makes more sense because a host program is always a host program, irrespective of the kernel configuration. We want to specify which ones to compile by CONFIG options, so always-y will be handier. The "always", "hostprogs-y", "hostprogs-m" will be kept for backward compatibility for a while. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | checkpatch.pl: Update DT vendor prefix checkAntony Pavlov2020-04-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | In commit 796af3473b82 ("dts: update to v5.2-rc1") vendor-prefixes.txt has been converted to a DT schema. Update the checkpatch.pl DT check to extract vendor prefixes from the new vendor-prefixes.yaml file. Based on this linux kernel commit 852d095d16a6 ("checkpatch.pl: Update DT vendor prefix check"). Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kconfig: update to Linux 5.5Masahiro Yamada2020-03-267-11/+38
| | | | | | | | | | | | | | The previous sync was Linux 5.3-rc3. This updates Kconfig to Linux 5.5. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: change *FLAGS_<basetarget>.o to take the path relative to $(obj)Masahiro Yamada2020-03-263-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ Linux commit 54b8ae66ae1a3454a7645d159a482c31cd89ab33 ] Kbuild provides per-file compiler flag addition/removal: CFLAGS_<basetarget>.o CFLAGS_REMOVE_<basetarget>.o AFLAGS_<basetarget>.o AFLAGS_REMOVE_<basetarget>.o CPPFLAGS_<basetarget>.lds HOSTCFLAGS_<basetarget>.o HOSTCXXFLAGS_<basetarget>.o The <basetarget> is the filename of the target with its directory and suffix stripped. This syntax comes into a trouble when two files with the same basename appear in one Makefile, for example: obj-y += foo.o obj-y += dir/foo.o CFLAGS_foo.o := <some-flags> Here, the <some-flags> applies to both foo.o and dir/foo.o The real world problem is: scripts/kconfig/util.c scripts/kconfig/lxdialog/util.c Both files are compiled into scripts/kconfig/mconf, but only the latter should be given with the ncurses flags. It is more sensible to use the relative path to the Makefile, like this: obj-y += foo.o CFLAGS_foo.o := <some-flags> obj-y += dir/foo.o CFLAGS_dir/foo.o := <other-flags> At first, I attempted to replace $(basetarget) with $*. The $* variable is replaced with the stem ('%') part in a pattern rule. This works with most of cases, but does not for explicit rules. For example, arch/ia64/lib/Makefile reuses rule_as_o_S in its own explicit rules, so $* will be empty, resulting in ignoring the per-file AFLAGS. I introduced a new variable, target-stem, which can be used also from explicit rules. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: remove clean-dirs syntaxMasahiro Yamada2020-03-262-15/+2
|/ | | | | | | | | | | | [ Linux comit 1634f2bfdb846ed0a8b73131a9dff7c420fb3fe1 ] The only the difference between clean-files and clean-dirs is the -r option passed to the 'rm' command. You can always pass -r, and then remove the clean-dirs syntax. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2020-03-181-1/+1
|\
| * scripts/bareboximd: add mode argument to open callFranck Jullien2020-03-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Newer gcc complain about missing mode argument when a new file is created. This is an extract of man-pages: "The mode argument specifies the file mode bits be applied when a new file is created. This argument must be supplied when O_CREAT or O_TMPFILE is specified in flags" Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2020-03-184-13/+64
|\ \ | |/ |/|
| * scripts: imx-usb-loader: Fix i.MX8MMSascha Hauer2020-02-244-9/+13
| | | | | | | | | | | | | | | | | | Most things valid for the i.MX8MQ are needed for the i.MX8MM as well, so add a common macro which returns true for both SoCs and use it where appropriate. Also we have to search for the i.MX header in a bigger area as it is at offset 33KiB. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: imx-image: Add i.MX8MM supportSascha Hauer2020-02-191-0/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: imx-usb-loader: Add i.MX8MM supportSascha Hauer2020-02-191-1/+8
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: imx-usb-loader: Add 2nd stage loading supportSascha Hauer2020-02-191-3/+42
| | | | | | | | | | | | | | | | This adds the host part for 2nd stage uploading in case the RAM setup is done in code. This works in conjunction with "usb: gadget: fsl_udc: Add PBL image loading support". Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imd: remove duplicate macro definitionsAhmad Fatoum2020-02-191-4/+0
| | | | | | | | | | | | | | | | | | include/scripts/linux/kernel.h included via #include <linux/kernel.h> later on already defines these three macros. Remove them here to avoid the warnings about the duplicate macro definition. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>