source: trunk/kitgen/makefile.include@ 176

Last change on this file since 176 was 176, checked in by demin, 12 years ago

replace ifeq ($(PLAT), unix) with else

File size: 5.9 KB
RevLine 
[175]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
29VFS_OPTS = --disable-threads
30TDOM_OPTS = --disable-threads
31TCLX_OPTS = --disable-threads
32XOTCL_OPTS = --disable-threads
33SQLITE_OPTS = --disable-threads
34ZLIB_OPTS = --prefix=$(OUTDIR)
35LIBUSB_OPTS = --prefix=$(OUTDIR)
36
37tclkit-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
[176]44ifeq ($(PLAT), win)
[175]45kit-gui$(EXE): build/tcl build/tk build/blt build/tclvfs build/zlib \
[176]46 build/tdom build/tcllib build/xotcl build/sqlite build/libusb-win32 $(GUIOBJ)
[175]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)
[176]58else
[175]59kit-gui$(EXE): build/tcl build/tk build/blt build/tclvfs build/zlib \
[176]60 build/tdom build/tcllib build/xotcl build/sqlite build/libusb $(GUIOBJ)
[175]61 $(CC) -o $@ $(CFLAGS) ../../kitInit.c $(GUIOBJ) \
62 -Ibuild/include -DKIT_LITE -DSTATIC_BUILD \
63 build/lib/vfs1*/*vfs1*$A \
64 -DKIT_INCLUDES_TK build/lib/*tk8*$A \
65 build/lib/libz$A build/lib/libusb$A \
66 build/lib/*tcl8*$A \
67 build/lib/BLT2*/*BLT2*$A \
68 build/lib/tdom0*/*tdom0*$A \
69 build/lib/sqlite3*/*sqlite3*$A \
70 build/lib/xotcl1*/*xotcl1*$A \
71 $(LDFLAGS) $(GUI_OPTS)
72endif
73
74build/files:
75 mkdir -p $@ && cd $@ && ln -s ../../../../files/* .
76
77build/tcl:
78 mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
79 sh ../../../tcl/$(PLAT)/configure $(STATIC) $(TCL_OPTS) \
80 --prefix=$(OUTDIR) --exec-prefix=$(OUTDIR) && \
81 $(MAKE) install-binaries install-libraries $(PRIV)
82
83build/tk: build/tcl
84 mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
85 sh ../../../tk/$(PLAT)/configure $(STATIC) $(TCLDIR) $(TK_OPTS) && \
86 $(MAKE) install-binaries install-libraries $(PRIV)
87
88build/blt: build/tk
89 mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
90 sh $(EXTDIR)/blt/configure $(STATIC) $(TCLDIR) $(BLT_OPTS) && \
91 $(MAKE) install-binaries install-libraries
92
93build/tclvfs: build/tcl
94 mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
95 sh $(EXTDIR)/tclvfs/configure $(STATIC) $(TCLDIR) $(VFS_OPTS) && \
96 $(MAKE) install
97
98build/zlib: build/tcl
99 cp -R ../../8.x/zlib/. $@
100 cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
101 sh $(EXTDIR)/zlib/configure $(ZLIB_OPTS) && \
102 $(MAKE) install
103
104build/libusb-win32: build/tcl
105 cp -R ../../8.x/libusb-win32/. $@
106 cd $@ && $(MAKE) && cp libusb.a ../lib/ && cp lusb0_usb.h ../include/usb.h
107
108build/libusb: build/tcl
109 cp -R ../../8.x/libusb/. $@
110 cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
111 sh configure $(LIBUSB_OPTS) && \
112 $(MAKE) && $(MAKE) install
113
114build/tdom: build/tcl
115 mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
116 sh $(EXTDIR)/tdom/configure $(STATIC) $(TCLDIR) $(TDOM_OPTS) && \
117 $(MAKE) install
118
119build/tcllib: build/tcl
120 mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
121 sh $(EXTDIR)/tcllib/configure $(STATIC) $(TCLDIR) $(TCLLIB_OPTS) && \
122 $(MAKE) install-libraries
123
124build/xotcl: build/tcl
125 mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
126 sh $(EXTDIR)/xotcl/configure $(STATIC) $(TCLDIR) $(XOTCL_OPTS) && \
127 $(MAKE) install-binaries
128
129build/sqlite: build/tcl
130 mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
131 sh $(EXTDIR)/sqlite/tea/configure $(STATIC) $(TCLDIR) $(SQLITE_OPTS) && \
132 $(MAKE) install-binaries
133
134base: build/tcl build/tk
135 ls -l build/bin
136
137tidy: cleanext
138 rm -rf build/tcl build/tk build/tkdyn
139
140cleanext:
141 rm -rf build/tclvfs build/thread build/zlib build/*.o
142 rm -rf build/lib/vfs* build/lib/thread*
143
144clean:
145 rm -rf build kit-gui$(EXE)
146
147distclean: clean
148 rm -f tclkit-gui$(EXE)
149
150.PHONY: all base clean distclean threaded tidy
151
152$(OUTDIR)/zvfs$O: ../../zvfs.c
153 $(CC) -o $@ $(CFLAGS) -DHAVE_UNISTD_H=1 -DSTATIC_BUILD -Ibuild/include -c $<
154
155$(OUTDIR)/zlib$O: ../../zlib.c
156 $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include -c $<
157
158$(OUTDIR)/g2lite$O: ../../g2lite.c
159 $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include -c $<
160
161$(OUTDIR)/usb$O: ../../usb.c
162 $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include -c $<
163
164$(OUTDIR)/swt$O: ../../swt.c
165 $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include -c $<
166
167$(OUTDIR)/csr_test$O: ../../csr_test.c
168 $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include -c $<
169
170$(OUTDIR)/tclAppInit$O: ../tcl/$(PLAT)/tclAppInit.c
171 $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include \
172 -DTCL_LOCAL_APPINIT=TclKit_AppInit -c $<
173
174$(OUTDIR)/winMain$O: ../tk/$(PLAT)/winMain.c
175 $(CC) -o $@ $(CFLAGS) -DSTATIC_BUILD -Ibuild/include \
176 -DTK_LOCAL_APPINIT=TclKit_AppInit -c $<
177
178$(OUTDIR)/tclkit.res.o: ../../tclkit.rc
179 cp $< build/tk/tclkit.rc
180 windres -o $@ --define STATIC_BUILD --define TCLKIT_WITH_TK \
181 --define BASE_NO_TK_ICON --include build/include \
182 --include build/tk --include ../../files --include ../tk/win/rc \
183 build/tk/tclkit.rc
184
185$(OUTDIR)/tclkitsh.res.o: ../../tclkit.rc
186 windres -o $@ --define STATIC_BUILD --include build/include \
187 --include ../../files $<
Note: See TracBrowser for help on using the repository browser.