Simplified handling of array indexes in SetMemOperands_Internal.
[oota-llvm.git] / Makefile.rules
index aef05750ace06161b4253359c4695211256b5419..b13db1802d8b526bfe3fd2412cfb0c0981d5a7bb 100644 (file)
@@ -74,29 +74,27 @@ else
 PROFILE =
 endif
 
-# TODO: Get rid of exceptions! : -fno-exceptions -fno-rtti
 # -Wno-unused-parameter
 CompileCommonOpts = $(PROFILE) -Wall -W  -Wwrite-strings -Wno-unused -I$(LEVEL)/include
 
 # Compile a file, don't link...
-Compile  = $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CompileCommonOpts) $(PROFILE)
+Compile  = $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CompileCommonOpts)
 CompileG = $(Compile) -g  -D_DEBUG
 CompileO = $(Compile) -O3 -DNDEBUG -finline-functions -felide-constructors -fnonnull-objects -freg-struct-return -fshort-enums
 
 # Link final executable
 
-# To enable purify, do it here:
-ifdef ENABLE_PURIFY
-Link     = $(PURIFY) $(CXX) $(Prof) -static
+ifdef ENABLE_PURIFY # To enable purify, build with 'gmake ENABLE_PURIFY=1'
+Link     = $(PURIFY) $(CXX) $(PROFILE) -static
 else
-Link     = LD_RUN_PATH=/usr/dcs/software/evaluation/encap/gcc-3.0.4/lib $(CXX) $(PROFILE)
+Link     = $(CXX) $(PROFILE)
 endif
 LinkG    = $(Link) -g  -L $(LIBDEBUG)
 LinkO    = $(Link) -O3 -L $(LIBRELEASE)
 
 # Create a .so file from a .o files...
-#MakeSO   = $(CXX) -shared $(Prof)
-MakeSO   = $(CXX) -G $(Prof)
+#MakeSO   = $(CXX) -shared $(PROFILE)
+MakeSO   = $(CXX) -G $(PROFILE)
 MakeSOO  = $(MakeSO) -O3
 
 # Create one .o file from a bunch of .o files...
@@ -117,7 +115,7 @@ MakeLib   = $(AR)
 # 
 Source  := $(ExtraSource) $(wildcard *.cpp *.c *.y *.l)
 
-Objs := $(sort $(addsuffix .o,$(basename $(Source))))
+Objs := $(sort $(patsubst Debug/%.o, %.o, $(addsuffix .o,$(basename $(Source)))))
 ObjectsO = $(addprefix Release/,$(Objs))
 ObjectsG = $(addprefix Debug/,$(Objs))
 
@@ -149,7 +147,7 @@ endif
 #  BUILD_ARCHIVE instead.
 #
 #  Some libraries must be built as .a files (libscalar for example) because if
-#  it's built as a .o file, then all of the constitent .o files in it will be
+#  it's built as a .o file, then all of the constituent .o files in it will be
 #  linked into tools (for example gccas) even if they only use one of the parts
 #  of it.  For this reason, sometimes it's useful to use libraries as .a files.
 
@@ -162,6 +160,8 @@ LIBNAME_AG   := $(LIBDEBUG)/lib$(LIBRARYNAME).a
 LIBNAME_OBJO := $(LIBRELEASE)/$(LIBRARYNAME).o
 LIBNAME_OBJG := $(LIBDEBUG)/$(LIBRARYNAME).o
 
+
+ifndef ENABLE_OPTIMIZED
 BUILD_LIBNAME_G := $(LIBNAME_G)
 ifndef DONT_BUILD_RELINKED
 BUILD_LIBNAME_OBJG := $(LIBNAME_OBJG)
@@ -169,6 +169,7 @@ endif
 ifdef BUILD_ARCHIVE
 BUILD_LIBNAME_AG := $(LIBNAME_AG)
 endif
+endif
 
 # If optimized builds are enabled...
 ifdef ENABLE_OPTIMIZED
@@ -216,12 +217,9 @@ endif
 #------------------------------------------------------------------------
 
 ifeq ($(LEVEL), .)
-
 tags:
        etags -l c++ `find include lib tools -name '*.cpp' -o -name '*.h'`
-
 all:: tags
-
 endif
 
 #------------------------------------------------------------------------
@@ -295,10 +293,6 @@ Debug/%.o: %.cpp Debug/.dir Depend/.dir
 #Debug/%.o: %.c Debug/.dir Depend/.dir
 #      $(CompileGC) $< -o $@
 
-# Create a .cpp source file from a burg input file
-%.burm.cpp: Debug/%.burg Debug/.dir
-       $(RunBurg) $< -o $@
-
 # Create a .cpp source file from a flex input file... this uses sed to cut down
 # on the warnings emited by GCC...
 %.cpp: %.l
@@ -316,7 +310,7 @@ Debug/%.o: %.cpp Debug/.dir Depend/.dir
        mkdir -p $(@D)
        @date > $@
 
-# Clean does not remove the output files... just the temporaries
+# Clean nukes the tree
 clean::
        rm -rf Debug Release Depend
        rm -f core *.o *.d *.so *~ *.flc
@@ -324,7 +318,7 @@ clean::
 # If dependancies were generated for the file that included this file,
 # include the dependancies now...
 #
-SourceDepend = $(addsuffix .d,$(addprefix Depend/,$(basename $(Source))))
+SourceDepend = $(addsuffix .d,$(addprefix Depend/,$(basename $(filter-out Debug/%, $(Source)))))
 ifneq ($(SourceDepend),)
 include $(SourceDepend)
 endif