From http://www.jwz.org/xscreensaver/xscreensaver-5.22.tar.gz
[xscreensaver] / OSX / Makefile
index 0d8160498ca3e23292a3717f88db6bf3ad25a327..7e99452ec51825fc997e80b333e8aa40a76acdc3 100644 (file)
@@ -1,14 +1,18 @@
-# XScreenSaver for MacOS X, Copyright (c) 2006 by Jamie Zawinski.
+# XScreenSaver for MacOS X, Copyright (c) 2006-2013 by Jamie Zawinski.
 
-XCODE_TARGET = "All Savers"
-XCODEBUILD=xcodebuild
+XCODEBUILD = /usr/bin/xcodebuild
+TARGETS    = -target "All Savers"
+ARCH       = -arch i386 -arch x86_64
+CERT       = 'Jamie Zawinski'
+CERT       = 'iPhone Developer: Jamie Zawinski (Y5M82TL69N)'
+THUMBDIR   = $(HOME)/www/xscreensaver/screenshots/
 
 default: release
 all: debug release
 
 clean:
        -rm -rf build
-#      cd ..; $(XCODEBUILD) -target $(XCODE_TARGET) clean
+#      cd ..; $(XCODEBUILD) $(TARGETS) clean
 
 distclean:
        -rm -f config.status config.cache config.log \
@@ -19,18 +23,19 @@ distclean:
 distdepend:: update_plist_version
 
 debug: distdepend
-       cd ..; $(XCODEBUILD) -target $(XCODE_TARGET) -configuration Debug   build
+       cd ..; $(XCODEBUILD) $(ARCH) $(TARGETS) -configuration Debug   build
 
 release:: distdepend
-       cd ..; $(XCODEBUILD) -target $(XCODE_TARGET) -configuration Release build
+       cd ..; $(XCODEBUILD) $(ARCH) $(TARGETS) -configuration Release build
 
 release:: check_versions
-
+release:: update_thumbs
 release:: sign
 
 sign:
-       @for f in build/Release/*.saver ; do \
-         codesign -vfs 'Jamie Zawinski' $$f ; \
+       @for f in build/Release/*.app/Contents/*/*.saver \
+                 build/Release/*.{saver,app} ; do \
+         codesign -vfs $(CERT) $$f ; \
         done
 
 check_versions:
@@ -39,7 +44,7 @@ check_versions:
   V=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' $$SRC` ;          \
   DIR=build/Release ;                                                  \
   RESULT=0 ;                                                           \
-  for S in $$DIR/*.saver ; do                                          \
+  for S in $$DIR/*.{saver,app} ; do                                    \
    for P in $$S/Contents/Info.plist ; do                               \
      V2=`perl -0000 -n -e                                              \
        'm@<key>CFBundleVersion</key>\s*<string>(.*?)</string>@si       \
@@ -53,6 +58,14 @@ check_versions:
   if [ "$$RESULT" = 0 ]; then echo "Versions match ($$V2)" ; fi ;      \
   exit $$RESULT
 
+update_thumbs::
+       ./update-thumbnail.pl $(THUMBDIR) build/Release/*.saver
+
+
+# Arrrrgh
+ios-function-table.m::
+       @./build-fntable.pl build/Debug-iphonesimulator/XScreenSaver.app $@
+
 
 echo_tarfiles:
        @echo `find . \
@@ -68,7 +81,7 @@ update_plist_version:
   SRC=../utils/version.h ;                                                   \
   V=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' $$SRC` ;                \
   T=/tmp/xs.$$$$ ;                                                           \
-  for S in XScreenSaver.plist SaverTester.plist ; do                         \
+  for S in XScreenSaver.plist SaverRunner.plist iSaverRunner.plist ; do              \
     /bin/echo -n "Updating version number in $$S to \"$$V\"... " ;           \
     KEYS="CFBundleVersion|CFBundleShortVersionString" ;                              \
     perl -0777 -pne                                                          \
@@ -83,6 +96,7 @@ update_plist_version:
   done ;                                                                     \
   rm $$T
 
+
 # -format UDBZ saves 4% (~1.2 MB) over UDZO.
 dmg:: distdepend check_versions
        @                                                                     \
@@ -108,9 +122,11 @@ dmg:: distdepend check_versions
       ../hacks/Makefile.in ;                                                 \
       perl -0 -ne                                                            \
      's/\\\\\\n//g; m/^RETIRED_GL_EXES\s*=\s*(.*)$$/m && print "$$1\n"'              \
-      ../hacks/glx/Makefile.in` ;                                            \
+      ../hacks/glx/Makefile.in ;                                             \
+     echo xscreensaver ;                                                     \
+     echo savertester` ;                                                     \
                                                                              \
-  for f in $$SRC/*.saver $$EXTRAS ; do                                       \
+  for f in $$SRC/*.{saver,app} $$EXTRAS ; do                                 \
    ok=yes ;                                                                  \
    ff=`echo $$f | perl -e '$$_=<>; s@^.*/(.*)\..*$$@\L$$1@; print'`;         \
    for r in $$retired ; do                                                   \