Commit Graph

5 Commits

Author SHA1 Message Date
Anh Tuan Phan aead78125a tools/counter: Makefile: Replace rmdir by rm to avoid make,clean failure
Use rm -df instead of rmdir -p since rmdir requires the directory exist
so it causes "make -C tools clean" failed if someone only builds other
tools but not counter.

Fixes: 228354ed69 ("tools/counter: Makefile: Remove lingering 'include' directories on make clean")
Signed-off-by: Anh Tuan Phan <tuananhlfc@gmail.com>
Link: https://lore.kernel.org/r/d4080db5-1825-2848-079a-8bb674d8ee44@gmail.com/
Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
2023-07-24 10:29:52 -04:00
Rong Tao 228354ed69 tools/counter: Makefile: Remove lingering 'include' directories on make clean
`make` creates 'include' directories where necessary, so remove them as
appropriate on `make clean`.

Signed-off-by: Rong Tao <rongtao@cestc.cn>
Link: https://lore.kernel.org/r/tencent_F85E314661100B0CE2845EB27E2E2F558C09@qq.com/
Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
2023-05-09 19:17:17 -04:00
Rong Tao 6a9a092eb2 tools/counter: Add .gitignore
Ignore counter_example and include/linux/counter.h.

Signed-off-by: Rong Tao <rongtao@cestc.cn>
Link: https://lore.kernel.org/r/tencent_3E0341A1C9AC8FCB7915E7D791D117445707@qq.com/
Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
2023-05-09 19:17:17 -04:00
Masahiro Yamada 5c8166419a kbuild: replace $(if A,A,B) with $(or A,B)
$(or ...) is available since GNU Make 3.81, and useful to shorten the
code in some places.

Covert as follows:

  $(if A,A,B)  -->  $(or A,B)

This patch also converts:

  $(if A, A, B) --> $(or A, B)

Strictly speaking, the latter is not an equivalent conversion because
GNU Make keeps spaces after commas; if A is not empty, $(if A, A, B)
expands to " A", while $(or A, B) expands to "A".

Anyway, preceding spaces are not significant in the code hunks I touched.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
2022-02-15 12:25:56 +09:00
William Breathitt Gray 086099893f tools/counter: Create Counter tools
This creates an example Counter program under tools/counter/*
to exemplify the Counter character device interface.

Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Link: https://lore.kernel.org/r/7c0f975ba098952122302d258ec9ffdef04befaf.1632884256.git.vilhelm.gray@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-10-17 10:54:16 +01:00