source: trunk/kitgen/makefile.include@ 201

Last change on this file since 201 was 196, checked in by demin, 10 years ago

fix pointer arithmetics in zvfs.c and add STDC_HEADERS=1 for zvfs.c compilation in makefile.include

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