summaryrefslogtreecommitdiffstats
path: root/macosx/Makefile.in
blob: 10a0c61081ea32ab3f6b72552d4f9ac6290861fe (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
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@
JOBS		= @CORES@

TLSFLAGS	= "--with-ssl-dir=/opt/local"

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	=SAOImage\ DS9\ $(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 \
	tclcheckdns tcliis tclsignal \
	tclzvfs tls tclxml xpa \
	tkblt tktable tkimg \
	tkmpeg 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 \
	--config-cache --cache-file=$(prefix)/config.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 \
	--config-cache --cache-file=$(prefix)/config.cache

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 \
	--config-cache --cache-file=$(prefix)/config.cache

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

.PHONY	: tkmacosxclean

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

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

.PHONY	: tkmacosxdistclean

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/macosx/README dist/$(DS9APP)/.
	cp -rp bin/SAOImage\ DS9.app dist/$(DS9APP)/.
	hdiutil create -srcfolder dist/$(DS9APP) dist/$(DS9APP) 
	rm -rf dist/$(DS9APP)