about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-01T10·47+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-01T10·47+0100
commit35107038f7c726f5ef8d7ab014ad45c73970e65d (patch)
tree3d5c78dc830f92723ad8efb251a6e0257534f91d
parentf324b49ea19e606f84b89ecb499f0e961646cd50 (diff)
Support adding "make help" text
-rw-r--r--clean.mk4
-rw-r--r--lib.mk19
2 files changed, 16 insertions, 7 deletions
diff --git a/clean.mk b/clean.mk
index f45d578aa4b6..51bfd3bca324 100644
--- a/clean.mk
+++ b/clean.mk
@@ -5,3 +5,7 @@ clean:
 
 dryclean:
 	@for i in $(clean_files); do if [ -e $$i ]; then echo $$i; fi; done | sort
+
+print-top-help += \
+  echo "  clean: Delete generated files"; \
+  echo "  dryclean: Show what files would be deleted by 'make clean'";
diff --git a/lib.mk b/lib.mk
index f43fdd56c479..649c3b501861 100644
--- a/lib.mk
+++ b/lib.mk
@@ -79,7 +79,7 @@ $(foreach test, $(INSTALL_TESTS), $(eval $(call run-install-test,$(test))))
 $(foreach file, $(man-pages), $(eval $(call install-data-in, $(file), $(mandir)/man$(patsubst .%,%,$(suffix $(file))))))
 
 
-.PHONY: all man help
+.PHONY: default all man help
 
 all: $(programs_list) $(libs_list) $(jars_list) $(man-pages)
 
@@ -90,15 +90,10 @@ help:
 	@echo "The following targets are available:"
 	@echo ""
 	@echo "  default: Build default targets"
-	@echo "  install: Install into \$$(prefix) (currently set to '$(prefix)')"
-	@echo "  clean: Delete generated files"
-	@echo "  dryclean: Show what files would be deleted by 'make clean'"
-ifdef PACKAGE_NAME
-	@echo "  dist: Generate a source distribution"
-endif
 ifdef man-pages
 	@echo "  man: Generate manual pages"
 endif
+	@$(print-top-help)
 ifdef programs_list
 	@echo ""
 	@echo "The following programs can be built:"
@@ -117,3 +112,13 @@ ifdef jars_list
 	@echo ""
 	@for i in $(jars_list); do echo "  $$i"; done
 endif
+	@echo ""
+	@echo "The following variables control the build:"
+	@echo ""
+	@echo "  BUILD_SHARED_LIBS ($(BUILD_SHARED_LIBS)): Whether to build shared libraries"
+	@echo "  BUILD_DEBUG ($(BUILD_DEBUG)): Whether to include debug symbols"
+	@echo "  CC ($(CC)): C compiler to be used"
+	@echo "  CFLAGS: Flags for the C compiler"
+	@echo "  CXX ($(CXX)): C++ compiler to be used"
+	@echo "  CXXFLAGS: Flags for the C++ compiler"
+	@$(print-var-help)