[llvm-branch-commits] [cfe-branch] r102522 - in /cfe/branches/Apple/williamson-IB: GNUSource.make Makefile
Daniel Dunbar
daniel at zuster.org
Wed Apr 28 13:23:16 PDT 2010
Author: ddunbar
Date: Wed Apr 28 15:23:16 2010
New Revision: 102522
URL: http://llvm.org/viewvc/llvm-project?rev=102522&view=rev
Log:
Merge with upstream Apple style Makefiles.
Removed:
cfe/branches/Apple/williamson-IB/GNUSource.make
Modified:
cfe/branches/Apple/williamson-IB/Makefile
Removed: cfe/branches/Apple/williamson-IB/GNUSource.make
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/williamson-IB/GNUSource.make?rev=102521&view=auto
==============================================================================
--- cfe/branches/Apple/williamson-IB/GNUSource.make (original)
+++ cfe/branches/Apple/williamson-IB/GNUSource.make (removed)
@@ -1,190 +0,0 @@
-##
-# Makefile for Apple Release Control (GNU source projects)
-#
-# Wilfredo Sanchez | wsanchez at apple.com
-# Copyright (c) 1997-1999 Apple Computer, Inc.
-#
-# @APPLE_LICENSE_HEADER_START@
-#
-# Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
-# Reserved. This file contains Original Code and/or Modifications of
-# Original Code as defined in and that are subject to the Apple Public
-# Source License Version 1.1 (the "License"). You may not use this file
-# except in compliance with the License. Please obtain a copy of the
-# License at http://www.apple.com/publicsource and read it before using
-# this file.
-#
-# The Original Code and all software distributed under the License are
-# distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
-# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
-# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
-# License for the specific language governing rights and limitations
-# under the License.
-#
-# @APPLE_LICENSE_HEADER_END@
-##
-# Set these variables as needed, then include this file, then:
-#
-# Install_Prefix [ $(USRDIR) ]
-# Install_Man [ $(MANDIR) ]
-# Install_Info [ $(SHAREDIR)/info ]
-# Install_HTML [ <depends> ]
-# Install_Source [ $(NSSOURCEDIR)/Commands/$(ProjectName) ]
-# Configure [ $(Sources)/configure ]
-# Extra_Configure_Flags
-# Extra_Install_Flags
-# Passed_Targets [ ]
-#
-# Additional variables inherited from ReleaseControl/Common.make
-##
-
-ifndef CoreOSMakefiles
-CoreOSMakefiles = $(MAKEFILEPATH)/CoreOS
-endif
-
-include $(CoreOSMakefiles)/ReleaseControl/Common.make
-
-##
-# My variables
-##
-
-Sources = $(SRCROOT)/$(Project)
-ConfigStamp = $(BuildDirectory)/configure-stamp
-
-Workaround_3678855 = /BogusHTMLInstallationDir
-
-ifndef Install_Prefix
-Install_Prefix = $(USRDIR)
-endif
-ifndef Install_Man
-Install_Man = $(MANDIR)
-endif
-ifndef Install_Info
-Install_Info = $(SHAREDIR)/info
-endif
-ifndef Install_HTML
-ifeq "$(UserType)" "Developer"
-Install_HTML = $(Workaround_3678855)
-else
-Install_HTML = $(NSDOCUMENTATIONDIR)/$(ToolType)/$(ProjectName)
-endif
-endif
-ifndef Install_Source
-Install_Source = $(NSSOURCEDIR)/$(ToolType)/$(ProjectName)
-endif
-
-RC_Install_Prefix = $(DSTROOT)$(Install_Prefix)
-RC_Install_Man = $(DSTROOT)$(Install_Man)
-RC_Install_Info = $(DSTROOT)$(Install_Info)
-RC_Install_HTML = $(DSTROOT)$(Install_HTML)
-ifneq ($(Install_Source),)
-RC_Install_Source = $(DSTROOT)$(Install_Source)
-endif
-
-ifndef Configure
-Configure = $(Sources)/configure
-endif
-
-Environment = CC="$(CC) -arch $$arch" CXX="$(CXX) -arch $$arch" ONLY_MAN_DOCS=1
-
-CC_Archs = # set by CC
-# FIXME: Common.make shouldn't be setting this in the first place.
-Extra_CC_Flags =
-
-# -arch arguments are different than configure arguments. We need to
-# translate them.
-
-TRANSLATE_ARCH=$(SED) -e s/ppc/powerpc/ -e s/i386/i686/
-# Could use config.guess here, if we had a copy available.
-BUILD=`$(ARCH) | $(TRANSLATE_ARCH)`-apple-darwin
-
-Configure_Flags = --prefix="$(Install_Prefix)" \
- $(Extra_Configure_Flags) \
- `case $$arch in x86_64) echo --build=x86_64-apple-darwin$$(uname -r | sed 's/\..*//');; esac`
-
-Install_Flags = DESTDIR=$(BuildDirectory)/install-$$arch \
- $(Extra_Install_Flags)
-
-Install_Target = install-strip
-
-##
-# Targets
-##
-
-.PHONY: configure almostclean
-
-SYSCTL := $(shell if [ `sysctl -n hw.activecpu` -ge 8 -a `sysctl -n hw.memsize` -le 2147483648 ]; then echo 4; else sysctl -n hw.activecpu; fi)
-
-install:: build
-ifneq ($(GnuNoInstall),YES)
- $(_v) for arch in $(RC_ARCHS) ; do \
- echo "Installing $(Project) for $$arch..." && \
- $(MKDIR) $(BuildDirectory)/install-$$arch && \
- umask $(Install_Mask) && \
- $(MAKE) -C $(BuildDirectory)/$$arch $(Environment) \
- $(Install_Flags) $(Install_Target) || exit 1 ; \
- done
- $(_v) rm -rf $(DSTROOT)
- $(_v) mkdir -p $(DSTROOT)
- $(_v) for arch in $(filter-out $(firstword $(RC_ARCHS)),$(RC_ARCHS)); do \
- rm -rf $(BuildDirectory)/install-$$arch$(Install_Prefix)/lib/clang/*/lib; \
- done
- ./merge-lipo `for arch in $(RC_ARCHS) ; do echo $(BuildDirectory)/install-$$arch ; done` $(DSTROOT)
- $(_v) $(FIND) $(DSTROOT) $(Find_Cruft) | $(XARGS) $(RMDIR)
- $(_v) $(FIND) $(SYMROOT) $(Find_Cruft) | $(XARGS) $(RMDIR)
- $(_v) $(FIND) $(DSTROOT) -perm -0111 ! -name ccc -type f -print | $(XARGS) -n 1 -P $(SYSCTL) dsymutil
- $(_v) cd $(DSTROOT) && find . -path \*.dSYM/\* -print | cpio -pdml $(SYMROOT)
- $(_v) find $(DSTROOT) -perm -0111 ! -name ccc -type f -print | xargs -P $(SYSCTL) strip
- $(_v) find $(DSTROOT) -name \*.dSYM -print | xargs rm -r
-ifneq ($(GnuNoChown),YES)
- $(_v)- $(CHOWN) -R $(Install_User):$(Install_Group) $(DSTROOT) $(SYMROOT)
-endif
-endif
-ifdef GnuAfterInstall
- $(_v) $(MAKE) $(GnuAfterInstall)
-endif
- $(_v) if [ -d "$(DSTROOT)$(Workaround_3678855)" ]; then \
- $(INSTALL_DIRECTORY) "$(DSTROOT)$(SYSTEM_DEVELOPER_TOOLS_DOC_DIR)"; \
- $(MV) "$(DSTROOT)$(Workaround_3678855)" \
- "$(DSTROOT)$(SYSTEM_DEVELOPER_TOOLS_DOC_DIR)/$(ProjectName)"; \
- fi
-
-build:: configure
-ifneq ($(GnuNoBuild),YES)
- $(_v) for arch in $(RC_ARCHS) ; do \
- echo "Building $(Project) for $$arch..." && \
- $(MAKE) -j$(SYSCTL) -C $(BuildDirectory)/$$arch $(Environment) $(Build_Target) || exit 1; \
- done
-endif
-
-configure:: lazy_install_source $(ConfigStamp)
-
-reconfigure::
- $(_v) $(RM) $(ConfigStamp)
- $(_v) $(MAKE) configure
-
-$(ConfigStamp):
-ifneq ($(GnuNoConfigure),YES)
- $(_v) $(MKDIR) $(BuildDirectory)
- $(_v) for arch in $(RC_ARCHS) ; do \
- echo "Configuring $(Project) for $$arch..." && \
- $(MKDIR) $(BuildDirectory)/$$arch && \
- cd $(BuildDirectory)/$$arch && \
- $(Environment) $(Configure) $(Configure_Flags) || exit 1 ; \
- done
-endif
- $(_v) touch $@
-
-clean::
- if [ "$(SRCROOT)" != . ]; then \
- rm -rf "$(SRCROOT)/clang/test/Archive"; \
- fi
-
-almostclean::
-ifneq ($(GnuNoClean),YES)
- @echo "Cleaning $(Project)..."
- $(_v) for arch in $(RC_ARCHS) ; do \
- $(MAKE) -C $(BuildDirectory)/$$arch clean || exit 1 ; \
- done
-endif
Modified: cfe/branches/Apple/williamson-IB/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/williamson-IB/Makefile?rev=102522&r1=102521&r2=102522&view=diff
==============================================================================
--- cfe/branches/Apple/williamson-IB/Makefile (original)
+++ cfe/branches/Apple/williamson-IB/Makefile Wed Apr 28 15:23:16 2010
@@ -4,8 +4,6 @@
# Project info
Project := clang
-UserType := Developer
-ToolType := Commands
# LLVM/Clang default configuration.
@@ -13,8 +11,14 @@
Clang_Use_Assertions := 0
# Select clang driver mode, valid values are 'Production' and 'Development'.
Clang_Driver_Mode := Production
+# Select optimization flags to use.
+Clang_Optimize_Option := -O2
+# Additional arbitrary compiler options.
+Clang_Extra_Options := -g -DDISABLE_SMART_POINTERS
# Enable use of clang++?
Clang_Enable_CXX := 0
+# Enable bootstrap build.
+Clang_Enable_Bootstrap := 0
# Build all LLVM tools; not just clang?
Clang_Build_All := 0
@@ -41,8 +45,8 @@
# Set makefile variables to pass during build and install.
Clang_Make_Variables := KEEP_SYMBOLS=1 CLANG_VENDOR=Apple
ifeq ($(Clang_Driver_Mode), Production)
-
Clang_Make_Variables += CLANG_IS_PRODUCTION=1
+
ifeq ($(Clang_Enable_CXX), 1)
Clang_Make_Variables += CLANGXX_IS_PRODUCTION=1
else ifeq ($(Clang_Enable_CXX), 0)
@@ -67,93 +71,57 @@
Post_Install_RootLinks := 1
Post_Install_OpenSourceLicense := 1
endif
-Install_Prefix := $(Install_Root)/usr
-# Set and validate Install_Prefix exists.
+# Set Install_Prefix and validate it exists.
+Install_Prefix := $(Install_Root)/usr
ifneq (OK, $(shell test -d $(Install_Prefix) && echo "OK"))
$(error "invalid install prefix: '$(Install_Prefix)'")
endif
# Set configure flags.
-Extra_Configure_Flags = --enable-targets=x86,arm \
- --enable-optimized \
- $(Assertions_Configure_Flag) \
- --with-extra-options='-g -DDISABLE_SMART_POINTERS' \
- --disable-doxygen \
- $(HOST_TARGET_FLAGS)
+Configure_Flags = --enable-targets=x86,arm \
+ --enable-optimized \
+ $(Assertions_Configure_Flag) \
+ --with-optimize-option="$(Clang_Optimize_Option)" \
+ --with-extra-options="$(Clang_Extra_Options)" \
+ --disable-doxygen
# Set up post install targets.
-GnuAfterInstall := post-install
Post_Install_Targets :=
- # Install /usr/... symlinks?
+
+# Install /usr/... symlinks?
ifeq ($(Post_Install_RootLinks),1)
Post_Install_Targets += post-install-rootlinks
else ifneq ($(Post_Install_RootLinks),0)
$(error "unknown value for post install of root symlinks: '$(Post_Install_RootLinks)'")
endif
- # Install open source license?
+
+# Install open source license?
ifeq ($(Post_Install_OpenSourceLicense),1)
Post_Install_Targets += post-install-opensourcelicense
else ifneq ($(Post_Install_OpenSourceLicense),0)
$(error "unknown value for post install of open source license: '$(Post_Install_OpenSourceLicense)'")
endif
-# It's a GNU Source project
-include ./GNUSource.make
-
-CXX := /usr/bin/g++
-
-# Automatic Extract & Patch
-#AEP = YES
-#AEP_Project = clang
-#AEP_Version = 090201
-#AEP_ProjVers = $(AEP_Project)-$(AEP_Version)
-#AEP_Filename = $(AEP_ProjVers).tar.bz2
-#AEP_ExtractDir = $(AEP_ProjVers)
-#AEP_Patches =
-
-ifeq ($(suffix $(AEP_Filename)),.bz2)
-AEP_ExtractOption = j
+# Select final configure target.
+ifeq ($(Clang_Enable_Bootstrap), 1)
+Final_Configure_Target := configure_stage2
+else ifeq ($(Clang_Enable_Bootstrap), 0)
+Final_Configure_Target := configure_singlestage
else
-AEP_ExtractOption = z
+$(error "invalid setting for clang enable bootstrap: '$(Clang_Enable_Bootstrap)'")
endif
+# Set install and build targets.
Install_Target = $(Clang_Make_Variables) install-clang
Build_Target = $(Clang_Make_Variables) $(Clang_Build_Target)
-# Extract the source.
-install_source::
-ifeq ($(AEP),YES)
- $(TAR) -C $(SRCROOT) -$(AEP_ExtractOption)xf $(SRCROOT)/$(AEP_Filename)
- $(RMDIR) $(SRCROOT)/$(Project)
- $(MV) $(SRCROOT)/$(AEP_ExtractDir) $(SRCROOT)/$(Project)
- for patchfile in $(AEP_Patches); do \
- cd $(SRCROOT)/$(Project) && \
- patch -p0 < $(SRCROOT)/patches/$$patchfile || exit 1 ; \
- done
-endif
+# Set default target.
-# Available post install targets.
-post-install: $(Post_Install_Targets)
+all: install
-post-install-rootlinks:
- $(MKDIR) -p $(DSTROOT)/usr/bin
- ln -sf ../../$(Install_Prefix)/bin/clang $(DSTROOT)/usr/bin/clang
- if [ -f ../../$(Install_Prefix)/bin/clang++ ]; then \
- ln -sf ../../$(Install_Prefix)/bin/clang++ $(DSTROOT)/usr/bin/clang++; \
- fi
- $(MKDIR) -p $(DSTROOT)/usr/share/man/man1/
- cp $(DSTROOT)/$(Install_Prefix)/share/man/man1/clang.1 $(DSTROOT)/usr/share/man/man1/
-
-OSV = $(DSTROOT)/usr/local/OpenSourceVersions
-OSL = $(DSTROOT)/usr/local/OpenSourceLicenses
-
-post-install-opensourcelicense:
- $(MKDIR) $(OSV)
- $(INSTALL_FILE) $(SRCROOT)/$(Project).plist $(OSV)/$(Project).plist
- $(MKDIR) $(OSL)
- $(INSTALL_FILE) $(Sources)/LICENSE.TXT $(OSL)/$(Project)-llvm.txt
- $(INSTALL_FILE) $(Sources)/tools/clang/LICENSE.TXT $(OSL)/$(Project).txt
+###
+# Utility targets for managing the integration branch.
SVN_BASE = $(shell svn info | sed -n 's/^URL: //; s,/llvm-project/.*$$,/llvm-project,p')
SVN_CLANG = $(shell svn info | sed -n 's/^URL: //p')
@@ -180,3 +148,150 @@
else \
echo Usage: make VERSION=25 retag-clang; \
fi
+
+##
+# Additional Tool Paths
+
+CHOWN = /usr/sbin/chown
+CXX = /usr/bin/g++
+FIND = /usr/bin/find
+INSTALL = /usr/bin/install
+INSTALL_FILE = $(INSTALL) -m 0444
+MKDIR = /bin/mkdir -p -m 0755
+PAX = /bin/pax
+RMDIR = /bin/rm -fr
+XARGS = /usr/bin/xargs
+
+##
+# Tool Variables
+
+Cruft = CVS RCS SCCS *~ .*~ .nfs\* .*.wmd .svn .DS_Store
+Find_Cruft = '(' $(Cruft:%=-name '%' -or) -name '' ')' -print
+
+##
+# Assorted variables
+
+Sources = $(SRCROOT)/$(Project)
+Configure = $(Sources)/configure
+Install_Flags = DESTDIR=$(OBJROOT)/install-$$arch ONLY_MAN_DOCS=1
+
+OSV = $(DSTROOT)/usr/local/OpenSourceVersions
+OSL = $(DSTROOT)/usr/local/OpenSourceLicenses
+
+##
+# Build Logic
+
+.PHONY: install installsrc installhdrs \
+ build build_final build_stage1 \
+ configure_final configure_singlestage configure_stage2 configure_stage1 \
+ lazy_install_source install_source clean
+
+SYSCTL := $(shell if [ `sysctl -n hw.activecpu` -ge 8 -a `sysctl -n hw.memsize` -le 2147483648 ]; then echo 4; else sysctl -n hw.activecpu; fi)
+
+installsrc: install_source
+
+installhdrs:
+
+install:: build
+ $(_v) for arch in $(RC_ARCHS) ; do \
+ echo "Installing $(Project) for $$arch..." && \
+ $(MKDIR) $(OBJROOT)/install-$$arch && \
+ umask 0022 && \
+ $(MAKE) -C $(OBJROOT)/$$arch \
+ $(Install_Flags) $(Install_Target) || exit 1 ; \
+ done
+ $(_v) rm -rf $(DSTROOT)
+ $(_v) mkdir -p $(DSTROOT)
+ $(_v) for arch in $(filter-out $(firstword $(RC_ARCHS)),$(RC_ARCHS)); do \
+ rm -rf $(OBJROOT)/install-$$arch$(Install_Prefix)/lib/clang/*/lib; \
+ done
+ ./merge-lipo `for arch in $(RC_ARCHS) ; do echo $(OBJROOT)/install-$$arch ; done` $(DSTROOT)
+ $(_v) $(FIND) $(DSTROOT) $(Find_Cruft) | $(XARGS) $(RMDIR)
+ $(_v) $(FIND) $(SYMROOT) $(Find_Cruft) | $(XARGS) $(RMDIR)
+ $(_v) $(FIND) $(DSTROOT) -perm -0111 ! -name ccc -type f -print | $(XARGS) -n 1 -P $(SYSCTL) dsymutil
+ $(_v) cd $(DSTROOT) && find . -path \*.dSYM/\* -print | cpio -pdml $(SYMROOT)
+ $(_v) find $(DSTROOT) -perm -0111 ! -name ccc -type f -print | xargs -P $(SYSCTL) strip
+ $(_v) find $(DSTROOT) -name \*.dSYM -print | xargs rm -r
+ $(_v)- $(CHOWN) -R root:wheel $(DSTROOT) $(SYMROOT)
+ $(_v) $(MAKE) post-install
+
+build:: build_final
+
+build_final:: configure_final
+ $(_v) for arch in $(RC_ARCHS) ; do \
+ echo "Building (Final) $(Project) for $$arch..." && \
+ $(MAKE) -j$(SYSCTL) -C $(OBJROOT)/$$arch $(Build_Target) || exit 1; \
+ done
+
+build_stage1:: configure_stage1
+ $(_v) for arch in $(RC_ARCHS) ; do \
+ echo "Building (Stage 1) $(Project) for $$arch..." && \
+ $(MAKE) -j$(SYSCTL) -C $(OBJROOT)/stage1-$$arch $(Build_Target) || exit 1; \
+ $(MAKE) -j$(SYSCTL) -C $(OBJROOT)/stage1-$$arch $(Install_Target) || exit 1; \
+ done
+
+configure_final:: $(Final_Configure_Target)
+
+configure_stage2:: build_stage1
+ $(_v) $(MKDIR) $(OBJROOT)
+ $(_v) for arch in $(RC_ARCHS) ; do \
+ echo "Configuring (Final) $(Project) for $$arch..." && \
+ $(MKDIR) $(OBJROOT)/$$arch && \
+ cd $(OBJROOT)/$$arch && \
+ $(Configure) --prefix="$(Install_Prefix)" $(Configure_Flags) \
+ CC="$(OBJROOT)/stage1-install-$$arch/bin/clang -arch $$arch" \
+ CXX="$(OBJROOT)/stage1-install-$$arch/bin/clang++ -arch $$arch" || exit 1 ; \
+ done
+
+configure_singlestage::
+ $(_v) $(MKDIR) $(OBJROOT)
+ $(_v) for arch in $(RC_ARCHS) ; do \
+ echo "Configuring (Final) $(Project) for $$arch..." && \
+ $(MKDIR) $(OBJROOT)/$$arch && \
+ cd $(OBJROOT)/$$arch && \
+ $(Configure) --prefix="$(Install_Prefix)" $(Configure_Flags) \
+ CC="$(CC) -arch $$arch" \
+ CXX="$(CXX) -arch $$arch" || exit 1 ; \
+ done
+
+configure_stage1::
+ $(_v) $(MKDIR) $(OBJROOT)
+ $(_v) for arch in $(RC_ARCHS) ; do \
+ echo "Configuring (Stage 1) $(Project) for $$arch..." && \
+ $(MKDIR) $(OBJROOT)/stage1-$$arch && \
+ cd $(OBJROOT)/stage1-$$arch && \
+ $(Configure) --prefix="$(OBJROOT)/stage1-install-$$arch" $(Configure_Flags) \
+ CC="$(CC) -arch $$arch" CXX="$(CXX) -arch $$arch" || exit 1 ; \
+ done
+
+lazy_install_source::
+ $(_v) if [ ! -f "$(SRCROOT)/Makefile" ]; then $(MAKE) install_source; fi
+
+install_source::
+ @echo "Installing source for $(Project)..."
+ $(_v) $(MKDIR) "$(SRCROOT)"
+ $(_v) $(PAX) -rw . "$(SRCROOT)"
+ $(_v) $(FIND) "$(SRCROOT)" $(Find_Cruft) -depth -exec $(RMDIR) "{}" \;
+
+clean::
+ if [ "$(SRCROOT)" != . ]; then \
+ rm -rf "$(SRCROOT)/clang/test/Archive"; \
+ fi
+
+post-install: $(Post_Install_Targets)
+
+post-install-rootlinks:
+ $(MKDIR) -p $(DSTROOT)/usr/bin
+ ln -sf ../../$(Install_Prefix)/bin/clang $(DSTROOT)/usr/bin/clang
+ if [ -f $(DSTROOT)/$(Install_Prefix)/bin/clang++ ]; then \
+ ln -sf ../../$(Install_Prefix)/bin/clang++ $(DSTROOT)/usr/bin/clang++; \
+ fi
+ $(MKDIR) -p $(DSTROOT)/usr/share/man/man1/
+ cp $(DSTROOT)/$(Install_Prefix)/share/man/man1/clang.1 $(DSTROOT)/usr/share/man/man1/
+
+post-install-opensourcelicense:
+ $(MKDIR) $(OSV)
+ $(INSTALL_FILE) $(SRCROOT)/$(Project).plist $(OSV)/$(Project).plist
+ $(MKDIR) $(OSL)
+ $(INSTALL_FILE) $(Sources)/LICENSE.TXT $(OSL)/$(Project)-llvm.txt
+ $(INSTALL_FILE) $(Sources)/tools/clang/LICENSE.TXT $(OSL)/$(Project).txt
More information about the llvm-branch-commits
mailing list