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

Johnny Chen johnny.chen at apple.com
Mon Jan 9 16:41:11 PST 2012


Author: johnny
Date: Mon Jan  9 18:41:11 2012
New Revision: 147821

URL: http://llvm.org/viewvc/llvm-project?rev=147821&view=rev
Log:
Add a CFLAGS_EXTRAS make variable to be able to pass things (like '-DTEST_BLOCK_CAPTURED_VARS') to the compile phase.

Plus add a DYLIB_ONLY make variable that can be used to turn off compilation/building of a.out. Example:

[16:39:21] johnny:/Volumes/data/lldb/svn/trunk/test/lang/c/global_variables $ make clean
rm -rf "a.out" "a.out.dSYM"  main.o main.d a.o a.d liba.dylib liba.dylib.dSYM
[16:39:24] johnny:/Volumes/data/lldb/svn/trunk/test/lang/c/global_variables $ make DYLIB_ONLY=YES
clang -gdwarf-2 -O0   -arch x86_64   -c -o a.o a.c
clang -gdwarf-2 -O0   -arch x86_64  a.o -install_name "@executable_path/liba.dylib" -dynamiclib -o "liba.dylib"
[16:39:30] johnny:/Volumes/data/lldb/svn/trunk/test/lang/c/global_variables $

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=147821&r1=147820&r2=147821&view=diff
==============================================================================
--- lldb/trunk/test/make/Makefile.rules (original)
+++ lldb/trunk/test/make/Makefile.rules Mon Jan  9 18:41:11 2012
@@ -42,7 +42,7 @@
 # Change any build/tool options needed
 #----------------------------------------------------------------------
 CFLAGS ?= -gdwarf-2 -O0
-CFLAGS += $(FRAMEWORK_INCLUDES)
+CFLAGS += $(FRAMEWORK_INCLUDES) $(CFLAGS_EXTRAS)
 ifeq "$(OS)" "Darwin"
 	CFLAGS += -arch $(ARCH)
 	DS := dsymutil
@@ -122,24 +122,36 @@
 
 
 #----------------------------------------------------------------------
+# DYLIB_ONLY variable can be used to skip the building of a.out.
+# See the sections below regarding dSYM file as well as the building of
+# EXE from all the objects.
+#----------------------------------------------------------------------
+
+#----------------------------------------------------------------------
 # Make the dSYM file from the executable if $(MAKE_DSYM) != "NO"
 #----------------------------------------------------------------------
 ifeq "$(OS)" "Darwin"
 ifneq "$(MAKE_DSYM)" "NO"
+ifeq "$(DYLIB_ONLY)" ""
 $(DSYM) : $(EXE)
 	$(DS) $(DSFLAGS) -o "$(DSYM)" "$(EXE)"
 endif
 endif
+endif
 
 #----------------------------------------------------------------------
 # Compile the executable from all the objects.
 #----------------------------------------------------------------------
-ifeq "$(DYLIB_NAME)" ""
-$(EXE) : $(OBJECTS)
-	$(LD) $(LDFLAGS) $(OBJECTS) -o "$(EXE)"
-else
+ifneq "$(DYLIB_NAME)" ""
+ifeq "$(DYLIB_ONLY)" ""
 $(EXE) : $(OBJECTS) $(DYLIB_FILENAME)
 	$(LD) $(LDFLAGS) $(OBJECTS) -L. -l$(DYLIB_NAME) -o "$(EXE)"
+else
+EXE = $(DYLIB_FILENAME)
+endif
+else
+$(EXE) : $(OBJECTS)
+	$(LD) $(LDFLAGS) $(OBJECTS) -o "$(EXE)"
 endif
 
 #----------------------------------------------------------------------





More information about the lldb-commits mailing list