-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
94 lines (72 loc) · 3.11 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man
LANGUAGES = en de es fi fr
.PHONY: cli gui all clean install uninstall release
LAZARUS_OPTIONS=
ThisSystem:=$(shell uname)
ifeq ($(ThisSystem), Linux)
LAZARUS_OPTIONS=--ws=gtk2
endif
all: cli gui
cli: heatwizard.pp
fpc -O3 -CX -XX -OWall -FWheatwizard.wpo -Xs- heatwizard.pp
fpc -O3 -CX -XX -Owall -Fwheatwizard.wpo heatwizard.pp
strip heatwizard
gui: HeatWizard.lpr *.pas version.inc *.lfm *.lrs *.lrt
ifneq "`which lazbuild`" ""
ifeq ($(ThisSystem), Darwin)
lazbuild $(LAZARUS_OPTIONS) HeatWizard-MacOSX.lpi
else
lazbuild $(LAZARUS_OPTIONS) HeatWizard-Linux.lpi
endif
else
echo Lazarus not found. Please install lazarus and try again.
endif
ifneq "`which msgfmt`" ""
make -C languages
else
echo msgfmt not found. Please install gettext and try again.
endif
clean:
rm -f *.ppu *.o *.exe *.rc *.wpo HeatWizard heatwizard HeatWizard.compiled
install:
install -d $(BINDIR)
install -m 755 heatwizard $(BINDIR)
install -d $(MANDIR)/man1
install -m 644 heatwizard.1 $(MANDIR)/man1
@for language in $(LANGUAGES); do \
install -d ~/.heatwizard/languages/$$language/LC_MESSAGES ; \
install -v languages/heatwizard.$$language.mo ~/.heatwizard/languages/$$language/LC_MESSAGES/heatwizard.mo ; \
done
uninstall:
rm -rf $(BINDIR)/heatwizard
rm -rf $(MANDIR)/man1/heatwizard.1
rm -rf ~/.heatwizard
release: release-linux release-macosx
release-linux:
tar -cz -f HeatWizard.tar.gz README "GPL Header" COPYING Makefile HeatWizard.lpr version.inc *.lpi *.lrs *.lrt *.lfm *.pas languages/heatwizard.*.po languages/Makefile
tar -cj -f HeatWizard.tar.bz2 README "GPL Header" COPYING Makefile HeatWizard.lpr version.inc *.lpi *.lrs *.lrt *.lfm *.pas languages/heatwizard.*.po languages/Makefile
release-macosx: macosx-app macosx-dmg
macosx-app: all
strip Heat\ Wizard
rm -f Heat\ Wizard.app/Contents/MacOS/Heat\ Wizard
cp -f Heat\ Wizard Heat\ Wizard.app/Contents/MacOS/Heat\ Wizard
cp -f Heat\ Wizard\ Icon.icns Heat\ Wizard.app/Contents/Resources/Heat\ Wizard\ Icon.icns
cp -f PkgInfo Heat\ Wizard.app/Contents/PkgInfo
cp -f Info.plist Heat\ Wizard.app/Contents/Info.plist
@for language in $(LANGUAGES); do \
install -d Heat\ Wizard.app/Contents/Resources/languages/$$language/LC_MESSAGES ; \
install -v languages/heatwizard.$$language.mo Heat\ Wizard.app/Contents/Resources/languages/$$language/LC_MESSAGES/heatwizard.mo ; \
done
DISKIMAGESIZE = $(shell expr `stat -f "%z" Heat\ Wizard` / 300000)
macosx-dmg: Heat\ Wizard.app
hdiutil create -type SPARSE -size $(DISKIMAGESIZE)m -fs HFS+ -volname Heat\ Wizard -ov Heat\ Wizard.sparseimage
hdiutil attach Heat\ Wizard.sparseimage
cp -fR Heat\ Wizard.app /Volumes/Heat\ Wizard
rm -f Heat\ Wizard.app/Contents/MacOS/Heat\ Wizard
./CreateApplicationFolderAlias.sh
hdiutil detach /Volumes/Heat\ Wizard
rm -f Heat\ Wizard.dmg
hdiutil convert Heat\ Wizard.sparseimage -format UDBZ -o Heat\ Wizard.dmg
rm -f Heat\ Wizard.sparseimage