summaryrefslogtreecommitdiffstats
path: root/macos/Makefile.in
blob: e16621c5830781918876e9318248c7f604355fd6 (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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
prefix		= @prefix@
exec_prefix	= @exec_prefix@

bindir		= @bindir@
libdir		= $(exec_prefix)/lib
#libdir		= @libdir@
includedir	= @includedir@
datarootdir	= @datarootdir@
datadir		= @datadir@
mandir		= @mandir@

OS		= @OS@
ARCH		= @ARCH@
TLSFLAGS	= @TLSFLAGS@
JOBS		= @CORES@

include ./make.include

WITHTCL		= --with-tcl=$(prefix)/build/tcl/Development
WITHTK		= --with-tk=$(prefix)/build/tk/Development $(WITHTCL)
CACHE		= --config-cache --cache-file=$(prefix)/config.cache

#--------------------------defines

DS9APP	=SAOImageDS9\ $(DS9_VERSION)

TCLFILES= \
	tcl$(TCL_VERSION)/generic/tcl.h \
	tcl$(TCL_VERSION)/generic/tclDecls.h \
	tcl$(TCL_VERSION)/generic/tclPlatDecls.h

TKFILES = \
	tk$(TCL_VERSION)/generic/tk.h \
	tk$(TCL_VERSION)/generic/tkDecls.h \
	tk$(TCL_VERSION)/generic/tkPlatDecls.h \
	tk$(TCL_VERSION)/generic/tkIntXlibDecls.h \
	tk$(TCL_VERSION)/macosx/tkMacOSX.h

#--------------------------build

.PHONY	: saods9 tcl tk tkmacosx

saods9	: dirs tcl tk \
	tcliis tclsignal \
	tls tclxml xpa \
	tkblt tktable tkimg \
	tkmpeg tkagif tkhtml1 tkcon \
	tkmacosx \
	tksao ds9

tcl	: tcl$(TCL_VERSION)/macosx/Makefile
	@echo ""
	@echo "*** $@ ***"
	$(MAKE) -C tcl$(TCL_VERSION)/macosx -j $(JOBS)

# install include, lib
	cp -p $(TCLFILES) include/.
	cp -p build/tcl/Tcl.framework/libtclstub8.6.a lib/.
	cp -rp build/tcl/Tcl.framework/Versions/8.6/Resources/Scripts lib/tcl8.6
	cp -rp build/tcl/Tcl.framework/Versions/8.6/Resources/tcl8 lib/.

# we need this also
	install_name_tool -change /Library/Frameworks/Tcl.framework/Versions/8.6/Tcl @executable_path/../Tcl.framework/Tcl build/tcl/Development/tclsh

# we need a working tclsh later
	cp -p build/tcl/tclsh8.6 bin/.
	install_name_tool -change /Library/Frameworks/Tcl.framework/Versions/8.6/Tcl @executable_path/../build/tcl/Tcl.framework/Tcl bin/tclsh8.6

tcl$(TCL_VERSION)/macosx/Makefile :
	@echo ""
	@echo "*** $@ ***"
	cd tcl$(TCL_VERSION)/macosx; \
	./configure \
	--enable-64bit \
	--enable-symbols \
	$(CACHE)

tk	: tk$(TCL_VERSION)/macosx/Makefile
	@echo ""
	@echo "*** $@ ***"
	$(MAKE) -C tk$(TCL_VERSION)/macosx -j $(JOBS)

# install include, lib
	cp -p $(TKFILES) include/.
	cp -p build/tk/Tk.framework/libtkstub8.6.a lib/.
	cp -rp build/tk/Tk.framework/Versions/8.6/Resources/Scripts lib/tk8.6

# we need this also
	install_name_tool -change /Library/Frameworks/Tcl.framework/Versions/8.6/Tcl @executable_path/../Tcl.framework/Tcl build/tk/Development/wish
	install_name_tool -change /Library/Frameworks/Tk.framework/Versions/8.6/Tk @executable_path/../Tk.framework/Tk build/tk/Development/wish

# fix wish8.6
	cp -p build/tk/wish8.6 bin/.
	install_name_tool -change /Library/Frameworks/Tcl.framework/Versions/8.6/Tcl @executable_path/../build/tcl/Tcl.framework/Tcl bin/wish8.6
	install_name_tool -change /Library/Frameworks/Tk.framework/Versions/8.6/Tk @executable_path/../build/tk/Tk.framework/Tk bin/wish8.6

tk$(TCL_VERSION)/macosx/Makefile :
	@echo ""
	@echo "*** $@ ***"
	cd tk$(TCL_VERSION)/macosx; \
	./configure \
	$(WITHTCL) \
	--enable-64bit \
	--enable-symbols \
	$(CACHE)

#-------------------------- tclsignal

tclsignal: tclsignal/Makefile
	@echo ""
	@echo "*** $@ ***"
	$(MAKE) -C tclsignal install

tclsignal/Makefile :
	@echo ""
	@echo "*** $@ ***"
	cd tclsignal; \
	./configure \
	$(WITHTCL) \
	$(PREFIX) \
	$(STD) \
	$(CACHE)

#-------------------------- tkmacosx

tkmacosx: tkmacosx/Makefile
	@echo ""
	@echo "*** $@ ***"
	$(MAKE) -C tkmacosx -j $(JOBS) install

tkmacosx/Makefile :
	@echo ""
	@echo "*** $@ ***"
	cd tkmacosx; \
	./configure \
	$(WITHTK) \
	--prefix $(prefix) --exec-prefix $(exec_prefix) --libdir $(libdir) \
	--disable-shared --enable-symbols \
	$(CACHE)

#--------------------------clean

.PHONY	: tclclean tkclean osclean tclsignalclean tkmacosxclean

tclclean :
	@echo ""
	@echo "*** tclclean ***"
	$(MAKE) -C tcl$(TCL_VERSION)/macosx clean

tkclean :
	@echo ""
	@echo "*** $@ ***"
	$(MAKE) -C tk$(TCL_VERSION)/macosx clean

osclean : tclsignalclean tkmacosxclean

tclsignalclean :
	@echo ""
	@echo "*** $@ ***"
	$(MAKE) -C tclsignal clean

tkmacosxclean :
	@echo ""
	@echo "*** $@ ***"
	$(MAKE) -C tkmacosx clean

#--------------------------distclean

.PHONY	: tcldistclean tkdistclean
.PHONY	: osdistclean tclsignaldistclean tkmacosxdistclean 

tcldistclean :
	@echo ""
	@echo "*** $@ ***"
	$(MAKE) -C tcl$(TCL_VERSION)/macosx distclean

tkdistclean :
	@echo ""
	@echo "*** $@ ***"
	$(MAKE) -C tk$(TCL_VERSION)/macosx distclean

osdistclean : tclsignaldistclean tkmacosxdistclean 

tclsignaldistclean :
	@echo ""
	@echo "*** $@ ***"
	$(MAKE) -C tclsignal distclean
	rm -f tclsignal/tclsignalConfig.sh

tkmacosxdistclean :
	@echo ""
	@echo "*** $@ ***"
	$(MAKE) -C tkmacosx distclean

#--------------------------distribution

.PHONY	: dist

dist	:
	rm -rf dist/$(DS9APP)
	rm -rf dist/$(DS9APP).dmg
	mkdir dist/$(DS9APP)
	ln -s /Applications dist/$(DS9APP)/.
	cp -r ds9/macos/README dist/$(DS9APP)/.
	cp -rp bin/SAOImageDS9.app dist/$(DS9APP)/.
	hdiutil create -srcfolder dist/$(DS9APP) dist/$(DS9APP) 
	rm -rf dist/$(DS9APP)