Skip to contentSkip to conversation

Improve make

PATCH In review Petr Vorel 3 participants 8 messages Jan 4, 2024 – Mar 18, 2024 Kbuild

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

cover Improve make

From: Petr Vorel <[email protected]>

Petr Vorel (3):
Makefile: Add doc target
make: Delete gitignore.mk
Makefile: Improve 'make help'

 Makefile                    | 40 +++++++++++++++++++++++++----
 include/mk/gitignore.mk     | 51 -------------------------------------
 testcases/realtime/Makefile |  1 -
 3 files changed, 35 insertions(+), 57 deletions(-)
 delete mode 100644 include/mk/gitignore.mk
Signature · 5 lines
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#1 lore raw

PATCH 1/3 Makefile: Add doc target

From: Petr Vorel <[email protected]>

Alias for metadata and docparse generation.

---
 Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Makefile +5 -2
index 53f94d9f7..ee92e64ea 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) Linux Test Project, 2009-2022
+# Copyright (c) Linux Test Project, 2009-2024
 # Copyright (c) Cisco Systems Inc., 2009-2010
 # Ngie Cooper, July 2009
 
@@ -178,6 +178,9 @@ INSTALL_TARGETS		+= $(addprefix $(DESTDIR)/$(bindir)/,$(BINDIR_INSTALL_SCRIPTS))
 
 $(INSTALL_TARGETS): $(INSTALL_DIR) $(DESTDIR)/$(bindir)
 
+.PHONY: doc
+doc: metadata-all
+
 .PHONY: check
 check: $(CHECK_TARGETS)
 
@@ -209,7 +212,7 @@ endif
 	$(call _test,-s)
 
 test-metadata: metadata-all
-	$(MAKE) -C $(abs_srcdir)/metadata/ test
+	$(MAKE) -C $(abs_srcdir)/metadata test
 
 ## Help
 .PHONY: help
Signature · 5 lines
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#3 lore raw

PATCH 2/3 make: Delete gitignore.mk

In reply to Petr Vorel

From: Petr Vorel <[email protected]>

We don't use this old functionality any more.

---
 Makefile                    |  1 -
 include/mk/gitignore.mk     | 51 -------------------------------------
 testcases/realtime/Makefile |  1 -
 3 files changed, 53 deletions(-)
 delete mode 100644 include/mk/gitignore.mk
Makefile +0 -1
index ee92e64ea..49d91f4d5 100644
@@ -13,7 +13,6 @@ top_srcdir		?= $(CURDIR)
 
 include $(top_srcdir)/include/mk/env_pre.mk
 include $(top_srcdir)/include/mk/automake.mk
-include $(top_srcdir)/include/mk/gitignore.mk
 
 .SUFFIXES:
 .SUFFIXES: .am .default .h .in .m4 .mk
include/mk/gitignore.mk deleted +0 -51

51 lines not on this page · raw message

testcases/realtime/Makefile +0 -1
index a7491654c..61663bfd9 100644
@@ -36,7 +36,6 @@ include $(top_srcdir)/include/mk/env_pre.mk
 ifeq ($(filter autotools %clean .gitignore gitignore.%,$(MAKECMDGOALS)),)
 include $(abs_srcdir)/config.mk
 endif
-include $(top_srcdir)/include/mk/gitignore.mk
 
 LIBDIR			:= lib
 FILTER_OUT_DIRS		:= $(LIBDIR) m4
Signature · 5 lines
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#5 lore raw

Re: [LTP] [PATCH 2/3] make: Delete gitignore.mk

Hi Cyril,

thanks, merged this one (with first commit).

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#6 lore raw

PATCH 3/3 Makefile: Improve 'make help'

In reply to Petr Vorel

From: Petr Vorel <[email protected]>

Describe most useful targets.
Exit 0 (it's not a failure to see help).

---
 Makefile | 32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)
Makefile +30 -2
index 49d91f4d5..7c9d1217a 100644
@@ -216,8 +216,36 @@ test-metadata: metadata-all
 ## Help
 .PHONY: help
 help:
-	@echo "Please read the Configuration section in $(top_srcdir)/INSTALL"
-	@exit 1
+	@echo 'Cleaning:'
+	@echo '  clean              - delete all files created by build'
+	@echo '  distclean          - delete all non-source files'
+	@echo '  lib-clean          - delete all files created by build in lib directory (C API library and tests)'
+	@echo '  libs-clean         - delete all files created by build in libs directory (other libraries)'
+	@echo '  testcases-clean    - delete all files created by build in testcases directory (tests)'
+	@echo
+	@echo 'Build:'
+	@echo '  all                - build everything'
+	@echo '  autotools          - preparation for configure'
+	@echo '  lib-all            - build lib directory (C API library and tests)'
+	@echo '  libs-all           - build libs directory (other libraries)'
+	@echo '  testcases-all      - build testcases and their dependencies'
+	@echo
+	@echo 'Install:'
+	@echo '  install            - install all files created by build'
+	@echo '  install-lib        - install files in lib directory (C API library and tests)'
+	@echo '  install-libs       - install files in libs directory (other libraries)'
+	@echo '  install-testcases  - install testcases'
+	@echo
+	@echo 'Documentation:'
+	@echo '  doc                - create test documentation (HTML and/or PDF, based on configuration)'
+	@echo
+	@echo 'Testing:'
+	@echo '  test               - run all tests'
+	@echo '  test-c             - run C API tests'
+	@echo '  test-metadata      - run documentation tests'
+	@echo '  test-shell         - run shell API tests'
+	@echo
+	@echo 'For more info please read the Configuration section in $(top_srcdir)/INSTALL'
 
 ## Menuconfig
 menuconfig:
Signature · 5 lines
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#7 lore raw

Re: [LTP] [PATCH 3/3] Makefile: Improve 'make help'

Hi!

Quoted 18 lines

index 49d91f4d5..7c9d1217a 100644

Makefile +9 -2
@@ -216,8 +216,36 @@ test-metadata: metadata-all
 ## Help
 .PHONY: help
 help:
-	@echo "Please read the Configuration section in $(top_srcdir)/INSTALL"
-	@exit 1
+	@echo 'Cleaning:'
+	@echo '  clean              - delete all files created by build'
+	@echo '  distclean          - delete all non-source files'
+	@echo '  lib-clean          - delete all files created by build in lib directory (C API library and tests)'
+	@echo '  libs-clean         - delete all files created by build in libs directory (other libraries)'
+	@echo '  testcases-clean    - delete all files created by build in testcases directory (tests)'
+	@echo
+	@echo 'Build:'
+	@echo '  all                - build everything'

Makefile test-metadata: metadata-all · line 237

Quoted 10 lines
Makefile +10 -0
+	@echo '  autotools          - preparation for configure'
+	@echo '  lib-all            - build lib directory (C API library and tests)'
+	@echo '  libs-all           - build libs directory (other libraries)'
+	@echo '  testcases-all      - build testcases and their dependencies'
+	@echo
+	@echo 'Install:'
+	@echo '  install            - install all files created by build'
+	@echo '  install-lib        - install files in lib directory (C API library and tests)'
+	@echo '  install-libs       - install files in libs directory (other libraries)'
+	@echo '  install-testcases  - install testcases'

I'm not sure if the sub-targets should be described in make help. I would say to stick to a simple set of clean, distclean, autotools, all, install, doc, check and be done with it.

Makefile test-metadata: metadata-all · line 246

Quoted 8 lines
Makefile +8 -0
+	@echo 'Documentation:'
+	@echo '  doc                - create test documentation (HTML and/or PDF, based on configuration)'
+	@echo
+	@echo 'Testing:'
+	@echo '  test               - run all tests'
+	@echo '  test-c             - run C API tests'
+	@echo '  test-metadata      - run documentation tests'
+	@echo '  test-shell         - run shell API tests'

This is way to confusing, we shouldn't mention the internal testsuite here users will confuse that with actually running LTP tests.

We should instead probably mention the make check.

Makefile test-metadata: metadata-all · line 248

Quoted 1 line
Makefile +1 -0
+	@echo 'For more info please read the Configuration section in $(top_srcdir)/INSTALL'

That file should be probably updated too.

Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp