blob: e662ab92d54eae9577e99eca6d8d6292478d48f9 (
plain)
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
MAC_APP_DIR=MonoDevelop.app
APP_NAME=MonoDevelop
APP_DISPLAY_NAME=MonoDevelop
MACOS=$(MAC_APP_DIR)/Contents/MacOS
LIB_DIR=$(MAC_APP_DIR)/Contents/Resources/lib
MAC_APP_LIB_DIR=$(LIB_DIR)/monodevelop
ADDINS=$(MAC_APP_LIB_DIR)/AddIns
EXTRAS=$(top_srcdir)/../extras
ARTIFACTS=$(top_srcdir)/../../artifacts
MD_CONFIGURE=$(top_srcdir)/../scripts/configure.sh
EXTERNAL=../../external
MONOSTUB_STATIC_LINK=$(EXTERNAL)/Xamarin.Mac.registrar.full.a
if !RELEASE_BUILDS
HYBRID_SUSPEND_ABORT_DEBUG=-DHYBRID_SUSPEND_ABORT_DEBUG
endif
#SDK_PATH=$(shell xcrun --sdk macosx10.8 --show-sdk-path)
PACKAGE_UPDATE_ID=$(shell $(MD_CONFIGURE) get-releaseid)
BUNDLE_VERSION=$(shell $(MD_CONFIGURE) get-version)
CLEANFILES = render.exe monostub monostub-test
#DISTCLEANFILES =
EXTRA_DIST = dmg-bg.png DS_Store Info.plist.in make-dmg-bundle.sh render.cs
MONOSTUB_EXTRA_SOURCEFILES = monostub-utils.h
export MACOSX_DEPLOYMENT_TARGET=10.12
all: monostub monostub-nogui monostub-test
render.exe: render.cs
mcs -r:System.Drawing render.cs
dmg: render.exe app
./make-dmg-bundle.sh
monostub.o: monostub.mm $(MONOSTUB_EXTRA_SOURCEFILES)
g++ -g $(HYBRID_SUSPEND_ABORT) -c -Wall -m$(MONOSTUB_ARCH) -o $@ monostub.mm
monostub-nogui.o: monostub.mm $(MONOSTUB_EXTRA_SOURCEFILES)
g++ -g $(HYBRID_SUSPEND_ABORT) -DNOGUI -c -Wall -m$(MONOSTUB_ARCH) -o $@ monostub.mm
monostub: monostub.o $(MONOSTUB_STATIC_LINK)
clang++ -g -Wall -m$(MONOSTUB_ARCH) -o $@ -Wl,-all_load $^ -framework AppKit -framework Quartz -undefined dynamic_lookup
mkdir -p ../bin
cp $@ ../bin/MonoDevelop
monostub-nogui: monostub-nogui.o $(MONOSTUB_STATIC_LINK)
clang++ -g -Wall -m$(MONOSTUB_ARCH) -o $@ -Wl,-all_load $^ -framework AppKit -framework Quartz -undefined dynamic_lookup
mkdir -p ../bin
cp $@ ../bin/mdtool
monostub-test: monostub-test.m $(MONOSTUB_EXTRA_SOURCEFILES)
gcc -g -Wall -m$(MONOSTUB_ARCH) -o $@ monostub-test.m -framework AppKit
./monostub-test
clean-local:
rm -rf MonoDevelop.app
rm -f MonoDevelop*.dmg
rm -f *.o
app: monostub monostub-test
@echo ""
@echo "Creating directories in app bundle"
@echo ""
mkdir -p $(MAC_APP_DIR)/Contents/{MacOS,Resources}
mkdir -p $(MAC_APP_DIR)/Contents/MacOS/share
mkdir -p $(MAC_APP_LIB_DIR)
# @echo ""
# @echo "Copying install prefix into app bundle"
# @echo ""
# @if [[ "$(prefix)" == /Library* ]] || [[ "$(prefix)" == /usr* ]]; then \
# echo "WARNING: cannot merge system prefix $(prefix)"; \
# else \
# echo "cp -pR $(prefix)/* $(MAC_APP_DIR)/Contents/MacOS/"; \
# cp -pR $(prefix)/* $(MAC_APP_DIR)/Contents/MacOS/; \
# fi
@echo ""
@echo "Copying MonoDevelop into app bundle"
@echo ""
cp -pR ../AddIns $(MAC_APP_LIB_DIR)
cp -pR ../data $(MAC_APP_LIB_DIR)
cp -pR ../bin $(MAC_APP_LIB_DIR)
cp -pR ../locale $(MAC_APP_DIR)/Contents/MacOS/share
mkdir -p $(MAC_APP_DIR)/Contents/MacOS/share/monodevelop
cp ../../COPYING $(MAC_APP_DIR)/Contents/MacOS/share/monodevelop/COPYING.LGPL2.1
sed -e "s/@BUNDLE_VERSION@/$(BUNDLE_VERSION)/" -e "s/@APP_NAME@/$(APP_NAME)/" -e "s/@APP_DISPLAY_NAME@/$(APP_DISPLAY_NAME)/" -e "s|@RELEASE_ID@|$(PACKAGE_UPDATE_ID)|" Info.plist.in > $(MAC_APP_DIR)/Contents/Info.plist
cp ../../theme-icons/Mac/*.icns $(MAC_APP_DIR)/Contents/Resources/
# Native launch scripts
@echo ""
@echo "Copying launch scripts into app bundle"
@echo ""
cp monostub $(MACOS)/MonoDevelop
cp monostub $(MACOS)/mdtool
# Remove addins that don't work on OSX
@echo ""
@echo "Removing unsupported addins"
@echo ""
rm -rf $(ADDINS)/GnomePlatform* \
$(ADDINS)/WindowsPlatform*
# remove stuff we don't need
@echo ""
@echo "Removing unneeded files"
@echo ""
rm -rf $(MAC_APP_LIB_DIR)/bin/UnitTests.dll* \
$(MAC_APP_LIB_DIR)/bin/TestResult.xml \
$(MAC_APP_LIB_DIR)/bin/addin-db* \
$(MAC_APP_LIB_DIR)/bin/local \
$(MAC_APP_LIB_DIR)/bin/repository-cache* \
$(MAC_APP_LIB_DIR)/bin/addins-setup.config \
$(MAC_APP_LIB_DIR)/AddIns/MonoDevelop.TextTemplating/Mono.TextTemplating.Tests*
# add the binary artifacts if they exist
@echo ""
@echo "Copying binary artifacts into app bundle"
@echo ""
mkdir -p $(LIB_DIR)/pkgconfig
mkdir -p $(MACOS)/MonoDoc.app/
test ! -d $(ARTIFACTS)/MonoDoc.app || cp -pR $(ARTIFACTS)/MonoDoc.app/* $(MACOS)/MonoDoc.app/
cp -r MDMonitor.app $(MACOS)
# update revision in updateinfo
@echo ""
@echo "Updating build information"
@echo ""
$(MD_CONFIGURE) gen-buildinfo "$(MAC_APP_LIB_DIR)/bin"
# touch the directory so that update dependencies work
touch MonoDevelop.app
@echo ""
@cat "$(MAC_APP_LIB_DIR)/bin/buildinfo"
@if test -f missing-stuff; then echo ""; echo "Missing stuff:"; cat missing-stuff; fi
@echo ""
@rm -f missing-stuff
.PHONY: app dmg
|