From 48807ff44cab3be69a627ef9e411e1481663c58b Mon Sep 17 00:00:00 2001
From: Michael Whittaker <mjwhittaker@berkeley.edu>
Date: Thu, 1 Mar 2018 09:52:03 -0800
Subject: [PATCH] Added debugging rule to Makefile.

Added a debugging Makefile rule stolen from [1]. With this rule, you can
run make print-<VAR> to print out the contents of <VAR>. For example,

        make print-OBJS
        make print-PROTOOBJS
        make print-BINS

[1]: https://blog.melski.net/2010/11/30/makefile-hacks-print-the-value-of-any-variable/
---
 Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Makefile b/Makefile
index 713de3d..e77d4e6 100644
--- a/Makefile
+++ b/Makefile
@@ -237,6 +237,12 @@ clean:
 	$(call trace,RM,binaries,rm -f $(BINS) $(TEST_BINS))
 	$(call trace,RM,objects,rm -rf .obj)
 
+#
+# Debugging
+#
+print-%:
+	@echo '$*=$($*)'
+
 ##################################################################
 # Targets
 #
-- 
GitLab