Skip to content

Commit

Permalink
Added debugging rule to Makefile.
Browse files Browse the repository at this point in the history
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/
mwhittaker committed Mar 1, 2018
1 parent c56a1c7 commit 48807ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
#

0 comments on commit 48807ff

Please sign in to comment.