[Lldb-commits] [lldb] r123469 - /lldb/trunk/test/make/Makefile.rules

Johnny Chen johnny.chen at apple.com
Fri Jan 14 13:18:12 PST 2011


Author: johnny
Date: Fri Jan 14 15:18:12 2011
New Revision: 123469

URL: http://llvm.org/viewvc/llvm-project?rev=123469&view=rev
Log:
Add makefile debugging rule for printing out the value of a variable.
>From http://blog.melski.net/tag/debugging-makefiles/.

Example:

[13:14:59] johnny:/Volumes/data/lldb/svn/trunk/test/class_static $ make print-CC
CC=gcc
  origin = file
  flavor = recursive
   value = gcc
[13:15:09] johnny:/Volumes/data/lldb/svn/trunk/test/class_static $ make print-LD
LD=  g++
  origin = file
  flavor = recursive
   value = $(call cxx_linker,$(CC))
[13:15:21] johnny:/Volumes/data/lldb/svn/trunk/test/class_static $ make print-CXX
CXX=  g++
  origin = file
  flavor = recursive
   value = $(call cxx_compiler,$(CC))
[13:15:29] johnny:/Volumes/data/lldb/svn/trunk/test/class_static $

Modified:
    lldb/trunk/test/make/Makefile.rules

Modified: lldb/trunk/test/make/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/make/Makefile.rules?rev=123469&r1=123468&r2=123469&view=diff
==============================================================================
--- lldb/trunk/test/make/Makefile.rules (original)
+++ lldb/trunk/test/make/Makefile.rules Fri Jan 14 15:18:12 2011
@@ -175,3 +175,14 @@
 else
 	rm -rf "$(EXE)" "$(DSYM)" $(OBJECTS) $(PREREQS) $(DYLIB_OBJECTS) $(DYLIB_NAME) $(DYLIB_NAME).dSYM
 endif
+
+#----------------------------------------------------------------------
+# From http://blog.melski.net/tag/debugging-makefiles/
+# 
+# Usage: make print-CC print-CXX print-LD
+#----------------------------------------------------------------------
+print-%:
+	@echo '$*=$($*)'
+	@echo '  origin = $(origin $*)'
+	@echo '  flavor = $(flavor $*)'
+	@echo '   value = $(value  $*)'





More information about the lldb-commits mailing list