-
Notifications
You must be signed in to change notification settings - Fork 19
/
makefile.include
208 lines (171 loc) · 7.49 KB
/
makefile.include
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
208
# -*- Makefile -*-
#
# This file should be included from your platform specific
# Makefile. See the README documents and config.sh.
#
# NOTE: this file requires GNU Make.
#
EXTDIR = ../../../../8.x
STATIC = --disable-shared
OUTDIR = $(shell pwd)/build
OBJ = $(OUTDIR)/pwb$O $(OUTDIR)/rechan$O $(OUTDIR)/zlib$O
CLIOBJ ?= $(OBJ) $(OUTDIR)/tclAppInit$O
DYNOBJ ?= $(CLIOBJ)
GUIOBJ ?= $(CLIOBJ)
KITFLAGS ?=
TCLDIR = --with-tcl=../lib --prefix=$(OUTDIR) --exec-prefix=$(OUTDIR)
STRIP ?= strip
UPX ?= :
O ?=.o
A ?=.a
SO ?=.so
tclkit-cli$(EXE): kit-cli$(EXE) ../../setupvfs.tcl build/files
cp kit-cli$(EXE) $@ && $(STRIP) $@ && $(UPX) $@
./kit-cli -init- ../../setupvfs.tcl $(KIT_OPTS) $@ cli
./$@ ../../validate.tcl
tclkit-dyn$(EXE): kit-dyn$(EXE) ../../setupvfs.tcl build/files
cp kit-dyn$(EXE) $@ && $(STRIP) $@ $@ && $(UPX) $@
./kit-cli -init- ../../setupvfs.tcl $(KIT_OPTS) $@ dyn
tclkit-gui$(EXE): kit-cli$(EXE) kit-gui$(EXE) ../../setupvfs.tcl build/files
cp kit-gui$(EXE) $@ && $(STRIP) $@ && $(UPX) $@
./kit-cli -init- ../../setupvfs.tcl $(KIT_OPTS) $@ gui
kit-cli$(EXE): build/tcl build/tclvfs build/vqtcl build/zlib $(CLIOBJ)
$(CC) -o $@ $(CFLAGS) ../../kitInit.c $(CLIOBJ) \
-Ibuild/include -DKIT_LITE -DSTATIC_BUILD $(KITFLAGS) \
build/lib/vfs1*/*vfs1*$A build/lib/vqtcl4*/*vqtcl4*$A \
build/lib/libz$A build/lib/*tcl8*$A $(LDFLAGS)
kit-dyn$(EXE): build/tcl build/tclvfs build/vqtcl build/zlib build/tkdyn $(CLIOBJ)
$(CC) -o $@ $(CFLAGS) ../../kitInit.c $(DYNOBJ) \
-Ibuild/include -DKIT_LITE -DSTATIC_BUILD $(KITFLAGS) \
build/lib/vfs1*/*vfs1*$A build/lib/vqtcl4*/*vqtcl4*$A \
build/lib/libz$A build/lib/*tcl8*$A $(LDFLAGS)
kit-gui$(EXE): build/tcl build/tk build/tclvfs build/vqtcl build/zlib $(GUIOBJ)
$(CC) -o $@ $(CFLAGS) ../../kitInit.c $(GUIOBJ) \
-Ibuild/include -DKIT_LITE -DSTATIC_BUILD $(KITFLAGS) \
build/lib/vfs1*/*vfs1*$A build/lib/vqtcl4*/*vqtcl4*$A \
-DKIT_INCLUDES_TK build/lib/libtk8*$A \
build/lib/libz$A build/lib/*tcl8*$A $(LDFLAGS) $(GUI_OPTS)
build/files:
mkdir -p $@ && cd $@ && cp -p ../../../../files/* .
build/tcl:
mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
sh ../../../tcl/$(PLAT)/configure $(STATIC) $(TCL_OPTS) \
--prefix=$(OUTDIR) --exec-prefix=$(OUTDIR) && \
$(MAKE) install-binaries install-libraries $(PRIV)
threaded: build/threaddyn
build/threaddyn: build/tcl
mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
sh $(EXTDIR)/thread/configure $(TCLDIR) $(THREADDYN_OPTS) && \
$(MAKE) install-binaries install-libraries
thread: build/thread
build/thread: build/tcl
mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
sh $(EXTDIR)/thread/configure $(STATIC) $(TCLDIR) $(THREAD_OPTS) && \
$(MAKE) install-binaries install-libraries
build/tk: build/tcl
mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
sh ../../../tk/$(PLAT)/configure $(STATIC) $(TCLDIR) $(TK_OPTS) && \
$(MAKE) install-binaries install-libraries $(PRIV)
build/tkdyn: build/tcl
mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
sh ../../../tk/$(PLAT)/configure $(TCLDIR) $(TKDYN_OPTS) && \
$(MAKE) binaries && $(STRIP) $(LDSTRIP) *tk8*$(SO) && \
$(MAKE) install-binaries install-libraries
build/tclvfs: build/tcl
mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
sh $(EXTDIR)/tclvfs/configure $(STATIC) $(TCLDIR) $(VFS_OPTS) && \
$(MAKE) install
build/vqtcl: build/tcl
mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
sh $(EXTDIR)/vqtcl/configure $(STATIC) $(TCLDIR) $(VLERQ_OPTS) && \
$(MAKE) install
build/zlib: build/tcl
cp -R ../../8.x/zlib/. $@
ifeq ($(PLAT),win)
cd $@ && make -f win32/Makefile.gcc libz.a && \
cp libz.a ../lib/libz.a && \
cp zlib.h zconf.h ../include/
else
cd $@ && CC=$(CC) CFLAGS=$(CFLAGS) sh configure && \
$(MAKE) install prefix=..
endif
base: build/tcl build/tk
ls -l build/bin
tidy: cleanext
rm -rf build/tcl build/tk build/tkdyn
cleanext:
rm -rf build/tclvfs build/thread build/vqtcl build/zlib build/*.o
rm -rf build/lib/vfs* build/lib/thread* build/lib/vqtcl*
clean:
rm -rf build kit-cli$(EXE) kit-gui$(EXE) kit-dyn$(EXE) kitsh$(EXE) kit$(EXE)
distclean: clean
rm -f tclkit-cli$(EXE) tclkit-dyn$(EXE) tclkit-gui$(EXE) tclkitsh$(EXE) tclkit$(EXE)
.PHONY: all base clean distclean threaded tidy
$(OUTDIR)/pwb$O: ../../pwb.c
$(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include -c $<
$(OUTDIR)/rechan$O: ../../rechan.c
$(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include -c $<
$(OUTDIR)/zlib$O: ../../zlib.c
$(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include -c $<
$(OUTDIR)/tclAppInit$O: ../tcl/$(PLAT)/tclAppInit.c
$(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include \
-DTCL_LOCAL_APPINIT=TclKit_AppInit -c $<
$(OUTDIR)/winMain$O: ../tk/$(PLAT)/winMain.c
$(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include \
-DTK_LOCAL_APPINIT=TclKit_AppInit -c $<
$(OUTDIR)/tclkit.res.o: ../../tclkit.rc
cp $< build/tk/tclkit.rc
windres -o $@ --define STATIC_BUILD --define TCLKIT_WITH_TK \
--define BASE_NO_TK_ICON --include build/include \
--include build/tk --include ../../files --include ../tk/win/rc \
build/tk/tclkit.rc
$(OUTDIR)/tclkitsh.res.o: ../../tclkit.rc
windres -o $@ --define STATIC_BUILD --include build/include \
--include ../../files $<
#-------------------------------------------------------------------------
# Old-style builds -
# This section produces an old-style tclkit and tclkitsh that use
# metakit and include incr-tcl statically linked in.
tclkitsh$(EXE): kitsh$(EXE) ../../setupvfs.tcl build/files
cp kitsh$(EXE) $@ && $(STRIP) $@ && $(UPX) $@
./kitsh -init- ../../setupvfs.tcl $(KIT_OPTS) $@ cli
./$@ ../../validate.tcl
# the windows executable uses tk not tkdyn and is linked differently
ifeq ($(PLAT),win)
tclkit$(EXE): kitsh$(EXE) kit$(EXE) ../../setupvfs.tcl build/files
cp kit$(EXE) $@ && $(STRIP) $@ && $(UPX) $@
./kitsh -init- ../../setupvfs.tcl $(KIT_OPTS) $@ gui
else
tclkit$(EXE): kitsh$(EXE) build/tkdyn ../../setupvfs.tcl build/files
cp kitsh$(EXE) $@ && $(STRIP) $@ && $(UPX) $@
./kitsh -init- ../../setupvfs.tcl $(KIT_OPTS) $@ dyn
endif
kitsh$(EXE): build/tcl build/tclvfs build/mk build/itcl build/zlib $(CLIOBJ)
$(CC) -o $(OUTDIR)/kitInit$O $(CFLAGS) -DSTATIC_BUILD \
-DKIT_INCLUDES_ITCL $(KITFLAGS) \
-Ibuild/include -c ../../kitInit.c
$(CXX) -o $@ $(CFLAGS) $(OUTDIR)/kitInit$O $(CLIOBJ) \
-Ibuild/include -DSTATIC_BUILD \
build/lib/vfs1*/*vfs1*$A build/lib/Mk4tcl*/*Mk4tcl*$A \
build/lib/itcl*/*itcl3*$A \
build/lib/libz$A build/lib/*tcl8*$A $(LDFLAGS) $(LDXXFLAGS)
kit$(EXE): build/tcl build/tk build/tclvfs build/mk build/itcl build/zlib $(GUIOBJ)
$(CC) -o $(OUTDIR)/kitInit$O $(CFLAGS) -DSTATIC_BUILD \
-DKIT_INCLUDES_ITCL -DKIT_INCLUDES_TK $(KITFLAGS) \
-Ibuild/include -c ../../kitInit.c
$(CXX) -o $@ $(CFLAGS) $(OUTDIR)/kitInit$O $(GUIOBJ) \
-Ibuild/include -DSTATIC_BUILD \
build/lib/vfs1*/*vfs1*$A build/lib/Mk4tcl*/*Mk4tcl*$A \
build/lib/libtk8*$A build/lib/itcl*/*itcl3*$A \
build/lib/libz$A build/lib/*tcl8*$A $(LDFLAGS) $(LDXXFLAGS) \
$(GUI_OPTS)
build/mk: build/tcl
mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
sh $(EXTDIR)/mk/tcl/configure $(STATIC) $(TCLDIR) $(MK_OPTS) && \
$(MAKE) install-binaries install-libraries
build/itcl: build/tcl
mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
sh $(EXTDIR)/itcl/configure $(STATIC) $(TCLDIR) $(ITCL_OPTS) && \
$(MAKE) install-binaries install-libraries
# end
#-------------------------------------------------------------------------