APPNAME := Cylinder BUNDLE := $(APPNAME).app CONTENTS := $(BUNDLE)/Contents INFO_PLIST := $(CONTENTS)/Info.plist PKGINFO := $(CONTENTS)/PkgInfo EXE := $(CONTENTS)/MacOS/$(APPNAME) NIB := $(CONTENTS)/Resources/MainMenu.nib $(shell mkdir -p $(CONTENTS)/MacOS) $(shell mkdir -p $(CONTENTS)/Resources) all: $(INFO_PLIST) $(PKGINFO) $(EXE) $(NIB) @echo \\033[34mCopying Resources\\033[0m @rsync -r --del --exclude '.*' --exclude '*.nib' Resources $(CONTENTS)/ # @if [ `whoami` == keith ]; then \ # echo \\033[34mSigning $(BUNDLE)\\033[0m; \ # codesign -s onesadcookie.com -f $(BUNDLE); \ # fi $(INFO_PLIST): Info.plist Makefile @echo \\033[34mCopying $<\\033[0m @cp $< $@ $(PKGINFO): Makefile @echo \\033[34mCreating PkgInfo File\\033[0m @echo 'APPL????' > $@ $(EXE): main.m Makefile @# x86_64 doesn't work... @echo \\033[34mCompiling $(shell basename $@)\\033[0m @gcc -Os -arch i386 -arch ppc -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk $< -o $@ -framework RubyCocoa -framework Cocoa $(NIB): MainMenu.xib Makefile @echo \\033[34mCompiling $<\\033[0m @ibtool $< --compile $@ clean: rm -rf $(BUNDLE) printname: @echo -n $(APPNAME) .PHONY: all clean printname .DEFAULT_GOAL := all Makefile:; %.m:; %.plist:; %.xib:;