-
-
Notifications
You must be signed in to change notification settings - Fork 119
/
Copy pathMakefile.osx
113 lines (98 loc) · 3.56 KB
/
Makefile.osx
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Reverse Engineer's Hex Editor
# Copyright (C) 2019-2022 Daniel Collins <[email protected]>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 51
# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
ICONUTIL ?= $(shell which iconutil > /dev/null && echo iconutil)
PNG2ICNS ?= $(shell which png2icns > /dev/null && echo png2icns)
EXTRA_APP_OBJS := \
res/backward32.o \
res/document_new32.o \
res/document_open32.o \
res/document_save32.o \
res/document_save_as32.o \
res/down32.o \
res/forward32.o \
res/up32.o \
src/AppMac.o
EXTRA_TEST_OBJS := \
res/backward32.o \
res/document_new32.o \
res/document_open32.o \
res/document_save32.o \
res/document_save_as32.o \
res/down32.o \
res/forward32.o \
res/up32.o \
src/AppMac.o
# Mac OS doesn't come with pkg-config, so default to some reasonable assumptions.
CAPSTONE_CFLAGS ?=
CAPSTONE_LIBS ?= -lcapstone
JANSSON_CFLAGS ?=
JANSSON_LIBS ?= -ljansson
LUA_CFLAGS ?=
LUA_LIBS ?= -llua
CFLAGS += -DREHEX_CACHE_STRING_BITMAPS
CXXFLAGS += -DREHEX_CACHE_STRING_BITMAPS
all: REHex.app
include Makefile
src/mainwindow.$(BUILD_TYPE).o: res/backward32.h res/document_new32.h res/document_open32.h res/document_save32.h res/document_save_as32.h res/forward32.h
src/DiffWindow.$(BUILD_TYPE).o: res/down32.h res/up32.h
ICONSET := res/REHex.iconset
ICNS := res/REHex.icns
DMGTMP := tmp/dmg
REHex.app: res/Info.plist $(EXE) $(ICNS) $(HELP_TARGET)
mkdir -p $@/
mkdir -p $@/Contents/
cp res/Info.plist $@/Contents/Info.plist
mkdir -p $@/Contents/MacOS/
cp $(EXE) $@/Contents/MacOS/REHex
mkdir -p $@/Contents/Resources/
cp $(ICNS) $@/Contents/Resources/REHex.icns
ifneq ($(BUILD_HELP),0)
cp help/rehex.htb $@/Contents/Resources/
endif
rm -rf $@/Contents/PlugIns/
for p in $(PLUGINS); \
do \
$(MAKE) -C plugins/$${p} PLUGINS_INST_DIR="$$(pwd)/$@/Contents/PlugIns" install; \
done
$(ICNS): res/icon16.png res/icon32.png res/icon256.png res/icon512.png
ifneq ($(ICONUTIL),)
rm -rf $(ICONSET)
mkdir $(ICONSET)
cp res/icon16.png $(ICONSET)/icon_16x16.png
cp res/icon32.png $(ICONSET)/[email protected]
cp res/icon32.png $(ICONSET)/icon_32x32.png
cp res/icon64.png $(ICONSET)/[email protected]
cp res/icon128.png $(ICONSET)/icon_128x128.png
cp res/icon256.png $(ICONSET)/[email protected]
cp res/icon256.png $(ICONSET)/icon_256x256.png
cp res/icon512.png $(ICONSET)/[email protected]
cp res/icon512.png $(ICONSET)/icon_512x512.png
cp res/icon1024.png $(ICONSET)/[email protected]
$(ICONUTIL) -c icns -o $@ $(ICONSET)
else ifneq ($(PNG2ICNS),)
$(PNG2ICNS) $@ res/icon{16,32,128,256,512}.png
else
$(error Neither iconutil nor png2icns found in PATH. Install one or set ICONUTIL/PNG2ICNS as necessary)
endif
REHex.dmg: REHex.app
rm -rf $(DMGTMP)
mkdir -p $(DMGTMP)
cp -a REHex.app $(DMGTMP)/REHex.app
hdiutil create $@ -ov -volname "REHex" -format UDZO -srcfolder $(DMGTMP)
%.o: %.mm
$(DEPPRE)
$(CXX) $(CXXFLAGS) $(DEPFLAGS) -c -o $@ $<
$(DEPPOST)