From b9c996650d364eaf5ff04dda98227d7cffb20889 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Sun, 11 Aug 2024 22:19:45 +0100 Subject: [PATCH] =?UTF-8?q?Make=20=E2=80=98loc=E2=80=99=20target=20work=20?= =?UTF-8?q?in=20each=20top-level=20subdirectory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit But don’t make it a recursive target, so we still get an overall count when running it at the top level. --- Makefile.am | 2 +- configure.ac | 4 ++++ lib/Makefile.am | 7 +++++++ libgnu/Makefile.am | 7 ++++++- providers/Makefile.am | 11 ++++++++++- src/Makefile.am | 7 +++++++ 6 files changed, 35 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index e411b976..b8e7724d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -52,7 +52,7 @@ doxygen: Doxyfile dist: doxygen loc: - cloc --force-lang="Bourne Shell",conf $(ALL_SOURCE_FILES) + $(CLOC) $(ALL_SOURCE_FILES) # Ignore built files that are part of the distribution (specifically, # doxygen/*). diff --git a/configure.ac b/configure.ac index b9177eaa..4601379a 100644 --- a/configure.ac +++ b/configure.ac @@ -199,6 +199,10 @@ AM_CONDITIONAL(WITH_APPLESPELL, test "$with_applespell" = yes) dnl Experimental/deprecated providers ENCHANT_CHECK_PKG_CONFIG_PROVIDER([zemberek], [ZEMBEREK], [dbus-glib-1 >= 0.62], [no]) +dnl Counting code +CLOC="cloc --force-lang='Bourne Shell',conf" +AC_SUBST([CLOC]) + dnl ======================================================================================= AC_CONFIG_HEADERS([config.h]) diff --git a/lib/Makefile.am b/lib/Makefile.am index 8f61b534..5b47714f 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -60,3 +60,10 @@ enchant.html: enchant.5 groff -mandoc -Thtml $< > $@ EXTRA_DIST = $(libenchant_data_DATA) $(VAPIS) + +loc: + $(CLOC) $(ALL_SOURCE_FILES) + +ALL_SOURCE_FILES = \ + Makefile.am \ + *.vala diff --git a/libgnu/Makefile.am b/libgnu/Makefile.am index b1adce6d..79a3fbfe 100644 --- a/libgnu/Makefile.am +++ b/libgnu/Makefile.am @@ -1,6 +1,6 @@ ## Makefile.am for the libgnu subdirectory of Enchant # -# Copyright (C) 2017 Reuben Thomas +# Copyright (C) 2017-2024 Reuben Thomas # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -27,5 +27,10 @@ else AM_CPPFLAGS += -DINSTALLDIR=\"$(libdir)\" endif +loc: + $(CLOC) $(ALL_SOURCE_FILES) + +ALL_SOURCE_FILES = libgnu/Makefile.am + # Include auto-generated makefile include Makefile.gnulib diff --git a/providers/Makefile.am b/providers/Makefile.am index 94a2c1f7..9b910925 100644 --- a/providers/Makefile.am +++ b/providers/Makefile.am @@ -1,6 +1,6 @@ ## Makefile.am for the providers subdirectory of Enchant # -# Copyright (C) 2017-2023 Reuben Thomas +# Copyright (C) 2017-2024 Reuben Thomas # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -63,3 +63,12 @@ endif enchant_applespell_la_LIBTOOLFLAGS = $(AM_LIBTOOLFLAGS) --tag=CXX enchant_applespell_la_OBJCXXFLAGS = $(AM_OBJCXXFLAGS) enchant_applespell_la_SOURCES = applespell_checker.mm + +loc: + $(CLOC) $(ALL_SOURCE_FILES) + +ALL_SOURCE_FILES = \ + Makefile.am \ + *.[ch] \ + *.cpp \ + *.mm diff --git a/src/Makefile.am b/src/Makefile.am index c1f90aa6..6c5e77ec 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -52,3 +52,10 @@ enchant_lsmod_@ENCHANT_MAJOR_VERSION@_SOURCES = enchant-lsmod.vala enchant_lsmod_@ENCHANT_MAJOR_VERSION@_VALAFLAGS = $(AM_VALAFLAGS) --pkg util EXTRA_DIST = enchant.1.in enchant-lsmod.1.in util.h $(VAPIS) + +loc: + $(CLOC) $(ALL_SOURCE_FILES) + +ALL_SOURCE_FILES = \ + Makefile.am \ + *.vala