Make the Makefile stand alone.
authorGreg Clayton <gclayton@apple.com>
Wed, 25 Apr 2012 01:19:20 +0000 (01:19 +0000)
committerGreg Clayton <gclayton@apple.com>
Wed, 25 Apr 2012 01:19:20 +0000 (01:19 +0000)
llvm-svn: 155520

lldb/examples/darwin/heap_find/Makefile

index 1d0367480e9657ff0b991a1e9decc9debb595b9c..719e367765dddf56450de9fe770fa9c4a5e22dcb 100644 (file)
@@ -1,7 +1,48 @@
-LEVEL = ../../../test/make
+#----------------------------------------------------------------------
+# Fill in the source files to build
+#----------------------------------------------------------------------
+# Uncomment line below for debugging shell commands
+# SHELL = /bin/sh -x
+
+#----------------------------------------------------------------------
+# Change any build/tool options needed
+#----------------------------------------------------------------------
+DS := /usr/bin/dsymutil
+CFLAGS ?=-arch x86_64 -arch i386 -gdwarf-2 -O0
+CPLUSPLUSFLAGS +=$(CFLAGS)
+CPPFLAGS +=$(CFLAGS)
+LDFLAGS = $(CFLAGS) -install_name "@executable_path/libheap.dylib" -dynamiclib
+CXX := $(shell xcrun -find clang++)
+LD := $(CXX)
+TEMPS =
+EXE=libheap.dylib
+DSYM=$(EXE).dSYM
+
+#----------------------------------------------------------------------
+# Make the dSYM file from the executable
+#----------------------------------------------------------------------
+$(DSYM) : $(EXE)
+       $(DS) -o "$(DSYM)" "$(EXE)"
+
+#----------------------------------------------------------------------
+# Compile the executable from all the objects (default rule) with no
+# dsym file.
+#----------------------------------------------------------------------
+$(EXE) : heap_find.o
+       $(LD) $(LDFLAGS) heap_find.o -o "$(EXE)"
+
+heap_find.o : heap_find.cpp
+       $(CXX) $(CFLAGS) -c heap_find.cpp
+
+#----------------------------------------------------------------------
+# Include all of the makefiles for each source file so we don't have
+# to manually track all of the prerequisites for each source file.
+#----------------------------------------------------------------------
+.PHONY: clean
+dsym:  $(DSYM)
+all:   $(EXE) $(DSYM)
+clean:
+       rm -rf "$(EXE)" "$(DSYM)" heap_find.o $(TEMPS)
+
 
-DYLIB_NAME := heap
-DYLIB_ONLY := YES
-DYLIB_CXX_SOURCES := heap_find.cpp
 
-include $(LEVEL)/Makefile.rules