llvm.org GIT mirror llvm / d4076cf
Rewrite makefiles to explicitly reference DESTDIR to fix bug 3153. We need this so can not bake DESTDIR into the O'Caml symlinks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97743 91177308-0d34-0410-b5e6-96231b3b80d8 Erick Tryzelaar 9 years ago
7 changed file(s) with 51 addition(s) and 51 deletion(s). Raw diff Collapse all Expand all
7575
7676 LLVMMAKE := $(LLVM_SRC_ROOT)/make
7777
78 PROJ_bindir := $(DESTDIR)$(PROJ_prefix)/bin
79 PROJ_libdir := $(DESTDIR)$(PROJ_prefix)/lib
80 PROJ_datadir := $(DESTDIR)$(PROJ_prefix)/share
81 PROJ_docsdir := $(DESTDIR)$(PROJ_prefix)/docs/llvm
82 PROJ_etcdir := $(DESTDIR)$(PROJ_prefix)/etc/llvm
83 PROJ_includedir := $(DESTDIR)$(PROJ_prefix)/include
84 PROJ_infodir := $(DESTDIR)$(PROJ_prefix)/info
85 PROJ_mandir := $(DESTDIR)$(PROJ_prefix)/share/man
78 PROJ_bindir := $(PROJ_prefix)/bin
79 PROJ_libdir := $(PROJ_prefix)/lib
80 PROJ_datadir := $(PROJ_prefix)/share
81 PROJ_docsdir := $(PROJ_prefix)/docs/llvm
82 PROJ_etcdir := $(PROJ_prefix)/etc/llvm
83 PROJ_includedir := $(PROJ_prefix)/include
84 PROJ_infodir := $(PROJ_prefix)/info
85 PROJ_mandir := $(PROJ_prefix)/share/man
8686
8787 # Determine if we're on a unix type operating system
8888 LLVM_ON_UNIX:=@LLVM_ON_UNIX@
780780 # in the file so they get built before dependencies
781781 #---------------------------------------------------------
782782
783 $(PROJ_bindir) $(PROJ_libdir) $(PROJ_includedir) $(PROJ_etcdir)::
783 $(DESTDIR)$(PROJ_bindir) $(DESTDIR)$(PROJ_libdir) $(DESTDIR)$(PROJ_includedir) $(DESTDIR)$(PROJ_etcdir)::
784784 $(Verb) $(MKDIR) $@
785785
786786 # To create other directories, as needed, and timestamp their creation
903903 uninstall-local::
904904 $(Echo) UnInstall circumvented with NO_INSTALL
905905 else
906 install-local:: $(PROJ_etcdir) $(CONFIG_FILES)
907 $(Echo) Installing Configuration Files To $(PROJ_etcdir)
906 install-local:: $(DESTDIR)$(PROJ_etcdir) $(CONFIG_FILES)
907 $(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir)
908908 $(Verb)for file in $(CONFIG_FILES); do \
909909 if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
910 $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(PROJ_etcdir) ; \
910 $(DataInstall) $(PROJ_OBJ_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
911911 elif test -f $(PROJ_SRC_DIR)/$${file} ; then \
912 $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(PROJ_etcdir) ; \
912 $(DataInstall) $(PROJ_SRC_DIR)/$${file} $(DESTDIR)$(PROJ_etcdir) ; \
913913 else \
914914 $(ECHO) Error: cannot find config file $${file}. ; \
915915 fi \
916916 done
917917
918918 uninstall-local::
919 $(Echo) Uninstalling Configuration Files From $(PROJ_etcdir)
919 $(Echo) Uninstalling Configuration Files From $(DESTDIR)$(PROJ_etcdir)
920920 $(Verb)for file in $(CONFIG_FILES); do \
921 $(RM) -f $(PROJ_etcdir)/$${file} ; \
921 $(RM) -f $(DESTDIR)$(PROJ_etcdir)/$${file} ; \
922922 done
923923 endif
924924
10101010 ifdef BYTECODE_DESTINATION
10111011 ModuleDestDir := $(BYTECODE_DESTINATION)
10121012 else
1013 ModuleDestDir := $(PROJ_libdir)
1013 ModuleDestDir := $(DESTDIR)$(PROJ_libdir)
10141014 endif
10151015
10161016 ifdef NO_INSTALL
10891089 uninstall-local::
10901090 $(Echo) Uninstall circumvented with NO_INSTALL
10911091 else
1092 DestSharedLib = $(PROJ_libdir)/lib$(LIBRARYNAME)$(SHLIBEXT)
1092 DestSharedLib = $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME)$(SHLIBEXT)
10931093
10941094 install-local:: $(DestSharedLib)
10951095
1096 $(DestSharedLib): $(LibName.SO) $(PROJ_libdir)
1096 $(DestSharedLib): $(LibName.SO) $(DESTDIR)$(PROJ_libdir)
10971097 $(Echo) Installing $(BuildMode) Shared Library $(DestSharedLib)
10981098 $(Verb) $(INSTALL) $(LibName.SO) $(DestSharedLib)
10991099
11001100 uninstall-local::
11011101 $(Echo) Uninstalling $(BuildMode) Shared Library $(DestSharedLib)
1102 -$(Verb) $(RM) -f $(PROJ_libdir)/lib$(LIBRARYNAME).*
1102 -$(Verb) $(RM) -f $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).*
11031103 endif
11041104 endif
11051105
11431143 ifdef BYTECODE_DESTINATION
11441144 BytecodeDestDir := $(BYTECODE_DESTINATION)
11451145 else
1146 BytecodeDestDir := $(PROJ_libdir)
1146 BytecodeDestDir := $(DESTDIR)$(PROJ_libdir)
11471147 endif
11481148
11491149 DestBytecodeLib = $(BytecodeDestDir)/lib$(LIBRARYNAME).bca
12081208 uninstall-local::
12091209 $(Echo) Uninstall circumvented with NO_INSTALL
12101210 else
1211 DestArchiveLib := $(PROJ_libdir)/lib$(LIBRARYNAME).a
1211 DestArchiveLib := $(DESTDIR)$(PROJ_libdir)/lib$(LIBRARYNAME).a
12121212
12131213 install-local:: $(DestArchiveLib)
12141214
1215 $(DestArchiveLib): $(LibName.A) $(PROJ_libdir)
1215 $(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir)
12161216 $(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
1217 $(Verb) $(MKDIR) $(PROJ_libdir)
1217 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir)
12181218 $(Verb) $(INSTALL) $(LibName.A) $(DestArchiveLib)
12191219
12201220 uninstall-local::
13141314 uninstall-local::
13151315 $(Echo) Uninstall circumvented with NO_INSTALL
13161316 else
1317 DestTool = $(PROJ_bindir)/$(TOOLEXENAME)
1317 DestTool = $(DESTDIR)$(PROJ_bindir)/$(TOOLEXENAME)
13181318
13191319 install-local:: $(DestTool)
13201320
1321 $(DestTool): $(ToolBuildPath) $(PROJ_bindir)
1321 $(DestTool): $(ToolBuildPath) $(DESTDIR)$(PROJ_bindir)
13221322 $(Echo) Installing $(BuildMode) $(DestTool)
13231323 $(Verb) $(ProgInstall) $(ToolBuildPath) $(DestTool)
13241324
19631963 else
19641964 install-local::
19651965 $(Echo) Installing include files
1966 $(Verb) $(MKDIR) $(PROJ_includedir)
1966 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_includedir)
19671967 $(Verb) if test -d "$(PROJ_SRC_ROOT)/include" ; then \
19681968 cd $(PROJ_SRC_ROOT)/include && \
19691969 for hdr in `find . -type f '!' '(' -name '*~' \
19701970 -o -name '.#*' -o -name '*.in' ')' -print | grep -v CVS | \
19711971 grep -v .svn` ; do \
1972 instdir=`dirname "$(PROJ_includedir)/$$hdr"` ; \
1972 instdir=`dirname "$(DESTDIR)$(PROJ_includedir)/$$hdr"` ; \
19731973 if test \! -d "$$instdir" ; then \
19741974 $(EchoCmd) Making install directory $$instdir ; \
19751975 $(MKDIR) $$instdir ;\
19761976 fi ; \
1977 $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \
1977 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
19781978 done ; \
19791979 fi
19801980 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
19811981 $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
19821982 cd $(PROJ_OBJ_ROOT)/include && \
19831983 for hdr in `find . -type f -print | grep -v CVS` ; do \
1984 $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \
1984 $(DataInstall) $$hdr $(DESTDIR)$(PROJ_includedir)/$$hdr ; \
19851985 done ; \
19861986 fi
19871987 endif
19931993 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f \
19941994 '!' '(' -name '*~' -o -name '.#*' \
19951995 -o -name '*.in' ')' -print ')' | \
1996 grep -v CVS | sed 's#^#$(PROJ_includedir)/#'` ; \
1996 grep -v CVS | sed 's#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
19971997 cd $(PROJ_SRC_ROOT)/include && \
19981998 $(RM) -f `find . -path '*/Internal' -prune -o '(' -type f -name '*.in' \
1999 -print ')' | sed 's#\.in$$##;s#^#$(PROJ_includedir)/#'` ; \
1999 -print ')' | sed 's#\.in$$##;s#^#$(DESTDIR)$(PROJ_includedir)/#'` ; \
20002000 fi
20012001 endif
20022002 endif
7676 clean-local::
7777 $(Verb) $(RM) -f pod2htm*.*~~ $(HTML) $(MAN) $(PS)
7878
79 HTML_DIR := $(PROJ_docsdir)/html/CommandGuide
80 MAN_DIR := $(PROJ_mandir)/man1
81 PS_DIR := $(PROJ_docsdir)/ps
79 HTML_DIR := $(DESTDIR)$(PROJ_docsdir)/html/CommandGuide
80 MAN_DIR := $(DESTDIR)$(PROJ_mandir)/man1
81 PS_DIR := $(DESTDIR)$(PROJ_docsdir)/ps
8282
8383 install-local:: $(HTML) $(INSTALL_MANS) $(PS)
8484 $(Echo) Installing HTML CommandGuide Documentation
4747
4848 install-html: $(PROJ_OBJ_DIR)/html.tar.gz
4949 $(Echo) Installing HTML documentation
50 $(Verb) $(MKDIR) $(PROJ_docsdir)/html
51 $(Verb) $(MKDIR) $(PROJ_docsdir)/html/img
52 $(Verb) $(DataInstall) $(HTML) $(PROJ_docsdir)/html
53 $(Verb) $(DataInstall) $(IMAGES) $(PROJ_docsdir)/html/img
54 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(PROJ_docsdir)
50 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html
51 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/img
52 $(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html
53 $(Verb) $(DataInstall) $(IMAGES) $(DESTDIR)$(PROJ_docsdir)/html/img
54 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir)
5555
5656 $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML)
5757 $(Echo) Packaging HTML documentation
6262
6363 install-doxygen: doxygen
6464 $(Echo) Installing doxygen documentation
65 $(Verb) $(MKDIR) $(PROJ_docsdir)/html/doxygen
66 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_docsdir)
65 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/doxygen
66 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir)
6767 $(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \
6868 $(FIND) . -type f -exec \
69 $(DataInstall) {} $(PROJ_docsdir)/html/doxygen \;
69 $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/html/doxygen \;
7070
7171 doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
7272
9393
9494 install-ocamldoc: ocamldoc
9595 $(Echo) Installing ocamldoc documentation
96 $(Verb) $(MKDIR) $(PROJ_docsdir)/ocamldoc/html
97 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(PROJ_docsdir)
96 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html
97 $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(DESTDIR)$(PROJ_docsdir)
9898 $(Verb) cd $(PROJ_OBJ_DIR)/ocamldoc && \
9999 $(FIND) . -type f -exec \
100 $(DataInstall) {} $(PROJ_docsdir)/ocamldoc/html \;
100 $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html \;
101101
102102 ocamldoc: regen-ocamldoc
103103 $(Echo) Packaging ocamldoc documentation
119119
120120 uninstall-local::
121121 $(Echo) Uninstalling Documentation
122 $(Verb) $(RM) -rf $(PROJ_docsdir)
122 $(Verb) $(RM) -rf $(DESTDIR)$(PROJ_docsdir)
1111
1212 HTML := $(wildcard $(PROJ_SRC_DIR)/*.html)
1313 EXTRA_DIST := $(HTML) index.html
14 HTML_DIR := $(PROJ_docsdir)/html/tutorial
14 HTML_DIR := $(DESTDIR)$(PROJ_docsdir)/html/tutorial
1515
1616 install-local:: $(HTML)
1717 $(Echo) Installing HTML Tutorial Documentation
2929 changed significantly. )
3030
3131 install-local:: $(GENFILE)
32 $(Echo) Installing $(PROJ_includedir)/llvm/Intrinsics.gen
33 $(Verb) $(DataInstall) $(GENFILE) $(PROJ_includedir)/llvm/Intrinsics.gen
32 $(Echo) Installing $(DESTDIR)$(PROJ_includedir)/llvm/Intrinsics.gen
33 $(Verb) $(DataInstall) $(GENFILE) $(DESTDIR)$(PROJ_includedir)/llvm/Intrinsics.gen
125125 $(LibDeps) GenLibDeps.out
126126 install-local:: all-local
127127 $(Echo) Installing llvm-config
128 $(Verb) $(MKDIR) $(PROJ_bindir)
129 $(Verb) $(ScriptInstall) $(ToolDir)/llvm-config $(PROJ_bindir)
128 $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_bindir)
129 $(Verb) $(ScriptInstall) $(ToolDir)/llvm-config $(DESTDIR)$(PROJ_bindir)
130130