[llvm-branch-commits] [cfe-branch] r100096 - in /cfe/branches/Apple/whitney-IB: GNUSource.make Makefile

Daniel Dunbar daniel at zuster.org
Thu Apr 1 00:17:06 PDT 2010


Author: ddunbar
Date: Thu Apr  1 02:17:06 2010
New Revision: 100096

URL: http://llvm.org/viewvc/llvm-project?rev=100096&view=rev
Log:
Eliminate unused abstraction in Apple style build, this was totally overkill for
how we build Clang.

Removed:
    cfe/branches/Apple/whitney-IB/GNUSource.make
Modified:
    cfe/branches/Apple/whitney-IB/Makefile

Removed: cfe/branches/Apple/whitney-IB/GNUSource.make
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/GNUSource.make?rev=100095&view=auto
==============================================================================
--- cfe/branches/Apple/whitney-IB/GNUSource.make (original)
+++ cfe/branches/Apple/whitney-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/whitney-IB/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/Makefile?rev=100096&r1=100095&r2=100096&view=diff
==============================================================================
--- cfe/branches/Apple/whitney-IB/Makefile (original)
+++ cfe/branches/Apple/whitney-IB/Makefile Thu Apr  1 02:17:06 2010
@@ -4,8 +4,6 @@
 
 # Project info
 Project                := clang
-UserType               := Developer
-ToolType               := Commands
 
 # LLVM/Clang default configuration.
 
@@ -13,6 +11,10 @@
 Clang_Use_Assertions   := 1
 # 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
 
 ##
 
@@ -45,9 +47,9 @@
 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
@@ -56,58 +58,36 @@
 Extra_Configure_Flags = --enable-targets=x86,arm \
 			--enable-optimized \
 			$(Assertions_Configure_Flag) \
-			--with-extra-options='-g -DDISABLE_SMART_POINTERS' \
-			--disable-doxygen \
-			$(HOST_TARGET_FLAGS)
+                        --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++
-
 Install_Target = $(Clang_Make_Variables) install-clang
 Build_Target = $(Clang_Make_Variables) clang-only
 
-# Extract the source.
-install_source::
-
-# Available post install targets.
-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 ../../$(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/
+# Set default target.
 
-OSV = $(DSTROOT)/usr/local/OpenSourceVersions
-OSL = $(DSTROOT)/usr/local/OpenSourceLicenses
+all: install
 
-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')
@@ -149,36 +129,134 @@
 	  echo Usage: make VERSION=25 retag-clang; \
 	fi
 
-build-and-test: fast-build
+##
+# Check that expected RC variables are set and sane.
+
+ifneq (OK, $(shell test -d $(SRCROOT) && echo "OK"))
+  $(error "invalid SRCROOT: '$(SRCROOT)'")
+endif
+
+ifeq ($(RC_ARCHS),)
+  $(error "RC_ARCHS must be set")
+endif
+ifeq ($(OBJROOT),)
+  $(error "OBJROOT must be set")
+endif
+ifeq ($(SYMROOT),)
+  $(error "SYMROOT must be set")
+endif
+ifeq ($(DSTROOT),)
+  $(error "DSTROOT must be set")
+endif
+
+##
+# Additional Tool Paths
 
-SUDO := sudo
+CHOWN		= /usr/sbin/chown
+CXX             = /usr/bin/g++
+FIND		= /usr/bin/find
+INSTALL		= /usr/bin/install
+INSTALL_FILE	= $(INSTALL) -m $(Install_File_Mode)
+MKDIR		= /bin/mkdir -p -m 0755
+PAX		= /bin/pax
+RMDIR		= /bin/rm -fr
+XARGS		= /usr/bin/xargs
 
-fast-build:
-	svn up .
-	cd .. && BUILDIT_DIR=`pwd`/build $(SUDO) /usr/local/bin/buildit -arch i386 -arch x86_64 -noinstallsrc -noinstallhdrs -nosum -noverify `pwd`/clang -noclean
-
-slow-build:
-	cd .. && BUILDIT_DIR=`pwd`/build $(SUDO) /usr/local/bin/buildit -arch i386 -arch x86_64 `pwd`/clang
-
-install-check-i386: llvm-binaries-i386
-	cd ../build/clang.roots/clang~obj/i386/tools/clang && { CLANG=/Developer/usr/bin/clang $(SUDO) make VERBOSE=0 test && echo PASS: $@ || { echo FAIL: $@; make report; } }
-install-check-x86_64: llvm-binaries-x86_64
-	cd ../build/clang.roots/clang~obj/x86_64/tools/clang && { CLANG=/Developer/usr/bin/clang $(SUDO) make VERBOSE=0 test && echo PASS: $@ || { echo FAIL: $@; make report; } }
-
-check: llvm-binaries-i386 llvm-binaries-x86_64 check-i386 check-x86_64 unittests-i386 unittests-x86_64 clang-i386 clang-x86_64
-llvm-binaries-i386:
-	cd ../build/clang.roots/clang~obj/i386 && $(SUDO) make DESTDIR=`pwd`/../../../llvm-i386 install
-llvm-binaries-x86_64:
-	cd ../build/clang.roots/clang~obj/x86_64 && $(SUDO) make DESTDIR=`pwd`/../../../llvm-x86_64 install
-check-i386: llvm-binaries-i386
-	cd ../build/clang.roots/clang~obj/i386 && $(SUDO) make check && echo PASS: $@ || echo FAIL: $@
-check-x86_64: llvm-binaries-x86_64
-	cd ../build/clang.roots/clang~obj/x86_64 && $(SUDO) make check && echo PASS: $@ || echo FAIL: $@
-unittests-i386: llvm-binaries-i386
-	cd ../build/clang.roots/clang~obj/i386 && $(SUDO) make unittests && echo PASS: $@ || echo FAIL: $@
-unittests-x86_64: llvm-binaries-x86_64
-	cd ../build/clang.roots/clang~obj/x86_64 && $(SUDO) make unittests && echo PASS: $@ || echo FAIL: $@
-clang-i386: llvm-binaries-i386
-	pwd=`pwd`; cd ../build/clang.roots/clang~obj/i386/tools/clang && { CLANG=$$pwd/../build/llvm-i386/Developer/usr/bin/clang $(SUDO) make VERBOSE=0 test && echo PASS: $@ || { echo FAIL: $@; make report; } }
-clang-x86_64: llvm-binaries-x86_64
-	pwd=`pwd`; cd ../build/clang.roots/clang~obj/x86_64/tools/clang && { CLANG=$$pwd/../build/llvm-x86_64/Developer/usr/bin/clang $(SUDO) make VERBOSE=0 test && echo PASS: $@ || { echo FAIL: $@; make report; } }
+## 
+# 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
+Environment	= CC="$(CC) -arch $$arch" CXX="$(CXX) -arch $$arch" ONLY_MAN_DOCS=1
+Configure_Flags = --prefix="$(Install_Prefix)" $(Extra_Configure_Flags)
+Install_Flags	= DESTDIR=$(OBJROOT)/install-$$arch
+
+OSV		= $(DSTROOT)/usr/local/OpenSourceVersions
+OSL		= $(DSTROOT)/usr/local/OpenSourceLicenses
+
+##
+# Build Logic
+
+.PHONY: install installsrc installhdrs build configure 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 $(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 $(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:: configure
+	$(_v) for arch in $(RC_ARCHS) ; do \
+		echo "Building $(Project) for $$arch..." && \
+		$(MAKE) -j$(SYSCTL) -C $(OBJROOT)/$$arch $(Environment) $(Build_Target) || exit 1; \
+	done
+
+configure:: lazy_install_source
+	$(_v) $(MKDIR) $(OBJROOT)
+	$(_v) for arch in $(RC_ARCHS) ; do \
+		echo "Configuring $(Project) for $$arch..." && \
+		$(MKDIR) $(OBJROOT)/$$arch && \
+		cd $(OBJROOT)/$$arch && \
+		$(Environment) $(Configure) $(Configure_Flags) || 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 ../../$(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