]> git.saurik.com Git - apple/coreosmakefiles.git/commitdiff
CoreOSMakefiles-52.tar.gz mac-os-x-1056 mac-os-x-1057 mac-os-x-1058 v52
authorApple <opensource@apple.com>
Wed, 23 Apr 2008 00:10:42 +0000 (00:10 +0000)
committerApple <opensource@apple.com>
Wed, 23 Apr 2008 00:10:42 +0000 (00:10 +0000)
ReleaseControl/BSDCommon.make
ReleaseControl/Common.make
ReleaseControl/GNUSource.make
Standard/Variables.make
bin/compress-man-pages.pl

index d1af115a51317f46d76537a14f515914eee327d9..af2989a973d89914aafd33fb6ef829ed833387e9 100644 (file)
@@ -30,6 +30,9 @@ include $(MAKEFILEPATH)/CoreOS/ReleaseControl/Common.make
 ###           ###
 
 Library_Prefix ?= lib
+RELEASE_Library_Suffix = $(Library_Suffix)
+DEBUG_Library_Suffix = _debug$(Library_Suffix)
+PROFILE_Library_Suffix = _profile$(Library_Suffix)
 
 ProductType ?= tool
 ifeq ($(ProductType),tool)
@@ -38,20 +41,40 @@ ifeq ($(ProductType),tool)
 else
  ifeq ($(ProductType),dylib)
     Library_Suffix ?= .dylib
-    ProductName ?= $(Library_Prefix)$(Project)$(if $(Library_Version),.$(Library_Version),)$(Library_Suffix)
-    ProductNameNoVersion ?= $(Library_Prefix)$(Project)$(Library_Suffix)
+    ProductName ?= $(Library_Prefix)$(Project)$(Library_Suffix)
+    ProductNameWithVersion ?= $(Library_Prefix)$(Project)$(if $(Library_Version),.$(Library_Version),)$(Library_Suffix)
+    RELEASE_ProductName = $(ProductName)
+    RELEASE_ProductNameWithVersion = $(ProductNameWithVersion)
+    DEBUG_ProductName = $(ProductName:$(Library_Suffix)=$(DEBUG_Library_Suffix))
+    DEBUG_ProductNameWithVersion = $(ProductNameWithVersion:$(Library_Suffix)=$(DEBUG_Library_Suffix))
+    PROFILE_ProductName = $(ProductName:$(Library_Suffix)=$(PROFILE_Library_Suffix))
+    PROFILE_ProductNameWithVersion = $(ProductNameWithVersion:$(Library_Suffix)=$(PROFILE_Library_Suffix))
     Install_Dir ?= /usr/lib
  else
   ifeq ($(ProductType),staticlib)
     Library_Suffix ?= .a
     ProductName ?= $(Library_Prefix)$(Project)$(Library_Suffix)
+    RELEASE_ProductName = $(ProductName)
+    DEBUG_ProductName = $(ProductName:$(Library_Suffix)=$(DEBUG_Library_Suffix))
+    PROFILE_ProductName = $(ProductName:$(Library_Suffix)=$(PROFILE_Library_Suffix))
     Install_Dir ?= /usr/local/lib
   else
+   ifeq ($(ProductType),none)
+   else
     $(error Unknown ProductType: $(ProductType))
+   endif
   endif
  endif
 endif
 
+BUILD_STYLES = RELEASE
+ifeq ($(BuildDebug),YES)
+BUILD_STYLES += DEBUG
+endif
+ifeq ($(BuildProfile),YES)
+BUILD_STYLES += PROFILE
+endif
+
 ALL_FILES = $(CFILES) $(MFILES) $(CXXFILES) $(USERDEFS) $(SERVERDEFS) $(MANPAGES)
 ALL_SRCFILES = $(CFILES) $(MFILES) $(CXXFILES)
 
@@ -78,6 +101,13 @@ ifneq ($(RPCSVCFILES),)
 CFILES += $(foreach FILE, $(RPCFILES:.x=_svc.c), $(OBJROOT)/$(Project)/$(notdir $(FILE)))
 endif
 
+## Lex ##
+
+LFLAGS=$(Extra_L_Flags)
+ifneq ($(LFILES),)
+CFILES += $(foreach FILE, $(LFILES:.l=.yy.c), $(OBJROOT)/$(Project)/$(notdir $(FILE)))
+endif
+
 ## Yacc ##
 
 YFLAGS=$(Extra_Y_Flags)
@@ -92,12 +122,6 @@ Extra_CC_Flags += -isysroot $(SDKROOT)
 Extra_LD_Flags += -Wl,-syslibroot,$(SDKROOT)
 endif
 
-ifneq ($(RC_TARGET_CONFIG),)
-ifeq ($(shell tconf --product),)
-$(error undefined Target Config: $(RC_TARGET_CONFIG))
-endif
-endif
-
 ## Dylib Support ##
 
 ifeq ($(Library_Compatibility_Version),)
@@ -107,12 +131,27 @@ ifeq ($(Library_Current_Version),)
 Library_Current_Version = $(if $(RC_ProjectSourceVersion), $(RC_ProjectSourceVersion), 1)
 endif
 
-ALL_OFILES = $(foreach OFILE, \
+RELEASE_OFILE_SUFFIX=.o
+DEBUG_OFILE_SUFFIX=_debug.o
+PROFILE_OFILE_SUFFIX=_profile.o
+
+RELEASE_ALL_OFILES = $(foreach OFILE, \
                $(CFILES:.c=.o) \
                $(MFILES:.m=.o) \
                $(CXXFILES:.%=.o) \
                $(OTHER_OFILES), \
                        $(OBJROOT)/$(Project)/$(notdir $(OFILE)))
+DEBUG_ALL_OFILES = $(RELEASE_ALL_OFILES:.o=$(DEBUG_OFILE_SUFFIX))
+PROFILE_ALL_OFILES = $(RELEASE_ALL_OFILES:.o=$(PROFILE_OFILE_SUFFIX))
+ALL_OFILES = $(RELEASE_ALL_OFILES) $(DEBUG_ALL_OFILES) $(PROFILE_ALL_OFILES)
+
+RELEASE_CFLAGS = $(CFLAGS)
+DEBUG_CFLAGS = $(CFLAGS) -DDEBUG
+PROFILE_CFLAGS = $(CFLAGS) -pg -DPROFILE
+
+RELEASE_LDFLAGS = $(LDFLAGS)
+DEBUG_LDFLAGS = $(LDFLAGS)
+PROFILE_LDFLAGS = $(LDFLAGS)
 
 ###         ###
 ### Targets ###
@@ -123,7 +162,13 @@ ALL_OFILES = $(foreach OFILE, \
 Install_Headers_Directory ?= /usr/include
 Install_Private_Headers_Directory ?= /usr/local/include
 
-installhdrs::
+installhdrs:: _installhdrs
+ifneq ($(SubProjects),)
+       make recurse TARGET=$@ RC_ARCHS="$(RC_ARCHS)"
+endif
+
+_installhdrs::
+       @true # avoid nothing to be done warning
 ifneq ($(Install_Headers),)
        @echo "Installing headers for $(Project)..."
        $(INSTALL_DIRECTORY) $(DSTROOT)/$(Install_Headers_Directory)
@@ -141,30 +186,38 @@ ifneq ($(Install_Private_Headers),)
        done
 endif
 
-install:: build installhdrs
-       @echo "Installing $(Project)..."
-ifneq ($(SubProjects),)
-       make recurse TARGET=install RC_ARCHS="$(RC_ARCHS)"
-else
+install:: build _installhdrs
+       @echo "====== Installing $(Project) ====="
+#ifneq ($(SubProjects),)
+#      make recurse TARGET=$@ RC_ARCHS="$(RC_ARCHS)"
+#endif
        $(INSTALL_DIRECTORY) $(DSTROOT)/$(Install_Dir)
-ifneq ($(ALL_OFILES),)
+ifneq ($(strip $(ALL_OFILES)),)
  ifeq ($(ProductType),tool)
        $(INSTALL_PROGRAM) $(SYMROOT)/$(ProductName) $(DSTROOT)/$(Install_Dir)
  else
   ifeq ($(ProductType),dylib)
-       $(INSTALL_DYLIB) $(SYMROOT)/$(ProductName) $(DSTROOT)/$(Install_Dir)
-       $(STRIP) -S $(DSTROOT)/$(Install_Dir)/$(ProductName)
-      ifneq ($(ProductName),$(ProductNameNoVersion))
-       $(LN) -sf $(ProductName) $(DSTROOT)/$(Install_Dir)/$(ProductNameNoVersion)
-      endif
+       @$(foreach STYLE, $(BUILD_STYLES), \
+       CMD="$(INSTALL_DYLIB) $(SYMROOT)/$($(STYLE)_ProductNameWithVersion) \
+               $(DSTROOT)/$(Install_Dir)" ; \
+       echo $${CMD} ; $${CMD} || exit 1 ; \
+       CMD="$(STRIP) -S $(DSTROOT)/$(Install_Dir)/$($(STYLE)_ProductNameWithVersion)" ; \
+       echo $${CMD} ; $${CMD} || exit 1 ; \
+       if [ "$($(STYLE)_ProductName)" != "$($(STYLE)_ProductNameWithVersion)" ]; then \
+               CMD="$(LN) -sf $($(STYLE)_ProductNameWithVersion) \
+                       $(DSTROOT)/$(Install_Dir)/$($(STYLE)_ProductName)" ; \
+               echo $${CMD} ; $${CMD} || exit 1 ; \
+       fi ; )
   else
    ifeq ($(ProductType),staticlib)
-       $(INSTALL_LIBRARY) $(SYMROOT)/$(ProductName) $(DSTROOT)/$(Install_Dir)
+       @$(foreach STYLE, $(BUILD_STYLES), \
+               CMD="$(INSTALL_LIBRARY) $(SYMROOT)/$($(STYLE)_ProductName) \
+                       $(DSTROOT)/$(Install_Dir)" ; \
+               echo $${CMD} ; $${CMD} || exit 1 ; )
    endif
   endif
  endif
 endif
-endif
 ifneq ($(MANPAGES),)
        @make install-man-pages
 endif
@@ -213,6 +266,16 @@ rpcfiles:
                echo $${CMD} ; $${CMD} || exit 1; \
        done
 
+lfiles:
+       @$(MKDIR) $(OBJROOT)/$(Project)
+       @for FILE in $(LFILES); do \
+               OUT=`basename $${FILE} .l` ; \
+               CMD="$(LEX) $(LFLAGS) \
+                       --header-file=$(OBJROOT)/$(Project)/$${OUT}.yy.h \
+                       -o $(OBJROOT)/$(Project)/$${OUT}.yy.c $${FILE}"; \
+               echo $${CMD} ; $${CMD} || exit 1; \
+       done
+
 yfiles:
        @$(MKDIR) $(OBJROOT)/$(Project)
        @for FILE in $(YFILES); do \
@@ -222,38 +285,56 @@ yfiles:
                echo $${CMD} ; $${CMD} || exit 1 ; \
        done
 
-build:: migdefs rpcfiles yfiles $(ALL_FILES)
-       @echo "Building $(Project)..."
+build:: migdefs rpcfiles yfiles lfiles $(ALL_FILES)
+ifneq ($(SubProjects),)
+       make recurse TARGET=install RC_ARCHS="$(RC_ARCHS)"
+endif
        @$(MKDIR) $(OBJROOT)/$(Project)
        @$(MKDIR) $(SYMROOT)
 
-       @for CFILE in $(ALL_SRCFILES); do \
-               OFILE=$$(echo $$(basename $${CFILE}) | sed -e 's,\.[^.]*$$,.o,') ; \
-               CMD="$(CC) $(CFLAGS) -c -o $(OBJROOT)/$(Project)/$${OFILE} $${CFILE}" ; \
+       @$(foreach STYLE, $(BUILD_STYLES), \
+       echo ===== Building $(ProductName) $(STYLE) ===== ; \
+       for CFILE in $(ALL_SRCFILES); do \
+               OFILE=$(OBJROOT)/$(Project)/$$(echo $$(basename $${CFILE}) | \
+                       sed -e 's,\.[^.]*$$,$($(STYLE)_OFILE_SUFFIX),') ; \
+               if [ ! "$${OFILE}" -nt "$${CFILE}" ]; then \
+               CMD="$(CC) $($(STYLE)_CFLAGS) -c -o $${OFILE} $${CFILE}" ; \
                echo $$CMD ; $$CMD || exit 1 ; \
-       done
+               fi ; \
+       done ; )
 
-ifneq ($(ALL_OFILES),)
+ifneq ($(strip $(ALL_OFILES)),)
  ifeq ($(ProductType),tool)
-       $(CC) $(LDFLAGS) -o $(SYMROOT)/$(ProductName) $(ALL_OFILES)
+       @echo ===== Linking $(ProductName) RELEASE =====
+       $(CC) $(RELEASE_LDFLAGS) -o $(SYMROOT)/$(ProductName) \
+               $(RELEASE_ALL_OFILES)
+       dsymutil --out $(SYMROOT)/$(ProductName).dSYM \
+               $(SYMROOT)/$(ProductName) || true
  else
   ifeq ($(ProductType),dylib)
-       $(CC) -dynamiclib $(LDFLAGS) \
+       @$(foreach STYLE, $(BUILD_STYLES), \
+       echo ===== Linking $(ProductName) $(STYLE) ===== ; \
+       CMD="$(CC) -dynamiclib $($(STYLE)_LDFLAGS) \
                -dynamic \
                -compatibility_version $(Library_Compatibility_Version) \
                -current_version $(Library_Current_Version) \
-               -install_name `echo $(Install_Dir)/$(ProductName) | sed 's,//,/,g'` \
-               -o $(SYMROOT)/$(ProductName) \
-               $(ALL_OFILES)
+               -install_name `echo $(Install_Dir)/$($(STYLE)_ProductNameWithVersion) | sed 's,//,/,g'` \
+               -o $(SYMROOT)/$($(STYLE)_ProductNameWithVersion) \
+               $($(STYLE)_ALL_OFILES)" ; \
+               echo $${CMD} ; $${CMD} || exit 1 ; \
+       CMD="dsymutil --out $(SYMROOT)/$($(STYLE)_ProductNameWithVersion).dSYM \
+               $(SYMROOT)/$($(STYLE)_ProductNameWithVersion)" ; \
+       echo $${CMD} ; $${CMD} ; )
   else
    ifeq ($(ProductType),staticlib)
-       $(LIBTOOL) -static -o $(SYMROOT)/$(ProductName) $(ALL_OFILES)
+       @$(foreach STYLE, $(BUILD_STYLES), \
+               echo ===== Linking $(ProductName) $(STYLE) ===== ; \
+               CMD="$(LIBTOOL) -static -o $(SYMROOT)/$($(STYLE)_ProductName) \
+                       $($(STYLE)_ALL_OFILES)" ; \
+               echo $${CMD} ; $${CMD} || exit 1 ; )
    endif
   endif
  endif
- ifneq ($(ProductType),staticlib)
-       dsymutil --out $(SYMROOT)/$(ProductName).dSYM $(SYMROOT)/$(ProductName) || true
- endif
 endif
 
 install-man-pages::
index 3fa7c95eef3e4d7938e7f1a0560456c2a9eaeedc..5d849a39fd60451fa13df5579f05c6f195a491af 100644 (file)
@@ -111,13 +111,19 @@ ManPageDirectories = /usr/share/man
 # Targets
 ##
 
-.PHONY: all install installhdrs install_headers lazy_installsrc lazy_install_source installsrc install_source build clean recurse
+.PHONY: all install installhdrs install_headers lazy_installsrc lazy_install_source installsrc install_source build clean recurse _targetconfig
 
 all: build
 
 $(DSTROOT): install
 
-install:: install_headers build
+install:: _targetconfig install_headers build
+
+_targetconfig::
+       @PRODUCT="`tconf --product 2>/dev/null`" ; \
+       if [ -z "$$PRODUCT" ]; then \
+       echo "Error: TargetConfig not defined" ; exit 1 ; \
+       else echo "TargetConfig: $$PRODUCT" ; fi
 
 # For RC
 installhdrs:: install_headers
@@ -162,7 +168,7 @@ build:: lazy_install_source
 
 clean::
        @echo "Cleaning $(Project)..."
-       $(_v) $(RMDIR) -f "$(BuildDirectory)"
+       $(_v) $(RMDIR) -f "$(BuildDirectory)" || true
 
 $(Passed_Targets) $(Extra_Passed_Targets):
        $(_v) umask $(Install_Mask) ; $(MAKE) -C $(BuildDirectory) $(Environment) $@
@@ -171,6 +177,9 @@ recurse:
 ifdef SubProjects
        $(_v) for SubProject in $(SubProjects); do                              \
                $(MAKE) -C $$SubProject $(TARGET)                               \
+                       OBJROOT=$(OBJROOT)                                      \
+                       SYMROOT=$(SYMROOT)                                      \
+                       DSTROOT=$(DSTROOT)                                      \
                        BuildDirectory=$(BuildDirectory)/$${SubProject}         \
                               Sources=$(Sources)/$${SubProject}                \
                       CoreOSMakefiles=$(CoreOSMakefiles) || exit 1 ;           \
index c7295f9f39ba3298045c537466002697b15aab98..dd89baed5f504b2272c6ad84e72f319be175940d 100644 (file)
@@ -142,7 +142,8 @@ $(ConfigStamp):
 ifneq ($(GnuNoConfigure),YES)
        @echo "Configuring $(Project)..."
        $(_v) $(MKDIR) $(BuildDirectory)
-       $(_v) cd $(BuildDirectory) && $(Environment) $(Configure) $(Configure_Flags)
+# Disable LD_TRACE_FILE during configure
+       $(_v) cd $(BuildDirectory) && $(Environment) LD_TRACE_FILE=/dev/null $(Configure) $(Configure_Flags)
 endif
        $(_v) touch $@
 
index 0f1a667c1832ba83cfa78427f1d6faf265ceaebd..da21b7717a301bf567b936239470a4339c5a446e 100644 (file)
@@ -70,7 +70,7 @@ endif
 ##
 # Find Garbage
 ##
-Cruft      = CVS RCS SCCS *~ .*~ .nfs\* .*.wmd
+Cruft      = CVS RCS SCCS *~ .*~ .nfs\* .*.wmd .svn .DS_Store
 Find_Cruft = '(' $(Cruft:%=-name '%' -or) -name '' ')' -print
 
 ##
index 7daea4a10f2d7430e2af2fa246f409da28a56657..e182d8caee6531c4e595054e013f082ecb1b757b 100755 (executable)
@@ -74,21 +74,23 @@ for my $dir (@ARGV) {
     while(($count = scalar(@compress)) > 0) {
        $_ = $count > $N ? $N : $count;
        my @args = splice(@compress, 0, $_);
-       print "gzip -f @args\n";
-       system('gzip', '-f', @args) == 0 or die "gzip failed\n";;
+       print "gzip -f -n @args\n";
+       system('gzip', '-f', '-n', @args) == 0 or die "gzip failed\n";;
     }
     foreach my $list (@links) {
        my $main = shift(@$list);
        for(@$list) {
-           printf "rm $_; ln $main.gz $_.gz\n";
+           printf "rm $_; ln -f $main.gz $_.gz\n";
            unlink $_ or die "Can't unlink: $!\n";
+           unlink "$_.gz";
            link("$main.gz", "$_.gz") or die "Can't link: $!\n";;
        }
     }
     for(@symlinks) {
        my $link = readlink($_);
-       printf "rm $_; ln -s $link.gz $_.gz\n";
+       printf "rm $_; ln -fs $link.gz $_.gz\n";
        unlink $_ or die "Can't unlink: $!\n";
+       unlink "$_.gz";
        symlink("$link.gz", "$_.gz") or die "Can't symlink: $!\n";
     }
 }