[llvm-commits] CVS: llvm/Makefile.rules
Brian Gaeke
gaeke at cs.uiuc.edu
Thu Dec 18 14:58:01 PST 2003
Changes in directory llvm:
Makefile.rules updated: 1.165 -> 1.166
---
Log message:
Add install target for libraries.
---
Diffs of the changes: (+24 -6)
Index: llvm/Makefile.rules
diff -u llvm/Makefile.rules:1.165 llvm/Makefile.rules:1.166
--- llvm/Makefile.rules:1.165 Tue Dec 9 18:26:28 2003
+++ llvm/Makefile.rules Thu Dec 18 14:57:48 2003
@@ -71,12 +71,13 @@
ifdef SHARED_LIBRARY
# if SHARED_LIBRARY is specified, the default is to build the dynamic lib
all:: dynamic
+install:: install-dynamic
endif
ifdef BYTECODE_LIBRARY
# if BYTECODE_LIBRARY is specified, the default is to build the bytecode lib
all:: bytecodelib
-install:: bytecodelib-install
+install:: install-bytecode-library
endif
# Default Rule: Make sure it's also a :: rule
@@ -116,7 +117,7 @@
# slightly since GNU Make will not try to find implicit rules for targets
# which are marked as Phony.
#
-.PHONY: all dynamic bytecodelib bytecodelib-install
+.PHONY: all dynamic bytecodelib install-bytecode-library
.PHONY: clean distclean install test bytecode prdirs
###########################################################################
@@ -462,23 +463,27 @@
LIBNAME_O := $(DESTLIBRELEASE)/lib$(LIBRARYNAME).so
LIBNAME_P := $(DESTLIBPROFILE)/lib$(LIBRARYNAME).so
LIBNAME_G := $(DESTLIBDEBUG)/lib$(LIBRARYNAME).so
+LIBNAME_CUR := $(DESTLIBCURRENT)/lib$(LIBRARYNAME).so
LIBNAME_AO := $(DESTLIBRELEASE)/lib$(LIBRARYNAME).a
LIBNAME_AP := $(DESTLIBPROFILE)/lib$(LIBRARYNAME).a
LIBNAME_AG := $(DESTLIBDEBUG)/lib$(LIBRARYNAME).a
+LIBNAME_ACUR := $(DESTLIBCURRENT)/lib$(LIBRARYNAME).a
LIBNAME_OBJO := $(DESTLIBRELEASE)/$(LIBRARYNAME).o
LIBNAME_OBJP := $(DESTLIBPROFILE)/$(LIBRARYNAME).o
LIBNAME_OBJG := $(DESTLIBDEBUG)/$(LIBRARYNAME).o
+LIBNAME_OBJCUR := $(DESTLIBCURRENT)/$(LIBRARYNAME).o
LIBNAME_BC := $(DESTLIBBYTECODE)/lib$(LIBRARYNAME).bc
+
#--------------------------------------------------------------------
# Library Targets
# Modify the top level targets to build the desired libraries.
#--------------------------------------------------------------------
# dynamic target builds a shared object version of the library...
-dynamic:: $(DESTLIBCURRENT)/lib$(LIBRARYNAME).so
+dynamic:: $(LIBNAME_CUR)
bytecodelib:: $(LIBNAME_BC)
-bytecodelib-install:: $(LLVMGCCDIR)/bytecode-libs/lib$(LIBRARYNAME).bc
+install-bytecode-library:: $(LLVMGCCDIR)/bytecode-libs/lib$(LIBRARYNAME).bc
$(LLVMGCCDIR)/bytecode-libs/lib$(LIBRARYNAME).bc: $(LIBNAME_BC)
@${ECHO} ======= Installing $(LIBRARYNAME) bytecode library =======
@@ -486,12 +491,14 @@
# Does the library want a .o version built?
ifndef DONT_BUILD_RELINKED
-all:: $(DESTLIBCURRENT)/$(LIBRARYNAME).o
+all:: $(LIBNAME_OBJCUR)
+install:: install-single-object-library
endif
# Does the library want an archive version built?
ifdef BUILD_ARCHIVE
-all:: $(DESTLIBCURRENT)/lib$(LIBRARYNAME).a
+all:: $(LIBNAME_ACUR)
+install:: install-archive-library
endif
#--------------------------------------------------------------------
@@ -536,6 +543,10 @@
$(VERB) $(LIBTOOL) --mode=install $(INSTALL) $*.la $(DESTLIBCURRENT)
@${ECHO} ======= Finished building $(LIBRARYNAME) dynamic debug library =======
+install-dynamic-library: $(LIBNAME_CUR)
+ $(MKDIR) $(libdir)
+ $(VERB) $(LIBTOOL) --mode=install $(INSTALL) $(LIBNAME_CUR) $(libdir)/lib$(LIBRARYNAME).so
+
#
# Rules for building static archive libraries.
#
@@ -557,6 +568,9 @@
$(VERB) $(Link) -g $(STRIP) -o $@ $(ObjectsG) $(LibSubDirs) -static
@${ECHO} ======= Finished building $(LIBRARYNAME) archive debug library =======
+install-archive-library: $(LIBNAME_ACUR)
+ $(MKDIR) $(libdir)
+ $(VERB) $(LIBTOOL) --mode=install $(INSTALL) $(LIBNAME_ACUR) $(libdir)/lib$(LIBRARYNAME).a
#
# Rules for building .o libraries.
@@ -583,6 +597,10 @@
$(LIBNAME_OBJG): $(ObjectsG) $(LibSubDirs) $(DESTLIBDEBUG)/.dir
@${ECHO} "Linking `basename $@`"
$(VERB) $(Relink) -o $@ $(RObjectsG) $(LibSubDirs)
+
+install-single-object-library: $(LIBNAME_OBJCUR)
+ $(MKDIR) $(libdir)
+ $(VERB) $(LIBTOOL) --mode=install $(INSTALL) $(LIBNAME_OBJCUR) $(libdir)/$(LIBRARYNAME).o
endif
More information about the llvm-commits
mailing list