about summary refs log tree commit diff
path: root/mk
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2018-02-08T16·26-0500
committerShea Levy <shea@shealevy.com>2018-02-08T17·44-0500
commit88cd2d41acb994684a3e4ead1b1676019f43b4b6 (patch)
tree7385aefa5755fd27983f3260b69020acef6de170 /mk
parentf201b7733e22cc236a41093a88cc789239d994bd (diff)
Add plugins to make Nix more extensible.
All plugins in plugin-files will be dlopened, allowing them to
statically construct instances of the various Register* types Nix
supports.
Diffstat (limited to 'mk')
-rw-r--r--mk/libraries.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/mk/libraries.mk b/mk/libraries.mk
index 3cd7a53107..14c95fa91c 100644
--- a/mk/libraries.mk
+++ b/mk/libraries.mk
@@ -45,6 +45,11 @@ endif
 # - $(1)_INSTALL_DIR: the directory where the library will be
 #   installed.  Defaults to $(libdir).
 #
+# - $(1)_EXCLUDE_FROM_LIBRARY_LIST: if defined, the library will not
+#   be automatically marked as a dependency of the top-level all
+#   target andwill not be listed in the make help output. This is
+#   useful for libraries built solely for testing, for example.
+#
 # - BUILD_SHARED_LIBS: if equal to ‘1’, a dynamic library will be
 #   built, otherwise a static library.
 define build-library
@@ -149,7 +154,9 @@ define build-library
   $(1)_DEPS := $$(foreach fn, $$($(1)_OBJS), $$(call filename-to-dep, $$(fn)))
   -include $$($(1)_DEPS)
 
+  ifndef $(1)_EXCLUDE_FROM_LIBRARY_LIST
   libs-list += $$($(1)_PATH)
+  endif
   clean-files += $$(_d)/*.a $$(_d)/*.$(SO_EXT) $$(_d)/*.o $$(_d)/.*.dep $$($(1)_DEPS) $$($(1)_OBJS)
   dist-files += $$(_srcs)
 endef