summaryrefslogtreecommitdiffstats
path: root/lib/src.mk
diff options
context:
space:
mode:
Diffstat (limited to 'lib/src.mk')
-rw-r--r--lib/src.mk34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/src.mk b/lib/src.mk
new file mode 100644
index 0000000..6ec6928
--- /dev/null
+++ b/lib/src.mk
@@ -0,0 +1,34 @@
+# Copyright 2022 Alejandro Colomar <alx@kernel.org>
+# SPDX-License-Identifier: LGPL-3.0-or-later WITH LGPL-3.0-linking-exception
+
+
+ifndef LIB_SRC_MK_
+LIB_SRC_MK_ := 1
+
+
+include $(srcdir)/lib/cmd.mk
+include $(srcdir)/lib/version.mk
+
+
+INCLUDEDIR := $(srcdir)/include
+SRCDIR := $(srcdir)/src
+LIBDIR := $(srcdir)/lib
+DATAROOTDIR := $(srcdir)/share
+PCDIR := $(DATAROOTDIR)/pkgconfig
+MANDIR := $(DATAROOTDIR)/man
+TESTSDIR := $(DATAROOTDIR)/tests/$(libname)
+
+
+mk := $(srcdir)/Makefile $(shell $(FIND) $(LIBDIR) -type f | $(GREP) '\.mk$$')
+
+
+TU_h := $(shell $(FIND) $(INCLUDEDIR) -type f | $(GREP) '\.h$$' | $(SORT))
+TU_c := $(shell $(FIND) $(SRCDIR) -type f | $(GREP) '\.c$$' | $(SORT))
+LIB_pc := $(PCDIR)/$(libname)-uninstalled.pc
+MAN_man := $(shell $(FIND) $(MANDIR) -type f | $(GREP) '\.[1-9]$$' | $(SORT))
+
+
+TU_DIRS := $(filter-out $(INCLUDEDIR),$(shell $(FIND) $(INCLUDEDIR) -type d | $(SORT)))
+
+
+endif # include guard