-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (53 loc) · 1.79 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
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env make -f
PREFIX=/usr/local
IDENTIFIER=org.targetdisk.RDeeM
VERSION ?= 2.5
PACKAGE_BUILD = $(shell which pkgbuild)
#ARCH_FLAGS=-arch x86_64 -arch arm64
.PHONY: build
RDeeM.app: SetResX Resources Info.plist monitor.icns
mkdir -p RDeeM.app/Contents/MacOS/
cp SetResX RDeeM.app/Contents/MacOS/
cp -r Info.plist Resources RDeeM.app/Contents
rm RDeeM.app/Contents/Resources/Icon_512x512.png
rm RDeeM.app/Contents/Resources/StatusIcon_sel.png
rm RDeeM.app/Contents/Resources/[email protected]
mv monitor.icns RDeeM.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 RDeeM.app
rm -rf dmgroot dmgroot.pkg pkgroot
rm -f *.pkg *.dmg
%.o: %.mm
$(CC) $(CPPFLAGS) $(CFLAGS) $(ARCH_FLAGS) $< -c -o $@
%.icns: %.png
sips -s format icns $< --out $@
pkg: RDeeM.app
mkdir -p pkgroot/Applications
cp -rv $< pkgroot/Applications/
$(PACKAGE_BUILD) --root pkgroot/ --identifier $(IDENTIFIER) \
--version $(VERSION) "RDeeM-$(VERSION).pkg"
rm -f RDeeM.pkg
ln -s RDeeM-$(VERSION).pkg RDeeM.pkg
pkgdmg: pkg
mkdir -p dmgroot.pkg
cp RDeeM-$(VERSION).pkg dmgroot.pkg/
rm -f RDeeM-installer-$(VERSION).dmg
hdiutil makehybrid -hfs -hfs-volume-name "RDeeM $(VERSION) Installer" \
-o "RDeeM-installer-$(VERSION).dmg" dmgroot.pkg/
rm -f RDeeM-installer.dmg
ln -s RDeeM-installer--$(VERSION).dmg RDeeM-installer.dmg
dmg: RDeeM.app
mkdir -p dmgroot
cp -rv $< dmgroot
rm -f RDeeM-$(VERSION).dmg
hdiutil makehybrid -hfs -hfs-volume-name "RDeeM $(VERSION)" \
-o "RDeeM-$(VERSION).dmg" dmgroot/
rm -f RDeeM.dmg
ln -s RDeeM-$(VERSION).dmg RDeeM.dmg
all: dmg pkg pkgdmg
.PHONY: pkg dmg build clean all