Release/Makefile
author Peter Hosey <hg@boredzo.org>
Mon Jun 15 19:53:26 2009 -0700 (2009-06-15)
changeset 4216 803920185e34
parent 4215 bcc6b2ed2cd2
child 4217 cce8afc9fe17
permissions -rw-r--r--
When updating version numbers in Info.plist files, also update those of the GrowlSafariLoader bundle.
evands@3667
     1
##########################
evands@3667
     2
### Versioning:
evands@3690
     3
###   * Set VERSION and BETA below. BETA should be TRUE or FALSE.
evands@3667
     4
###   * Update the version struct in Core/Source/GrowlApplicationController.m 
evands@3667
     5
###       (needed for proper version checking)
evands@3667
     6
###   * Update the version string in Extras/growlnotify/main.m
evands@3667
     7
#
hg@4215
     8
VERSION=1.1.5b3
Peter@4180
     9
BETA=TRUE
evands@3690
    10
evands@3667
    11
#
evands@3667
    12
#########################
evands@3667
    13
#
evands@3667
    14
# No changes should be needed below this line
evands@3667
    15
#
evands@3667
    16
#########################
evands@3713
    17
RELEASE_FILENAME=Growl-$(VERSION)
evands@4074
    18
RELEASE_NAME="Growl-$(VERSION)"
evands@3713
    19
RELEASE_SDK_NAME="Growl $(VERSION) SDK"
evands@3667
    20
boredzo@3803
    21
SRC_DIR=$(PWD)/..
bgannin@3368
    22
BUILD_DIR=build
bgannin@3368
    23
GROWL_DIR=$(BUILD_DIR)/Growl
bgannin@3368
    24
SDK_DIR=$(BUILD_DIR)/SDK
bgannin@3368
    25
BUILDSTYLE=Deployment
bgannin@3368
    26
BUILDFLAGS="BUILDCONFIGURATION=$(BUILDSTYLE)"
Peter@4200
    27
PRODUCT_DIR=$(shell defaults read com.apple.Xcode PBXApplicationwideBuildSettings 2> /dev/null | cat > XcodeBuildSettings.plist && defaults read $PWD/XcodeBuildSettings SYMROOT 2> /dev/null; rm XcodeBuildSettings.plist)
bgannin@3368
    28
ifeq ($(strip $(PRODUCT_DIR)),)
bgannin@3368
    29
	GROWL_BUILD_DIR=$(SRC_DIR)/build/$(BUILDSTYLE)
bgannin@3368
    30
	GROWLNOTIFY_BUILD_DIR=$(SRC_DIR)/Extras/growlnotify/build/$(BUILDSTYLE)
bgannin@3368
    31
	GROWLTUNES_BUILD_DIR=$(SRC_DIR)/Extras/GrowlTunes/build/$(BUILDSTYLE)
bgannin@3368
    32
	HARDWAREGROWLER_BUILD_DIR=$(SRC_DIR)/Extras/HardwareGrowler/build/$(BUILDSTYLE)
bgannin@3368
    33
	GROWLMAIL_BUILD_DIR=$(SRC_DIR)/Extras/GrowlMail/build/$(BUILDSTYLE)
bgannin@3368
    34
	GROWLSAFARI_BUILD_DIR=$(SRC_DIR)/Extras/GrowlSafari/build/$(BUILDSTYLE)
bgannin@3368
    35
else
bgannin@3368
    36
	TARGET_BUILD_DIR=$(PRODUCT_DIR)/$(BUILDSTYLE)
bgannin@3368
    37
	GROWL_BUILD_DIR=$(TARGET_BUILD_DIR)
bgannin@3368
    38
	GROWLNOTIFY_BUILD_DIR=$(TARGET_BUILD_DIR)
bgannin@3368
    39
	GROWLTUNES_BUILD_DIR=$(TARGET_BUILD_DIR)
bgannin@3368
    40
	HARDWAREGROWLER_BUILD_DIR=$(TARGET_BUILD_DIR)
bgannin@3368
    41
	GROWLMAIL_BUILD_DIR=$(TARGET_BUILD_DIR)
bgannin@3368
    42
	GROWLSAFARI_BUILD_DIR=$(TARGET_BUILD_DIR)
bgannin@3368
    43
endif
Peter@4196
    44
DSYM_DIR=$(BUILD_DIR)/Growl-dSYM-$(VERSION)
evands@3710
    45
PACKAGE_MAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
evands@3713
    46
ART_DIR=Artwork
bgannin@3368
    47
evands@3667
    48
#########################
evands@3667
    49
evands@3667
    50
.PHONY: all assertnochanges assertnoconflicts compile clean release source version
evands@3667
    51
evands@3667
    52
all: assertnochanges version compile release
evands@3667
    53
all-withlocalchanges: assertnoconflicts version compile release
boredzo@3475
    54
boredzo@3475
    55
assertnochanges:
Peter@4185
    56
	if [[ 0 -ne `hg st | wc -l` ]]; then \
Peter@4185
    57
		echo 'You have local changes. Please do not build releases from an unclean working copy. You must revert the changes, commit them, or clone your repository and build from that.' 1>&2; \
boredzo@3489
    58
		exit 1; \
boredzo@3489
    59
	fi
boredzo@3475
    60
assertnoconflicts:
Peter@4185
    61
	if [[ 0 -ne `hg resolve --list | grep -E '^U' | wc -l` ]]; then \
Peter@4185
    62
		echo 'You have conflicts in your working copy. You will not be able to build until these are resolved. Also, remember that even after you have fixed all conflict marks, you must use "hg resolve" to re-try your last update or merge; otherwise, hg will still believe the files are conflicted.' 1>&2; \
boredzo@3489
    63
		exit 2; \
boredzo@3489
    64
	fi
bgannin@3368
    65
evands@3667
    66
version:
evands@3667
    67
	@# update the CFBundleVersion
evands@3705
    68
	defaults write $(SRC_DIR)/Core/Resources/GrowlHelperApp-Info CFBundleVersion '$(VERSION)'
evands@3811
    69
	defaults write $(SRC_DIR)/Framework/Resources/Growl-WithInstaller.framework-Info CFBundleVersion '$(VERSION)'
evands@3811
    70
	defaults write $(SRC_DIR)/Framework/Resources/Growl.framework-Info CFBundleVersion '$(VERSION)'
evands@3705
    71
	defaults write $(SRC_DIR)/Core/Resources/Info CFBundleVersion '$(VERSION)'
evands@3705
    72
	defaults write $(SRC_DIR)/Extras/GrowlCode/Info CFBundleVersion '$(VERSION)'
evands@3705
    73
	defaults write $(SRC_DIR)/Extras/GrowlMail/Info CFBundleVersion '$(VERSION)'
evands@3705
    74
	defaults write $(SRC_DIR)/Extras/GrowlSafari/Info CFBundleVersion '$(VERSION)'
hg@4216
    75
	defaults write $(SRC_DIR)/Extras/GrowlSafari/GrowlSafariLoader-Info CFBundleVersion '$(VERSION)'
evands@3705
    76
	defaults write $(SRC_DIR)/Extras/GrowlTunes/Info CFBundleVersion '$(VERSION)'
evands@3705
    77
	defaults write $(SRC_DIR)/Extras/HardwareGrowler/Info CFBundleVersion '$(VERSION)'
evands@3705
    78
	defaults write $(SRC_DIR)/StatusItem/Resources/MenuExtra-Info CFBundleVersion '$(VERSION)'
evands@3667
    79
evands@3667
    80
	@# update the CFBundleShortVersionString
evands@3705
    81
	defaults write $(SRC_DIR)/Core/Resources/GrowlHelperApp-Info CFBundleShortVersionString '$(VERSION)'
evands@3811
    82
	defaults write $(SRC_DIR)/Framework/Resources/Growl-WithInstaller.framework-Info CFBundleShortVersionString '$(VERSION)'
evands@3811
    83
	defaults write $(SRC_DIR)/Framework/Resources/Growl.framework-Info CFBundleShortVersionString '$(VERSION)'
evands@3705
    84
	defaults write $(SRC_DIR)/Core/Resources/Info CFBundleShortVersionString '$(VERSION)'
evands@3705
    85
	defaults write $(SRC_DIR)/Extras/GrowlCode/Info CFBundleShortVersionString '$(VERSION)'
evands@3705
    86
	defaults write $(SRC_DIR)/Extras/GrowlMail/Info CFBundleShortVersionString '$(VERSION)'
evands@3705
    87
	defaults write $(SRC_DIR)/Extras/GrowlSafari/Info CFBundleShortVersionString '$(VERSION)'
hg@4216
    88
	defaults write $(SRC_DIR)/Extras/GrowlSafari/GrowlSafariLoader-Info CFBundleShortVersionString '$(VERSION)'
evands@3705
    89
	defaults write $(SRC_DIR)/Extras/GrowlTunes/Info CFBundleShortVersionString '$(VERSION)'
evands@3705
    90
	defaults write $(SRC_DIR)/Extras/HardwareGrowler/Info CFBundleShortVersionString '$(VERSION)'
evands@3705
    91
	defaults write $(SRC_DIR)/StatusItem/Resources/MenuExtra-Info CFBundleShortVersionString '$(VERSION)'
evands@3667
    92
evands@3667
    93
	@# Convert back to XML plist, since defaults creates binary plists
evands@3667
    94
	plutil -convert xml1 $(SRC_DIR)/Core/Resources/GrowlHelperApp-Info.plist
evands@3815
    95
	plutil -convert xml1 $(SRC_DIR)/Framework/Resources/Growl-WithInstaller.framework-Info.plist
evands@3815
    96
	plutil -convert xml1 $(SRC_DIR)/Framework/Resources/Growl.framework-Info.plist 
evands@3667
    97
	plutil -convert xml1 $(SRC_DIR)/Core/Resources/Info.plist
evands@3667
    98
	plutil -convert xml1 $(SRC_DIR)/Extras/GrowlCode/Info.plist
evands@3667
    99
	plutil -convert xml1 $(SRC_DIR)/Extras/GrowlMail/Info.plist
evands@3667
   100
	plutil -convert xml1 $(SRC_DIR)/Extras/GrowlSafari/Info.plist
hg@4216
   101
	plutil -convert xml1 $(SRC_DIR)/Extras/GrowlSafari/GrowlSafariLoader-Info.plist
evands@3667
   102
	plutil -convert xml1 $(SRC_DIR)/Extras/GrowlTunes/Info.plist
evands@3667
   103
	plutil -convert xml1 $(SRC_DIR)/Extras/HardwareGrowler/Info.plist
evands@3667
   104
	plutil -convert xml1 $(SRC_DIR)/StatusItem/Resources/MenuExtra-Info.plist
evands@3667
   105
bgannin@3368
   106
compile:
Peter@4197
   107
	find $(SRC_DIR) -name build -prune -print0 | xargs -0 rm -R
bgannin@3368
   108
	$(MAKE) $(BUILDFLAGS) -C $(SRC_DIR)
bgannin@3368
   109
	$(MAKE) $(BUILDFLAGS) -C $(SRC_DIR)/Extras/GrowlMail
bgannin@3368
   110
	$(MAKE) $(BUILDFLAGS) -C $(SRC_DIR)/Extras/GrowlSafari
bgannin@3368
   111
	$(MAKE) $(BUILDFLAGS) -C $(SRC_DIR)/Extras/growlnotify
bgannin@3368
   112
	$(MAKE) $(BUILDFLAGS) -C $(SRC_DIR)/Extras/HardwareGrowler
bgannin@3368
   113
	$(MAKE) $(BUILDFLAGS) -C $(SRC_DIR)/Extras/GrowlTunes
bgannin@3368
   114
bgannin@3368
   115
clean:
bgannin@3368
   116
	rm -rf $(BUILD_DIR)
bgannin@3368
   117
bgannin@3368
   118
realclean: clean
bgannin@3368
   119
	../build.sh clean
bgannin@3368
   120
bgannin@3368
   121
release:
bgannin@3368
   122
	@# clean build directory
bgannin@3368
   123
	rm -rf $(BUILD_DIR)
bgannin@3368
   124
	mkdir $(BUILD_DIR)
bgannin@3368
   125
	mkdir $(GROWL_DIR)
evands@3690
   126
	
Peter@4196
   127
	@# Archive dSYM bundles.
Peter@4196
   128
	mkdir $(DSYM_DIR)
Peter@4196
   129
	mv $(GROWL_BUILD_DIR)/*.dSYM $(DSYM_DIR)
Peter@4196
   130
	mv $(GROWLNOTIFY_BUILD_DIR)/*.dSYM $(DSYM_DIR)
Peter@4196
   131
	mv $(GROWLTUNES_BUILD_DIR)/*.dSYM $(DSYM_DIR)
Peter@4196
   132
	mv $(HARDWAREGROWLER_BUILD_DIR)/*.dSYM $(DSYM_DIR)
Peter@4196
   133
	mv $(GROWLMAIL_BUILD_DIR)/*.dSYM $(DSYM_DIR)
Peter@4196
   134
	mv $(GROWLSAFARI_BUILD_DIR)/*.dSYM $(DSYM_DIR)
Peter@4196
   135
	@# Note: -C only applies to the input names, not -f, so it is correct to use notdir on the directory name and leave it off of the tarball name.
Peter@4196
   136
	tar -C $(dir $(DSYM_DIR)) -cjf $(DSYM_DIR).tbz $(notdir $(DSYM_DIR))
Peter@4196
   137
	
bgannin@3368
   138
	@# copy uninstaller
bgannin@3368
   139
	cp -R "Uninstall Growl.app" $(GROWL_DIR)
bgannin@3368
   140
	/Developer/Tools/SetFile -a E $(GROWL_DIR)/Uninstall\ Growl.app
evands@3690
   141
	
bgannin@3368
   142
	@# copy webloc files
bgannin@3368
   143
	cp "Growl Documentation.webloc" "Growl version history.webloc" "Get more styles.webloc" $(GROWL_DIR)
evands@3690
   144
	
bgannin@3368
   145
	@# hide extensions of webloc files
bgannin@3368
   146
	/Developer/Tools/SetFile -a E $(GROWL_DIR)/*.webloc
evands@3690
   147
	
evands@3710
   148
	@# build the prefpane package
Peter@4187
   149
	$(PACKAGE_MAKER) --doc Growl/Growl\ Installer.pmdoc --out $(GROWL_DIR)/Growl.mpkg --version $(VERSION) --id com.growl.growl.mpkg -v
evands@3690
   150
	
bgannin@3368
   151
	@# copy the extras
bgannin@3368
   152
	mkdir $(GROWL_DIR)/Extras
bgannin@3368
   153
	mkdir $(GROWL_DIR)/Extras/growlnotify
bgannin@3368
   154
	cp $(GROWLNOTIFY_BUILD_DIR)/growlnotify $(GROWL_DIR)/Extras/growlnotify
bgannin@3368
   155
	cp $(SRC_DIR)/Extras/growlnotify/growlnotify.1 $(GROWL_DIR)/Extras/growlnotify
bgannin@3368
   156
	cp $(SRC_DIR)/Extras/growlnotify/install.sh $(GROWL_DIR)/Extras/growlnotify
evands@3778
   157
	cp $(SRC_DIR)/Extras/growlnotify/*.txt $(GROWL_DIR)/Extras/growlnotify
bgannin@3368
   158
	mkdir $(GROWL_DIR)/Extras/GrowlTunes
bgannin@3368
   159
	cp -R $(GROWLTUNES_BUILD_DIR)/GrowlTunes.app $(GROWL_DIR)/Extras/GrowlTunes
evands@3778
   160
	cp -R $(SRC_DIR)/Extras/GrowlTunes/*.rtfd $(GROWL_DIR)/Extras/GrowlTunes
bgannin@3368
   161
	mkdir $(GROWL_DIR)/Extras/HardwareGrowler
bgannin@3368
   162
	cp -R $(HARDWAREGROWLER_BUILD_DIR)/HardwareGrowler.app $(GROWL_DIR)/Extras/HardwareGrowler
evands@3778
   163
	cp $(SRC_DIR)/Extras/HardwareGrowler/*.txt $(GROWL_DIR)/Extras/HardwareGrowler
evands@3690
   164
	
bgannin@3368
   165
	@# build GrowlMail package
bgannin@3368
   166
	mkdir $(GROWL_DIR)/Extras/GrowlMail
Peter@4187
   167
	$(PACKAGE_MAKER) --doc GrowlMail/GrowlMail\ Installer.pmdoc --out $(GROWL_DIR)/Extras/GrowlMail/GrowlMail.mpkg --version $(VERSION) --id com.growl.growlmail.mpkg -v	
evands@3778
   168
	cp $(SRC_DIR)/Extras/GrowlMail/*.rtf $(GROWL_DIR)/Extras/GrowlMail
evands@3690
   169
	
bgannin@3368
   170
	@# build GrowlSafari package
bgannin@3368
   171
	mkdir $(GROWL_DIR)/Extras/GrowlSafari
boredzo@4098
   172
	@# Set its ownership to root:admin and permissions to rwxr-xr-x so that Mac OS X 10.5.3 will load it.
boredzo@4098
   173
	chmod -R go-w $(GROWLSAFARI_BUILD_DIR)/GrowlSafari
boredzo@4124
   174
	@echo
boredzo@4123
   175
	@echo '*** IMPORTANT: If you want to build Growl as a regular (non-admin) user, hit CTRL-D here without entering a password. (Ctrl-C will stop the build.) Note that the GrowlSafari on the disk image will not be usable on Leopard and later if you do this.'
boredzo@4121
   176
	-(sudo chown -R root:admin $(GROWLSAFARI_BUILD_DIR)/GrowlSafari) || echo "WARNING: GrowlSafari will not work on Leopard and later from this disk image" > /dev/stderr
Peter@4187
   177
	$(PACKAGE_MAKER) --doc GrowlSafari/GrowlSafari\ Installer.pmdoc --out $(GROWL_DIR)/Extras/GrowlSafari/GrowlSafari.pkg --version $(VERSION) --id com.growl.growlsafari.pkg -v	
boredzo@4098
   178
	@# PackageMaker fails at obeying the permissions that we've set forth in the document. Specifically, it sets g+w on everything, in both the BOM and the archive, in direct contravention of what the document says (go-w).
boredzo@4098
   179
	@# Our workaround, then, is to create the BOM and archive ourselves, replacing the full-of-fail ones that PackageMaker creates.
boredzo@4098
   180
	mkbom $(GROWLSAFARI_BUILD_DIR)/GrowlSafari $(GROWL_DIR)/Extras/GrowlSafari/GrowlSafari.pkg/Contents/Archive.bom
boredzo@4098
   181
	(cd $(GROWLSAFARI_BUILD_DIR)/GrowlSafari && pax -w -x cpio -z .) > $(GROWL_DIR)/Extras/GrowlSafari/GrowlSafari.pkg/Contents/Archive.pax.gz
evands@3690
   182
	
bgannin@3368
   183
	@# build the SDK
bgannin@3368
   184
	mkdir $(SDK_DIR)
evands@3690
   185
	
bgannin@3368
   186
	@# copy the webloc files
bgannin@3368
   187
	cp "Growl Developer Documentation.webloc" "Growl version history for developers.webloc" $(SDK_DIR)
evands@3690
   188
	
bgannin@3368
   189
	@# hide extensions of webloc files
bgannin@3368
   190
	/Developer/Tools/SetFile -a E $(SDK_DIR)/*.webloc
evands@3690
   191
	
bgannin@3368
   192
	@# copy the scripts
tick@3585
   193
	#cp -R $(SRC_DIR)/Scripts $(GROWL_DIR)
evands@3690
   194
	
bgannin@3368
   195
	@# copy over relevant files to compile directly into app
bgannin@3368
   196
	mkdir $(SDK_DIR)/Built-In
bgannin@3368
   197
	cp $(SRC_DIR)/Framework/Source/GrowlApplicationBridge.h $(SDK_DIR)/Built-In
bgannin@3368
   198
	cp $(SRC_DIR)/Framework/Source/GrowlApplicationBridge.m $(SDK_DIR)/Built-In
bgannin@3368
   199
	cp $(SRC_DIR)/Common/Source/GrowlDefines.h $(SDK_DIR)/Built-In
bgannin@3368
   200
	cp $(SRC_DIR)/Common/Source/GrowlDefinesInternal.h $(SDK_DIR)/Built-In
bgannin@3368
   201
	cp $(SRC_DIR)/Common/Source/GrowlPathUtilities.h $(SDK_DIR)/Built-In
bgannin@3368
   202
	cp $(SRC_DIR)/Common/Source/GrowlPathUtilities.m $(SDK_DIR)/Built-In 
bgannin@3368
   203
	cp $(SRC_DIR)/Common/Source/CFGrowlAdditions.h $(SDK_DIR)/Built-In
bgannin@3368
   204
	cp $(SRC_DIR)/Common/Source/CFGrowlAdditions.c $(SDK_DIR)/Built-In
bgannin@3368
   205
	cp $(SRC_DIR)/Common/Source/CFGrowlDefines.h $(SDK_DIR)/Built-In
bgannin@3368
   206
	cp $(SRC_DIR)/Common/Source/CFURLAdditions.h $(SDK_DIR)/Built-In
bgannin@3368
   207
	cp $(SRC_DIR)/Common/Source/CFURLAdditions.c $(SDK_DIR)/Built-In
bgannin@3368
   208
	cp $(SRC_DIR)/Common/Source/CFMutableDictionaryAdditions.h $(SDK_DIR)/Built-In
bgannin@3368
   209
	cp $(SRC_DIR)/Common/Source/CFMutableDictionaryAdditions.c $(SDK_DIR)/Built-In
bgannin@3368
   210
	cp $(SRC_DIR)/Core/Source/GrowlPreferencesController.h $(SDK_DIR)/Built-In
bgannin@3368
   211
	cp $(SRC_DIR)/Core/Source/GrowlTicketController.h $(SDK_DIR)/Built-In
evands@3690
   212
	
bgannin@3368
   213
	@# copy the frameworks
bgannin@3368
   214
	mkdir $(SDK_DIR)/Frameworks
bgannin@3368
   215
	cp -R $(GROWL_BUILD_DIR)/Growl.framework $(GROWL_BUILD_DIR)/Growl-WithInstaller.framework $(SDK_DIR)/Frameworks
evands@3690
   216
	
bgannin@3368
   217
	@# copy the bindings
bgannin@3368
   218
	cp -R $(SRC_DIR)/Bindings $(SDK_DIR)
bgannin@3368
   219
	@# remove the AppleScript binding
bgannin@3368
   220
	rm -rf $(SDK_DIR)/Bindings/applescript
evands@3690
   221
	
bgannin@3368
   222
	@# remove some symlinks
bgannin@3368
   223
	rm $(SDK_DIR)/Bindings/tcl/GrowlDefines.h
bgannin@3368
   224
	rm $(SDK_DIR)/Bindings/tcl/GrowlApplicationBridge.h
bgannin@3368
   225
	rm $(SDK_DIR)/Bindings/tcl/GrowlApplicationBridge.m
evands@3690
   226
	
bgannin@3368
   227
	@# delete svn and backup files
bgannin@3368
   228
	find $(BUILD_DIR) -name ".svn" -type d -exec rm -rf {} \; -prune
evands@3690
   229
	find $(BUILD_DIR) \( -name "*~" -or -name .DS_Store \) -type f -delete
evands@3690
   230
bgannin@3368
   231
	@# make Growl disk image
bgannin@3368
   232
	mkdir $(GROWL_DIR)/.background
tick@3601
   233
	cp $(SRC_DIR)/images/dmg/growlDMGBackground.png $(GROWL_DIR)/.background
evands@3713
   234
	./ensureCustomIconsExtracted $(ART_DIR)
evands@3713
   235
	./make-diskimage.sh $(BUILD_DIR)/$(RELEASE_FILENAME).dmg $(GROWL_DIR) $(RELEASE_NAME) dmg_growl.applescript $(ART_DIR)
Peter@4200
   236
	rm $(ART_DIR)/GrowlIcon
evands@3690
   237
	
bgannin@3368
   238
	@# make SDK disk image
bgannin@3368
   239
	mkdir $(SDK_DIR)/.background
bgannin@3368
   240
	cp $(SRC_DIR)/images/dmg/growlSDK.png $(SDK_DIR)/.background
evands@3713
   241
	./make-diskimage.sh $(BUILD_DIR)/$(RELEASE_FILENAME)-SDK.dmg $(SDK_DIR) $(RELEASE_SDK_NAME) dmg_sdk.applescript
evands@3690
   242
	
bgannin@3368
   243
	@echo Build finished
boredzo@4122
   244
	-growlnotify -n 'Growl Release Makefile' 'Growl disk image built successfully' -m $(RELEASE_FILENAME).dmg --iconpath $(BUILD_DIR)/$(RELEASE_FILENAME).dmg