Skip to content

Commit

Permalink
Make ‘loc’ target work in each top-level subdirectory
Browse files Browse the repository at this point in the history
But don’t make it a recursive target, so we still get an overall count when
running it at the top level.
  • Loading branch information
rrthomas committed Aug 16, 2024
1 parent 9ff69b9 commit b9c9966
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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/*).
Expand Down
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
7 changes: 7 additions & 0 deletions lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 6 additions & 1 deletion libgnu/Makefile.am
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
11 changes: 10 additions & 1 deletion providers/Makefile.am
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
7 changes: 7 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b9c9966

Please sign in to comment.