forked from avibrazil/RDM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (45 loc) · 1.39 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env make -f
PREFIX=/usr
IDENTIFIER=net.alkalay.RDM
VERSION=2.2
CC=llvm-g++
PACKAGE_BUILD=/usr/bin/pkgbuild
ARCH_FLAGS=-arch x86_64
.PHONY: build
RDM.app: SetResX Resources Info.plist monitor.icns
mkdir -p RDM.app/Contents/MacOS/
cp SetResX RDM.app/Contents/MacOS/
cp -r Info.plist Resources RDM.app/Contents
rm RDM.app/Contents/Resources/Icon_512x512.png
rm RDM.app/Contents/Resources/StatusIcon_sel.png
rm RDM.app/Contents/Resources/StatusIcon_sel@2x.png
mv monitor.icns RDM.app/Contents/Resources
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 -f *icns
rm -rf RDM.app
rm -rf pkgroot dmgroot
rm -f *.pkg *.dmg
%.o: %.mm
$(CC) $(CPPFLAGS) $(CFLAGS) $(ARCH_FLAGS) $< -c -o $@
%.icns: %.png
sips -s format icns $< --out $@
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