Fix PR#226: When emitting padding, always emit it as bytes. Bytes can be
[oota-llvm.git] / Makefile.rules
index 7da6f5737ae67f71fca51a9b7038796efda8db76..fecbaac36c5fbd2838deafbc3395dc3ccffbcc01 100644 (file)
@@ -352,7 +352,7 @@ Depend   := $(CXX) -MM -I$(LEVEL)/include $(CPPFLAGS)
 DependC  := $(CC)  -MM -I$(LEVEL)/include $(CPPFLAGS) 
 
 # Archive a bunch of .o files into a .a file...
-AR       = ${AR_PATH} cq 
+AR       = $(AR_PATH) cr
 
 #----------------------------------------------------------
 
@@ -454,6 +454,11 @@ endif
 #  of it.  For this reason, sometimes it's useful to use libraries as .a files.
 ###########################################################################
 
+# Install rule for making bytecode library directory if it does not exist.
+# Trigger this by making libraries that need to be installed here depend on it.
+$(DESTDIR)$(bytecode_libdir):
+       $(MKDIR) $@
+
 ifdef LIBRARYNAME
 
 # Make sure there isn't any extranous whitespace on the LIBRARYNAME option
@@ -482,12 +487,8 @@ LIBNAME_BC   := $(DESTLIBBYTECODE)/lib$(LIBRARYNAME).bc
 # dynamic target builds a shared object version of the library...
 dynamic:: $(LIBNAME_CUR)
 bytecodelib:: $(LIBNAME_BC)
-bytecode_libdir = $(LLVMGCCDIR)/bytecode-libs
 install-bytecode-library:: $(DESTDIR)$(bytecode_libdir)/lib$(LIBRARYNAME).bc
 
-$(DESTDIR)$(bytecode_libdir):
-       $(MKDIR) $@
-
 $(DESTDIR)$(bytecode_libdir)/lib$(LIBRARYNAME).bc: $(LIBNAME_BC) $(DESTDIR)$(bytecode_libdir)
        @${ECHO} ======= Installing $(LIBRARYNAME) bytecode library =======
        cp $< $@
@@ -547,7 +548,7 @@ $(LIBNAME_G): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
        @${ECHO} ======= Finished building $(LIBRARYNAME) dynamic debug library =======
 
 install-dynamic-library: $(LIBNAME_CUR)
-       $(MKDIR) $(libdir)
+       $(MKDIR) $(DESTDIR)$(libdir)
        $(VERB) $(LIBTOOL) --mode=install $(INSTALL) $(LIBNAME_CUR) $(DESTDIR)$(libdir)/lib$(LIBRARYNAME)$(SHLIBEXT)
 
 #
@@ -572,7 +573,7 @@ $(LIBNAME_AG): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
        @${ECHO} ======= Finished building $(LIBRARYNAME) archive debug library =======
 
 install-archive-library: $(LIBNAME_ACUR)
-       $(MKDIR) $(libdir)
+       $(MKDIR) $(DESTDIR)$(libdir)
        $(VERB) $(LIBTOOL) --mode=install $(INSTALL) $(LIBNAME_ACUR) $(DESTDIR)$(libdir)/lib$(LIBRARYNAME).a
 
 #
@@ -602,7 +603,7 @@ $(LIBNAME_OBJG): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
        $(VERB) $(Relink) -o $@ $(RObjectsG) $(LibSubDirs)
 
 install-single-object-library: $(LIBNAME_OBJCUR)
-       $(MKDIR) $(libdir)
+       $(MKDIR) $(DESTDIR)$(libdir)
        $(VERB) $(LIBTOOL) --mode=install $(INSTALL) $(LIBNAME_OBJCUR) $(DESTDIR)$(libdir)/$(LIBRARYNAME).o
 
 endif
@@ -685,7 +686,7 @@ $(TOOLEXENAME_P): $(ObjectsP) $(USED_LIB_PATHS_P) $(DESTTOOLPROFILE)/.dir
        @${ECHO} ======= Finished building $(TOOLNAME) profile executable =======
 
 install:: $(TOOLEXENAMES)
-       $(MKDIR) $(bindir)
+       $(MKDIR) $(DESTDIR)$(bindir)
        $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) -c -m 0755 $(TOOLEXENAMES) $(DESTDIR)$(bindir)/$(TOOLNAME)
 
 endif