[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 |
|
---|
| 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 |
|
---|
[176] | 44 | ifeq ($(PLAT), win)
|
---|
[175] | 45 | kit-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] | 58 | else
|
---|
[175] | 59 | kit-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)
|
---|
| 72 | endif
|
---|
| 73 |
|
---|
| 74 | build/files:
|
---|
| 75 | mkdir -p $@ && cd $@ && ln -s ../../../../files/* .
|
---|
| 76 |
|
---|
| 77 | build/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 |
|
---|
| 83 | build/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 |
|
---|
| 88 | build/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 |
|
---|
| 93 | build/tclvfs: build/tcl
|
---|
| 94 | mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
|
---|
| 95 | sh $(EXTDIR)/tclvfs/configure $(STATIC) $(TCLDIR) $(VFS_OPTS) && \
|
---|
| 96 | $(MAKE) install
|
---|
| 97 |
|
---|
| 98 | build/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 |
|
---|
| 104 | build/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 |
|
---|
| 108 | build/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 |
|
---|
| 114 | build/tdom: build/tcl
|
---|
| 115 | mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
|
---|
| 116 | sh $(EXTDIR)/tdom/configure $(STATIC) $(TCLDIR) $(TDOM_OPTS) && \
|
---|
| 117 | $(MAKE) install
|
---|
| 118 |
|
---|
| 119 | build/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 |
|
---|
| 124 | build/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 |
|
---|
| 129 | build/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 |
|
---|
| 134 | base: build/tcl build/tk
|
---|
| 135 | ls -l build/bin
|
---|
| 136 |
|
---|
| 137 | tidy: cleanext
|
---|
| 138 | rm -rf build/tcl build/tk build/tkdyn
|
---|
| 139 |
|
---|
| 140 | cleanext:
|
---|
| 141 | rm -rf build/tclvfs build/thread build/zlib build/*.o
|
---|
| 142 | rm -rf build/lib/vfs* build/lib/thread*
|
---|
| 143 |
|
---|
| 144 | clean:
|
---|
| 145 | rm -rf build kit-gui$(EXE)
|
---|
| 146 |
|
---|
| 147 | distclean: 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 $<
|
---|