Skip to content

Commit

Permalink
Build, PKG, DMG, clean
Browse files Browse the repository at this point in the history
  • Loading branch information
avibrazil committed Apr 10, 2015
1 parent dc5f739 commit 9ac62c6
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- <key>CFBundleIcon</key>
<string>Icon_512x512.png</string> -->
<key>CFBundleIcon</key>
<string>Icon_512x512.png</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
Expand All @@ -13,7 +13,7 @@
<key>CFBundleGetInfoString</key>
<string>Made by a meandering fool</string>
<key>CFBundleIdentifier</key>
<string>com.phoenix-dev.setresx</string>
<string>net.alkalay.RDM</string>
<key>CFBundleName</key>
<string>SetResX</string>
<key>LSUIElement</key>
Expand Down
65 changes: 65 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/bin/env make -f

PREFIX=/usr
IDENTIFIER=net.alkalay.RDM

VERSION=2.0

CC=llvm-g++
PACKAGE_BUILD=/usr/bin/pkgbuild
ARCH_FLAGS=-arch x86_64

.PHONY: build

RDM.app: SetResX Resources Info.plist
mkdir -p RDM.app/Contents/MacOS/
cp SetResX RDM.app/Contents/MacOS/
cp -r Info.plist Resources RDM.app/Contents


SetResX: main.o SRApplicationDelegate.o ResMenuItem.o cmdline.o utils.o
$(CC) $^ -o $@ $(ARCH_FLAGS) -framework Foundation -framework ApplicationServices -framework AppKit


clean:
rm -f SetResX
rm -f *.o
rm -rf RDM.app
rm -rf pkgroot dmgroot
rm -f *.pkg *.dmg

%.o: %.mm
$(CC) $(CPPFLAGS) $(CFLAGS) $(ARCH_FLAGS) $< -c -o $@


screenresolution: main.o cg_utils.o
$(CC) $(CPPFLAGS) $(CFLAGS) $(ARCH_FLAGS) -framework Foundation -framework ApplicationServices $^ -o $@

%.icns: %.png
sips -s format icns $< --out $@

SwitchResolution.app: SwitchResolution.applescript resolution.icns
osacompile -o $@ $<
mv resolution.icns $@/Contents/Resources/applet.icns

version.h:
sed -e "s/@VERSION@/\"$(VERSION)\"/" < version-tmpl.h > version.h

pkg: RDM.app
mkdir -p pkgroot/Applications
mv $< pkgroot/Applications/
$(PACKAGE_BUILD) --root pkgroot/ --identifier $(IDENTIFIER) \
--version $(VERSION) "RDM-$(VERSION).pkg"
rm -f RDM.pkg
ln -s RDM-$(VERSION).pkg RDM.pkg

dmg: pkg
mkdir -p dmgroot
cp RDM-$(VERSION).pkg dmgroot/
rm -f RDM-$(VERSION).dmg
hdiutil makehybrid -hfs -hfs-volume-name "RDM $(VERSION)" \
-o "RDM-$(VERSION).dmg" dmgroot/
rm -f RDM.dmg
ln -s RDM-$(VERSION).dmg RDM.dmg

.PHONY: pkg dmg install build clean

0 comments on commit 9ac62c6

Please sign in to comment.