1 | # -*- Makefile -*-
|
---|
2 | # NOTE: this file requires GNU Make.
|
---|
3 | #
|
---|
4 | #PLAT = unix
|
---|
5 | #PRIV = install-private-headers
|
---|
6 | #
|
---|
7 | # Linux:
|
---|
8 | #LDFLAGS = -L/usr/X11R6/lib -lX11 -ldl -lm # -lpthread
|
---|
9 | #
|
---|
10 | # Mac OS X:
|
---|
11 | #LDFLAGS = -framework CoreFoundation -L/usr/X11R6/lib -lX11 -weak-lXss -lXext
|
---|
12 | #LDFLAGS = -framework CoreFoundation -framework Carbon -framework IOKit
|
---|
13 | #LDSTRIP = -x
|
---|
14 |
|
---|
15 | EXTDIR = ../../../../8.x
|
---|
16 | STATIC = --disable-shared --enable-static
|
---|
17 | OUTDIR = $(shell pwd)/build
|
---|
18 | OBJ = $(OUTDIR)/zvfs$O $(OUTDIR)/zlib$O $(OUTDIR)/usb$O \
|
---|
19 | $(OUTDIR)/g2lite$O $(OUTDIR)/swt$O $(OUTDIR)/csr_test$O
|
---|
20 | GUIOBJ ?= $(OBJ) $(OUTDIR)/tclAppInit$O
|
---|
21 | TCLDIR = --with-tcl=$(OUTDIR)/lib --prefix=$(OUTDIR) --exec-prefix=$(OUTDIR)
|
---|
22 | STRIP ?= strip
|
---|
23 | UPX ?= :
|
---|
24 | O ?=.o
|
---|
25 | A ?=.a
|
---|
26 | SO ?=.so
|
---|
27 |
|
---|
28 | BLT_OPTS = --disable-threads
|
---|
29 | VFS_OPTS = --disable-threads
|
---|
30 | TDOM_OPTS = --disable-threads
|
---|
31 | TCLX_OPTS = --disable-threads
|
---|
32 | XOTCL_OPTS = --disable-threads
|
---|
33 | SQLITE_OPTS = --disable-threads
|
---|
34 | ZLIB_OPTS = --prefix=$(OUTDIR)
|
---|
35 | LIBUSB_OPTS = --prefix=$(OUTDIR)
|
---|
36 |
|
---|
37 | tclkit-gui$(EXE): kit-gui$(EXE) ../../setupvfs.tcl build/files
|
---|
38 | cp kit-gui$(EXE) $@
|
---|
39 | sleep 3
|
---|
40 | $(STRIP) $@
|
---|
41 | $(UPX) $@
|
---|
42 | ./kit-gui -init- ../../setupvfs.tcl $(KIT_OPTS) $@ gui
|
---|
43 |
|
---|
44 | ifeq ($(PLAT), unix)
|
---|
45 | kit-gui$(EXE): build/tcl build/tk build/blt build/tclvfs build/zlib \
|
---|
46 | build/tdom build/tcllib build/xotcl build/sqlite build/libusb $(GUIOBJ)
|
---|
47 | $(CC) -o $@ $(CFLAGS) ../../kitInit.c $(GUIOBJ) \
|
---|
48 | -Ibuild/include -DKIT_LITE -DSTATIC_BUILD \
|
---|
49 | build/lib/vfs1*/*vfs1*$A \
|
---|
50 | -DKIT_INCLUDES_TK build/lib/*tk8*$A \
|
---|
51 | build/lib/libz$A build/lib/libusb$A \
|
---|
52 | build/lib/*tcl8*$A \
|
---|
53 | build/lib/BLT2*/*BLT2*$A \
|
---|
54 | build/lib/tdom0*/*tdom0*$A \
|
---|
55 | build/lib/sqlite3*/*sqlite3*$A \
|
---|
56 | build/lib/xotcl1*/*xotcl1*$A \
|
---|
57 | $(LDFLAGS) $(GUI_OPTS)
|
---|
58 | endif
|
---|
59 |
|
---|
60 | ifeq ($(PLAT), win)
|
---|
61 | kit-gui$(EXE): build/tcl build/tk build/blt build/tclvfs build/zlib \
|
---|
62 | build/tdom build/tcllib build/xotcl build/sqlite build/libusb-win32 $(GUIOBJ)
|
---|
63 | $(CC) -o $@ $(CFLAGS) ../../kitInit.c $(GUIOBJ) \
|
---|
64 | -Ibuild/include -DKIT_LITE -DSTATIC_BUILD \
|
---|
65 | build/lib/vfs1*/*vfs1*$A \
|
---|
66 | -DKIT_INCLUDES_TK build/lib/*tk8*$A \
|
---|
67 | build/lib/libz$A build/lib/libusb$A \
|
---|
68 | build/lib/*tcl8*$A \
|
---|
69 | build/lib/BLT2*/*BLT2*$A \
|
---|
70 | build/lib/tdom0*/*tdom0*$A \
|
---|
71 | build/lib/sqlite3*/*sqlite3*$A \
|
---|
72 | build/lib/xotcl1*/*xotcl1*$A \
|
---|
73 | $(LDFLAGS) $(GUI_OPTS)
|
---|
74 | endif
|
---|
75 |
|
---|
76 |
|
---|
77 |
|
---|
78 | build/files:
|
---|
79 | mkdir -p $@ && cd $@ && ln -s ../../../../files/* .
|
---|
80 |
|
---|
81 | build/tcl:
|
---|
82 | mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
|
---|
83 | sh ../../../tcl/$(PLAT)/configure $(STATIC) $(TCL_OPTS) \
|
---|
84 | --prefix=$(OUTDIR) --exec-prefix=$(OUTDIR) && \
|
---|
85 | $(MAKE) install-binaries install-libraries $(PRIV)
|
---|
86 |
|
---|
87 | build/tk: build/tcl
|
---|
88 | mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
|
---|
89 | sh ../../../tk/$(PLAT)/configure $(STATIC) $(TCLDIR) $(TK_OPTS) && \
|
---|
90 | $(MAKE) install-binaries install-libraries $(PRIV)
|
---|
91 |
|
---|
92 | build/blt: build/tk
|
---|
93 | mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
|
---|
94 | sh $(EXTDIR)/blt/configure $(STATIC) $(TCLDIR) $(BLT_OPTS) && \
|
---|
95 | $(MAKE) install-binaries install-libraries
|
---|
96 |
|
---|
97 | build/tclvfs: build/tcl
|
---|
98 | mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
|
---|
99 | sh $(EXTDIR)/tclvfs/configure $(STATIC) $(TCLDIR) $(VFS_OPTS) && \
|
---|
100 | $(MAKE) install
|
---|
101 |
|
---|
102 | build/zlib: build/tcl
|
---|
103 | cp -R ../../8.x/zlib/. $@
|
---|
104 | cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
|
---|
105 | sh $(EXTDIR)/zlib/configure $(ZLIB_OPTS) && \
|
---|
106 | $(MAKE) install
|
---|
107 |
|
---|
108 | build/libusb-win32: build/tcl
|
---|
109 | cp -R ../../8.x/libusb-win32/. $@
|
---|
110 | cd $@ && $(MAKE) && cp libusb.a ../lib/ && cp lusb0_usb.h ../include/usb.h
|
---|
111 |
|
---|
112 | build/libusb: build/tcl
|
---|
113 | cp -R ../../8.x/libusb/. $@
|
---|
114 | cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
|
---|
115 | sh configure $(LIBUSB_OPTS) && \
|
---|
116 | $(MAKE) && $(MAKE) install
|
---|
117 |
|
---|
118 | build/tdom: build/tcl
|
---|
119 | mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
|
---|
120 | sh $(EXTDIR)/tdom/configure $(STATIC) $(TCLDIR) $(TDOM_OPTS) && \
|
---|
121 | $(MAKE) install
|
---|
122 |
|
---|
123 | build/tcllib: build/tcl
|
---|
124 | mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
|
---|
125 | sh $(EXTDIR)/tcllib/configure $(STATIC) $(TCLDIR) $(TCLLIB_OPTS) && \
|
---|
126 | $(MAKE) install-libraries
|
---|
127 |
|
---|
128 | build/xotcl: build/tcl
|
---|
129 | mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
|
---|
130 | sh $(EXTDIR)/xotcl/configure $(STATIC) $(TCLDIR) $(XOTCL_OPTS) && \
|
---|
131 | $(MAKE) install-binaries
|
---|
132 |
|
---|
133 | build/sqlite: build/tcl
|
---|
134 | mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
|
---|
135 | sh $(EXTDIR)/sqlite/tea/configure $(STATIC) $(TCLDIR) $(SQLITE_OPTS) && \
|
---|
136 | $(MAKE) install-binaries
|
---|
137 |
|
---|
138 | base: build/tcl build/tk
|
---|
139 | ls -l build/bin
|
---|
140 |
|
---|
141 | tidy: cleanext
|
---|
142 | rm -rf build/tcl build/tk build/tkdyn
|
---|
143 |
|
---|
144 | cleanext:
|
---|
145 | rm -rf build/tclvfs build/thread build/zlib build/*.o
|
---|
146 | rm -rf build/lib/vfs* build/lib/thread*
|
---|
147 |
|
---|
148 | clean:
|
---|
149 | rm -rf build kit-gui$(EXE)
|
---|
150 |
|
---|
151 | distclean: clean
|
---|
152 | rm -f tclkit-gui$(EXE)
|
---|
153 |
|
---|
154 | .PHONY: all base clean distclean threaded tidy
|
---|
155 |
|
---|
156 | $(OUTDIR)/zvfs$O: ../../zvfs.c
|
---|
157 | $(CC) -o $@ $(CFLAGS) -DHAVE_UNISTD_H=1 -DSTATIC_BUILD -Ibuild/include -c $<
|
---|
158 |
|
---|
159 | $(OUTDIR)/zlib$O: ../../zlib.c
|
---|
160 | $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include -c $<
|
---|
161 |
|
---|
162 | $(OUTDIR)/g2lite$O: ../../g2lite.c
|
---|
163 | $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include -c $<
|
---|
164 |
|
---|
165 | $(OUTDIR)/usb$O: ../../usb.c
|
---|
166 | $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include -c $<
|
---|
167 |
|
---|
168 | $(OUTDIR)/swt$O: ../../swt.c
|
---|
169 | $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include -c $<
|
---|
170 |
|
---|
171 | $(OUTDIR)/csr_test$O: ../../csr_test.c
|
---|
172 | $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include -c $<
|
---|
173 |
|
---|
174 | $(OUTDIR)/tclAppInit$O: ../tcl/$(PLAT)/tclAppInit.c
|
---|
175 | $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include \
|
---|
176 | -DTCL_LOCAL_APPINIT=TclKit_AppInit -c $<
|
---|
177 |
|
---|
178 | $(OUTDIR)/winMain$O: ../tk/$(PLAT)/winMain.c
|
---|
179 | $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include \
|
---|
180 | -DTK_LOCAL_APPINIT=TclKit_AppInit -c $<
|
---|
181 |
|
---|
182 | $(OUTDIR)/tclkit.res.o: ../../tclkit.rc
|
---|
183 | cp $< build/tk/tclkit.rc
|
---|
184 | windres -o $@ --define STATIC_BUILD --define TCLKIT_WITH_TK \
|
---|
185 | --define BASE_NO_TK_ICON --include build/include \
|
---|
186 | --include build/tk --include ../../files --include ../tk/win/rc \
|
---|
187 | build/tk/tclkit.rc
|
---|
188 |
|
---|
189 | $(OUTDIR)/tclkitsh.res.o: ../../tclkit.rc
|
---|
190 | windres -o $@ --define STATIC_BUILD --include build/include \
|
---|
191 | --include ../../files $<
|
---|