[https://github.com/dbohdan/sqawk/blob/master/tools/assemble.tcl%|%Assemble] bundles multiple Tcl source code files into a single file. It also works as a [preprocessor] that understands `#define` and `#ifdef`/`#ifndef`. Assemble is developed as part of the [Sqawk] project. ** Use case ** Assemble can be compared to [Perl]'s [http://search.cpan.org/perldoc?App::FatPacker%|%App::FatPacker]. Note that in most cases a [Starpack] is a more robust alternative to an "assembled" script. However, assembled scripts have the following advantages: * Over [Starpack%|%Starpacks] (if you already have Tcl installed on the target system): lower startup delays. * Over [Starkit%|%Starkits]: being usable as executable files on [Unix]. Assembled scripts can be run directly and do not require a wrapper shell script or a [Tclkit] with which to run them. ** Example ** The following example comes from Sqawk v0.14.1: *** Input *** **** sqawk-dev.tcl **** ====== # ... #define SQAWK interp alias {} ::source+ {} ::source source+ lib/tabulate.tcl source+ lib/utils.tcl source+ lib/parsers/awk.tcl source+ lib/parsers/csv.tcl source+ lib/serializers/awk.tcl source+ lib/serializers/csv.tcl source+ lib/serializers/table.tcl source+ lib/serializers/tcl.tcl source+ lib/classes/sqawk.tcl source+ lib/classes/table.tcl # ... ====== **** lib/tabulate.tcl **** ====== #! /usr/bin/env tclsh # Tabulate -- turn standard input into a table. # ... set data $updateData dict unset argv FS } puts [tabulate -data $data {*}$argv] } #ifndef SQAWK # If this is the main script... if {[info exists argv0] && ([file tail [info script]] eq [file tail $argv0])} { ::tabulate::main $argv0 $argv } #endif ====== *** Output *** ====== # ... interp alias {} ::source+ {} ::source # ============================= lib/tabulate.tcl =============================== #! /usr/bin/env tclsh # Tabulate -- turn standard input into a table. # ... set data $updateData dict unset argv FS } puts [tabulate -data $data {*}$argv] } # =========================== end lib/tabulate.tcl ============================= # ... ====== ** Discussion ** ** See also ** * [Starpack] <>Dev. Tools