summaryrefslogtreecommitdiffstats
path: root/ds9/win/Makefile.in
blob: 9287810ca98eede525d1f741adf642d4e845af44 (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
prefix		= @prefix@
exec_prefix	= @exec_prefix@

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

include $(prefix)/make.pkgs

TCL_VERSION	= @TCL_VERSION@
TCL_LIB_SPEC	= @TCL_LIB_SPEC@
TCL_STUB_LIB_SPEC= @TCL_STUB_LIB_SPEC@
TK_LIBS		= @TK_LIBS@
TK_LIB_SPEC	= @TK_LIB_SPEC@
TK_STUB_LIB_SPEC= @TK_STUB_LIB_SPEC@

tifftcl_LIB_SPEC= @tifftcl_LIB_SPEC@
pngtcl_LIB_SPEC	= @pngtcl_LIB_SPEC@
jpegtcl_LIB_SPEC= @jpegtcl_LIB_SPEC@
zlibtcl_LIB_SPEC= @zlibtcl_LIB_SPEC@
tkimg_LIB_SPEC	= @tkimg_LIB_SPEC@

tkblt_LIB_SPEC	= @tkblt_LIB_SPEC@
tkhtml1_LIB_SPEC= @tkhtml1_LIB_SPEC@
tkmpeg_LIB_SPEC	= @tkmpeg_LIB_SPEC@
tksao_LIB_SPEC	= @tksao_LIB_SPEC@
tkwin_LIB_SPEC	= @tkwin_LIB_SPEC@

CC		= @CC@
CFLAGS_DEFAULT	= @CFLAGS_DEFAULT@
CFLAGS_WARNING	= @CFLAGS_WARNING@
EXEEXT		= @EXEEXT@
OBJEXT		= @OBJEXT@

INCLUDES	= @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@

PKG_CFLAGS	= @PKG_CFLAGS@
DEFS		= @DEFS@ $(PKG_CFLAGS)

CPPFLAGS	= @CPPFLAGS@
LIBS		= @PKG_LIBS@ @LIBS@
CFLAGS		= @CFLAGS@
COMPILE		= $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)

STRIP		= i686-w64-mingw32-strip.exe

.SUFFIXES: .c .C .$(OBJEXT)

.c.@OBJEXT@:
	$(COMPILE) -DSTATIC_BUILD -c $< -o $@

.C.@OBJEXT@:
	$(COMPILE) -DSTATIC_BUILD -c $< -o $@

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

OBJS	= ds9.o winMain.o ds9.res.o

LLIBS	= \
	$(libdir)/libfuntools.a \
	$(libdir)/libast.a \
	$(libdir)/libast_err.a \
	$(libdir)/libast_pal.a \
	$(libdir)/Tclxml$(TCLXMLVER)/Tclxml32.a \
	$(libdir)/Tktable$(TKTABLEVER)/Tktable210.a \
	$(libdir)/tkimgtiff$(TKIMGVER)/libtkimgtiff146.a \
	$(libdir)/tkimgpng$(TKIMGVER)/libtkimgpng146.a \
	$(libdir)/tkimgjpeg$(TKIMGVER)/libtkimgjpeg146.a \
	$(libdir)/tkimggif$(TKIMGVER)/libtkimggif146.a \
	$(libdir)/tkimgwindow$(TKIMGVER)/libtkimgwindow146.a \
	$(libdir)/libxpa.a \
	$(libdir)/libxml2.a \
	$(libdir)/libz.a

APPDIR	= $(bindir)/ds9app

#--------------------------main

.NOTPARALLEL :
.PHONY	: ds9 debug appdir framework tcltk tcllib tkcon tkblt xpa cleanup

ds9	: ds9Base$(EXEEXT) appdir framework tcltk tcllib tkcon tkblt xpa cleanup
	cp -p ds9base$(EXEEXT) ds9$(EXEEXT)
	$(STRIP) ds9$(EXEEXT)
	cp -p ds9$(EXEEXT) $(APPDIR)/.

debug	: ds9Base$(EXEEXT) appdir framework tcltk tcllib tkcon tkblt cleanup
	mv ds9base$(EXEEXT) ds9$(EXEEXT)
	cp -p ds9$(EXEEXT) $(APPDIR)/.

ds9Base$(EXEEXT): $(OBJS) $(LLIBS)
	$(RM) $@
	$(CC) $(CFLAGS)	-o $@ \
	$(OBJS) \
	$(tksao_LIB_SPEC) \
	$(LLIBS) \
	$(tifftcl_LIB_SPEC) \
	$(pngtcl_LIB_SPEC) \
	$(jpegtcl_LIB_SPEC) \
	$(zlibtcl_LIB_SPEC) \
	$(tkimg_LIB_SPEC) \
	$(tkblt_LIB_SPEC) \
	$(tkhtml1_LIB_SPEC) \
	$(tkmpeg_LIB_SPEC) \
	$(tksao_LIB_SPEC) \
	$(tkwin_LIB_SPEC) \
	$(TK_STUB_LIB_SPEC) $(TK_LIB_SPEC) \
	$(TCL_STUB_LIB_SPEC) $(TCL_LIB_SPEC) \
	$(TK_LIBS) \
	$(LIBS) \
	-mwindows -static

winMain.o : winMain.c
	$(COMPILE) \
	-DSTATIC_BUILD \
	-DTK_LOCAL_APPINIT=SAOAppInit -DTK_LOCAL_MAIN_HOOK=SAOLocalMainHook \
	-c winMain.c -o $@

winMain.c : $(prefix)/tk$(TCL_VERSION)/win/winMain.c
	cp $(prefix)/tk$(TCL_VERSION)/win/winMain.c .

ds9.res.o: ds9.rc ds9.ico
	i686-w64-mingw32-windres -o $@ \
	--define STATIC_BUILD --include $(prefix)/tk$(TCL_VERSION)/generic \
	--include $(prefix)/$(TCLDIR)/generic --include $(prefix)/tk$(TCL_VERSION)/win/rc \
	ds9.rc

appdir	:
	rm -rf $(APPDIR)
	mkdir $(APPDIR)

framework:
	cp install.vbs $(APPDIR)/.
	cp -pr ../library $(APPDIR)/.
	cp -pr ../msgs $(APPDIR)/.
	cp -pr ../doc $(APPDIR)/.
	cp -pr ../cmaps $(APPDIR)/.
	cp -pr ../template $(APPDIR)/.
	echo "pkg_mkIndex ../../bin/ds9app/library *.tcl; exit" | $(bindir)/tclsh86s

tcltk	:
	cp -pr $(prefix)/lib/tcl8 $(APPDIR)/.
	cp -pr $(prefix)/lib/tcl8.6 $(APPDIR)/.
	cp -pr $(prefix)/lib/tk8.6 $(APPDIR)/.

tkblt	:
	mkdir $(APPDIR)/tkblt
	cp -p $(prefix)/tkblt/library/graph.tcl $(APPDIR)/tkblt/.
	echo "pkg_mkIndex ../../bin/ds9app/tkblt *.tcl; exit" | $(bindir)/tclsh86s

tcllib	:
	cp -pr $(prefix)/tcllib/modules/base64 $(APPDIR)/.
	cp -pr $(prefix)/tcllib/modules/ftp $(APPDIR)/.
	cp -pr $(prefix)/tcllib/modules/log $(APPDIR)/.
	cp -pr $(prefix)/tcllib/modules/textutil $(APPDIR)/.
	cp -pr $(prefix)/tcllib/modules/math $(APPDIR)/.

tkcon	:
	mkdir $(APPDIR)/tkcon
	cp -p $(prefix)/tkcon/*.tcl $(APPDIR)/tkcon/.

xpa	:
	cp -p $(bindir)/xpans.exe $(APPDIR)/.

cleanup:
	cd $(APPDIR); find . -depth -name CVS -exec rm -rf {} \;

#--------------------------cleanup

.PHONY	: clean distclean

clean	:
	cd ../library; $(MAKE) clean
	$(RM) core *~ *# ds9Base ds9 *.o

distclean: clean
	-rm -f Makefile config.cache config.log config.status
	-rm -rf autom4te.cache