"set tcl_library [file join $noe lib tcl$tcl_version]\n"
"set tcl_libPath [list $tcl_library [file join $noe lib]]\n"
"set tcl_pkgPath [list $tcl_library [file join $noe lib]]\n"
-/*
- * XXX: We should consider adding mk4tcl, pwb, rechan, zlib, vfs, Thread
- * XXX: and Tk as pre-defined packages here as well.
- * XXX: Currently Thread has a special pkgIndex.tcl in the starkit, but
- * XXX: several of the other packages won't be auto-recognized.
- */
-#ifdef _WIN32
- "package ifneeded dde 1.2.3 {load {} dde}\n"
- "package ifneeded registry 1.1.3 {load {} registry}\n"
-#endif
"}\n"
"tclKitPreInit"
;
#LDSTRIP = -x
EXTDIR = ../../../../8.x
-KITSRC = ../../kitInit.c ../../pwb.c ../../rechan.c ../../zlib.c \
- ../tcl/$(PLAT)/tclAppInit.c
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)
TCLDIR = --with-tcl=../lib --prefix=$(OUTDIR) --exec-prefix=$(OUTDIR)
STRIP ?= strip
cp kit-cli$(EXE) $@ && $(STRIP) $@
./kit-cli -init- ../../setupvfs.tcl $(KIT_OPTS) $@ cli
-tclkit-dyn$(EXE): kit-cli$(EXE) build/tkdyn ../../setupvfs.tcl build/files
- cp kit-cli$(EXE) $@ && $(STRIP) $@
+tclkit-dyn$(EXE): kit-dyn$(EXE) build/tkdyn ../../setupvfs.tcl build/files
+ cp kit-dyn$(EXE) $@ && $(STRIP) $@
./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) $@
./kit-cli -init- ../../setupvfs.tcl $(KIT_OPTS) $@ gui
-kit-cli$(EXE): build/tcl build/tclvfs build/vqtcl build/zlib $(KITSRC)
- $(CC) -o $@ $(CFLAGS) $(KITSRC) -Ibuild/include \
- -DKIT_LITE -DTCL_LOCAL_APPINIT=TclKit_AppInit -DSTATIC_BUILD \
+kit-cli$(EXE): build/tcl build/tclvfs build/vqtcl build/zlib $(CLIOBJ)
+ $(CC) -o $@ $(CFLAGS) ../../kitInit.c $(CLIOBJ) \
+ -Ibuild/include -DKIT_LITE -DSTATIC_BUILD \
+ build/lib/vfs1*/*vfs1*.a build/lib/vqtcl4*/*vqtcl4*.a \
+ build/lib/libz.a build/lib/libtcl8*.a $(LDFLAGS)
+
+kit-dyn$(EXE): build/tcl build/tclvfs build/vqtcl build/zlib $(CLIOBJ)
+ $(CC) -o $@ $(CFLAGS) ../../kitInit.c $(DYNOBJ) \
+ -Ibuild/include -DKIT_LITE -DSTATIC_BUILD \
build/lib/vfs1*/*vfs1*.a build/lib/vqtcl4*/*vqtcl4*.a \
build/lib/libz.a build/lib/libtcl8*.a $(LDFLAGS)
-kit-gui$(EXE): build/tcl build/tk build/tclvfs build/vqtcl build/zlib $(KITSRC)
- $(CC) -o $@ $(CFLAGS) $(KITSRC) -Ibuild/include \
- -DKIT_LITE -DTCL_LOCAL_APPINIT=TclKit_AppInit -DSTATIC_BUILD \
+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 \
build/lib/vfs1*/*vfs1*.a build/lib/vqtcl4*/*vqtcl4*.a \
-DKIT_INCLUDES_TK build/lib/libtk8*.a \
build/lib/libz.a build/lib/libtcl8*.a $(LDFLAGS) $(GUI_OPTS)
build/tk: build/tcl
mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
sh ../../../tk/$(PLAT)/configure $(STATIC) $(TCLDIR) $(TK_OPTS) && \
- $(MAKE) install-binaries install-libraries
+ $(MAKE) install-binaries install-libraries $(PRIV)
build/tkdyn: build/tcl
mkdir -p $@ && cd $@ && CFLAGS="$(CFLAGS)" && export CFLAGS && \
tidy:
rm -rf build/tcl build/tclvfs build/thread build/tk \
- build/tkdyn build/vqtcl build/zlib
-
+ build/tkdyn build/vqtcl build/zlib build/*.o
+
clean:
- rm -rf build kit-cli$(EXE) kit-gui$(EXE)
+ rm -rf build kit-cli$(EXE) kit-gui$(EXE) kit-dyn$(EXE)
distclean: clean
rm -f tclkit-cli$(EXE) tclkit-dyn$(EXE) tclkit-gui$(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 $<
}
}
+set vfs [lindex $argv 0]
+vfs::m2m::Mount $vfs $vfs
+
switch [info sharedlibext] {
.dll {
catch {
file copy -force $dll build/lib/libthread$vsn.dll
unset dll vsn
}
+ # create dde and registry pkgIndex files with the right version
+ foreach ext {dde registry} {
+ if {[catch {
+ load {} $ext
+ set extdir [file join $vfs lib $ext]
+ file mkdir $extdir
+ set f [open $extdir/pkgIndex.tcl w]
+ puts $f "package ifneeded $ext [package provide $ext] {load {} $ext}"
+ close $f
+ } err]} { puts "ERROR: $err"}
+ }
catch {
file delete [glob build/lib/libtk8?.a] ;# so only libtk8?s.a will be found
}
}
}
-set vfs [lindex $argv 0]
-vfs::m2m::Mount $vfs $vfs
-
switch [lindex $argv 1] {
cli {
vfscopy $clifiles