summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile25
-rw-r--r--make/AppleBI.mk80
-rw-r--r--make/config.mk7
-rw-r--r--make/subdir.mk7
-rw-r--r--make/util.mk6
5 files changed, 59 insertions, 66 deletions
diff --git a/Makefile b/Makefile
index ab1850a12..82efba1a6 100644
--- a/Makefile
+++ b/Makefile
@@ -5,9 +5,8 @@ all::
include make/config.mk
include make/util.mk
-# If SRCROOT is defined, assume we are doing an Apple style build. We
-# should be able to use RC_XBS for this but that is unused during
-# "make installsrc".
+# If SRCROOT is defined, assume we are doing an Apple style build. We should be
+# able to use RC_XBS for this but that is unused during "make installsrc".
ifdef SRCROOT
include make/AppleBI.mk
endif
@@ -75,7 +74,7 @@ clean:: $(ActiveObjPath)/.remove
endef
# Template: CNA_template Config Arch
-#
+#
# This template is used once per Config/Arch at the top-level.
define CNA_template
$(call Set,ActiveConfig,$1)
@@ -84,10 +83,9 @@ $(call Set,ActiveObjPath,$(ProjObjRoot)/$(ActiveConfig)/$(ActiveArch))
$(call Set,ActiveLibGen,$(ActiveObjPath)/libcompiler_rt.Generic.a)
$(call Set,ActiveLibOpt,$(ActiveObjPath)/libcompiler_rt.Optimized.a)
-# Initialize inputs lists. This are extended by the CNA_subdir
-# template. The one tricky bit is that we need to use these quoted,
-# because they are not complete until the entire makefile has been
-# processed.
+# Initialize inputs lists. This are extended by the CNA_subdir template. The one
+# tricky bit is that we need to use these quoted, because they are not complete
+# until the entire makefile has been processed.
$(call Set,GenericInputs.$(ActiveConfig).$(ActiveArch),)
$(call Set,OptimizedInputs.$(ActiveConfig).$(ActiveArch),)
# Final.Inputs is created once we have loaded all the subdirectories
@@ -124,10 +122,10 @@ $(foreach config,$(Configs), \
###
# How to build things.
-# Define rules for building on each configuration & architecture. This
-# is not exactly obvious, but variables inside the template are being
-# expanded during the make processing, so automatic variables must be
-# quoted and normal assignment cannot be used.
+# Define rules for building on each configuration & architecture. This is not
+# exactly obvious, but variables inside the template are being expanded during
+# the make processing, so automatic variables must be quoted and normal
+# assignment cannot be used.
# Template: CNA_template Config Arch Dir
# Uses: GetArgs, Dependencies, ObjNames
@@ -143,8 +141,7 @@ $(call Set,ActiveObjPath,$(ProjObjRoot)/$(ActiveDir)/$(ActiveConfig)/$(ActiveArc
$(call Set,ActiveFlags,$(call GetArgs,$(ActiveConfig),$(ActiveArch)))
$(call Set,ActiveObjects,$(ObjNames:%=$(ActiveObjPath)/%))
-# Add to the input list for the appropriate library and update the
-# dependency.
+# Add to the input list for the appropriate library and update the dependency.
$(call Append,$(Target).Inputs.$(ActiveConfig).$(ActiveArch),$(ActiveObjects))
$(ProjObjRoot)/$(ActiveConfig)/$(ActiveArch)/libcompiler_rt.$(Target).a: $(ActiveObjects)
diff --git a/make/AppleBI.mk b/make/AppleBI.mk
index d77d95a0a..8b4bddd55 100644
--- a/make/AppleBI.mk
+++ b/make/AppleBI.mk
@@ -12,17 +12,16 @@ else
ProjObjRoot := $(ProjSrcRoot)
endif
-# We override this with RC_ARCHS because B&I may want to build on an
-# ARCH we haven't explicitly defined support for. If all goes well,
-# this will just work and the resulting lib will just have generic
-# versions for anything unknown.
+# We override this with RC_ARCHS because B&I may want to build on an ARCH we
+# haven't explicitly defined support for. If all goes well, this will just work
+# and the resulting lib will just have generic versions for anything unknown.
Archs := $(RC_ARCHS)
-# log full compile lines in B&I logs and omit summary lines
-Verb :=
+# Log full compile lines in B&I logs and omit summary lines.
+Verb :=
Summary := @true
-# list of functions needed for each architecture
+# List of functions needed for each architecture.
Funcs_all = absvdi2.o absvsi2.o addvdi3.o addvsi3.o ashldi3.o ashrdi3.o \
clzdi2.o clzsi2.o cmpdi2.o ctzdi2.o ctzsi2.o \
divdc3.o divdi3.o divsc3.o ffsdi2.o \
@@ -32,14 +31,14 @@ Funcs_all = absvdi2.o absvsi2.o addvdi3.o addvsi3.o ashldi3.o ashrdi3.o \
mulsc3.o mulvdi3.o mulvsi3.o negdi2.o negvdi2.o negvsi2.o \
paritydi2.o paritysi2.o popcountdi2.o popcountsi2.o powidf2.o \
powisf2.o subvdi3.o subvsi3.o ucmpdi2.o udivdi3.o \
- udivmoddi4.o umoddi3.o apple_versioning.o eprintf.o
+ udivmoddi4.o umoddi3.o apple_versioning.o eprintf.o
Funcs_i386 = divxc3.o fixunsxfdi.o fixunsxfsi.o fixxfdi.o floatdixf.o \
floatundixf.o mulxc3.o powixf2.o clear_cache.o \
- enable_execute_stack.o
+ enable_execute_stack.o
Funcs_ppc = divtc3.o fixtfdi.o fixunstfdi.o floatditf.o floatunditf.o \
gcc_qadd.o gcc_qdiv.o gcc_qmul.o gcc_qsub.o multc3.o \
powitf2.o restFP.o saveFP.o trampoline_setup.o \
- clear_cache.o enable_execute_stack.o
+ clear_cache.o enable_execute_stack.o
Funcs_x86_64 = absvti2.o addvti3.o ashlti3.o ashrti3.o clzti2.o cmpti2.o \
ctzti2.o divti3.o divxc3.o ffsti2.o fixdfti.o fixsfti.o \
fixunsdfti.o fixunssfti.o fixunsxfdi.o fixunsxfsi.o \
@@ -49,50 +48,49 @@ Funcs_x86_64 = absvti2.o addvti3.o ashlti3.o ashrti3.o clzti2.o cmpti2.o \
mulvti3.o mulxc3.o negti2.o negvti2.o parityti2.o \
popcountti2.o powixf2.o subvti3.o ucmpti2.o udivmodti4.o \
udivti3.o umodti3.o clear_cache.o enable_execute_stack.o
-Funcs_armv6 = adddf3vfp.o addsf3vfp.o bswapdi2.o bswapsi2.o divdf3vfp.o \
- divsf3vfp.o eqdf2vfp.o eqsf2vfp.o extendsfdf2vfp.o \
- fixdfsivfp.o fixsfsivfp.o fixunsdfsivfp.o fixunssfsivfp.o \
- floatsidfvfp.o floatsisfvfp.o floatunssidfvfp.o floatunssisfvfp.o \
- gedf2vfp.o gesf2vfp.o gtdf2vfp.o gtsf2vfp.o \
- ledf2vfp.o lesf2vfp.o ltdf2vfp.o ltsf2vfp.o \
- muldf3vfp.o mulsf3vfp.o \
- nedf2vfp.o negdf2vfp.o negsf2vfp.o nesf2vfp.o \
- subdf3vfp.o subsf3vfp.o truncdfsf2vfp.o unorddf2vfp.o unordsf2vfp.o \
- modsi3.o umodsi3.o udivsi3.o divsi3.o switch.o save_restore_d8_d15.o
+Funcs_armv6 = adddf3vfp.o addsf3vfp.o bswapdi2.o bswapsi2.o divdf3vfp.o \
+ divsf3vfp.o eqdf2vfp.o eqsf2vfp.o extendsfdf2vfp.o \
+ fixdfsivfp.o fixsfsivfp.o fixunsdfsivfp.o fixunssfsivfp.o \
+ floatsidfvfp.o floatsisfvfp.o floatunssidfvfp.o floatunssisfvfp.o \
+ gedf2vfp.o gesf2vfp.o gtdf2vfp.o gtsf2vfp.o \
+ ledf2vfp.o lesf2vfp.o ltdf2vfp.o ltsf2vfp.o \
+ muldf3vfp.o mulsf3vfp.o \
+ nedf2vfp.o negdf2vfp.o negsf2vfp.o nesf2vfp.o \
+ subdf3vfp.o subsf3vfp.o truncdfsf2vfp.o unorddf2vfp.o unordsf2vfp.o \
+ modsi3.o umodsi3.o udivsi3.o divsi3.o switch.o save_restore_d8_d15.o
-# copies any public headers to DSTROOT
+# Copies any public headers to DSTROOT.
installhdrs:
-# copies source code to SRCROOT
+# Copies source code to SRCROOT.
installsrc:
- cp -r . $(SRCROOT)
+ cp -r . $(SRCROOT)
-# copy results to DSTROOT
+# Copy results to DSTROOT.
install: $(SYMROOT)/usr/local/lib/system/libcompiler_rt.a
- mkdir -p $(DSTROOT)/usr/local/lib/system
- cp $(SYMROOT)/usr/local/lib/system/libcompiler_rt.a \
- $(DSTROOT)/usr/local/lib/system/libcompiler_rt.a
- cd $(DSTROOT)/usr/local/lib/system; \
- ln -s libcompiler_rt.a libcompiler_rt_profile.a; \
- ln -s libcompiler_rt.a libcompiler_rt_debug.a
+ mkdir -p $(DSTROOT)/usr/local/lib/system
+ cp $(SYMROOT)/usr/local/lib/system/libcompiler_rt.a \
+ $(DSTROOT)/usr/local/lib/system/libcompiler_rt.a
+ cd $(DSTROOT)/usr/local/lib/system; \
+ ln -s libcompiler_rt.a libcompiler_rt_profile.a; \
+ ln -s libcompiler_rt.a libcompiler_rt_debug.a
-# rule to make fat libcompiler_rt.a
+# Rule to make fat libcompiler_rt.a.
$(SYMROOT)/usr/local/lib/system/libcompiler_rt.a : $(foreach arch,$(Archs), \
$(OBJROOT)/$(arch)-pruned.a)
- mkdir -p $(SYMROOT)/usr/local/lib/system
- lipo -create $^ -o $@
+ mkdir -p $(SYMROOT)/usr/local/lib/system
+ lipo -create $^ -o $@
-# rule to make filter each architecture of libcompiler_rt.a
-# adds project info so that "what /usr/lib/libSystem.B.dylib" will work
+# Rule to add project info so that "what /usr/lib/libSystem.B.dylib" will work.
$(OBJROOT)/%-pruned.a : $(OBJROOT)/Release/%/libcompiler_rt.Optimized.a
- mkdir -p $(OBJROOT)/$*.tmp
- cd $(OBJROOT)/$*.tmp; \
- /Developer/Makefiles/bin/version.pl $(RC_ProjectName) > $(OBJROOT)/version.c; \
- gcc -arch $* -c ${OBJROOT}/version.c -o version.o; \
- ar -x $< $(Funcs_all) $(Funcs_$*); \
- libtool -static *.o -o $@
+ mkdir -p $(OBJROOT)/$*.tmp
+ cd $(OBJROOT)/$*.tmp; \
+ /Developer/Makefiles/bin/version.pl $(RC_ProjectName) > $(OBJROOT)/version.c; \
+ gcc -arch $* -c ${OBJROOT}/version.c -o version.o; \
+ ar -x $< $(Funcs_all) $(Funcs_$*); \
+ libtool -static *.o -o $@
diff --git a/make/config.mk b/make/config.mk
index 43716af58..f0663aa7f 100644
--- a/make/config.mk
+++ b/make/config.mk
@@ -3,9 +3,8 @@
OS := $(shell uname)
-# Assume make is always run from top-level of source directory. Note
-# than an Apple style build overrides these variables later in the
-# makefile.
+# Assume make is always run from top-level of source directory. Note than an
+# Apple style build overrides these variables later in the makefile.
ProjSrcRoot := $(shell pwd)
ProjObjRoot := $(ProjSrcRoot)
@@ -73,7 +72,7 @@ CP := cp
ifndef VERBOSE
Verb := @
else
- Verb :=
+ Verb :=
endif
Echo := @echo
diff --git a/make/subdir.mk b/make/subdir.mk
index f3a9d52cb..1fe427336 100644
--- a/make/subdir.mk
+++ b/make/subdir.mk
@@ -1,5 +1,4 @@
-# This file is intended to be included from each subdirectory
-# makefile.
+# This file is intended to be included from each subdirectory makefile.
ifeq ($(Dir),)
$(error "No Dir variable defined.")
@@ -10,6 +9,7 @@ ifeq ($(DebugMake),1)
endif
# Expand template for each configuration and architecture.
+#
# FIXME: This level of logic should be in primary Makefile?
ifeq ($(OnlyConfigs),)
ConfigsToTraverse := $(Configs)
@@ -35,8 +35,7 @@ $(foreach config,$(ConfigsToTraverse), \
###
# Include child makefile fragments
-# Evaluate this now so we do not have to worry about order of
-# evaluation.
+# Evaluate this now so we do not have to worry about order of evaluation.
SubDirsList := $(SubDirs:%=$(Dir)/%)
ifeq ($(SubDirsList),)
else
diff --git a/make/util.mk b/make/util.mk
index 4c08fe4b7..4f6579084 100644
--- a/make/util.mk
+++ b/make/util.mk
@@ -22,8 +22,8 @@ Append = $(eval $(1) += $(2))
###
# Debugging
-# General debugging rule, use 'make print-XXX' to print the
-# definition, value and origin of XXX.
-print-%:
+# General debugging rule, use 'make print-XXX' to print the definition, value
+# and origin of XXX.
+make-print-%:
$(error PRINT: $(value $*) = "$($*)" (from $(origin $*)))