ascherer / cwebbin

Literate Programming in C/C++
https://github.com/ascherer/cweb
MIT License
28 stars 5 forks source link
ansi cweb

literate programming in ansi-c/c++

cwebbin is an extension of silvio levy's and donald e. knuth's cweb system and donald e. knuth's ctwill program. it requires the contents of the original cweb source drop and the secondary ctwill source drop, to which it applies a set of change files to introduce advanced features. see the extensive readme for the full story.

feature list

manual compilation

extract ctwill.tar.gz and add the contents of cweb-4.12.tar.gz (overwriting outdated source files Makefile, common.h, common.w, and prod.w) and cwebbin-2024.tar.gz for the full set of source files. replace @@VERSION@@ in line 129 of the Makefile.unix with something like Version 4.12 [CWEBbin 2024]. touch *.cxx. unix/linux users should work with make -f Makefile.unix exclusively (targets boot, cautiously, and all). macos/bsd users will have to adapt Makefile.unix in several spots to make things work.

advanced packaging

alternatively, you may want to use rpmbuild or debbuild for compiling the sources and for creating installable packages in rpm and deb format. set up your build arena with mkdir BUILD BUILDROOT RPMS SOURCES SPECS SRPMS for rpmbuild (plus mkdir DEBS SDEBS for debbuild).

clone cweb and cwebbin, create the source drops with

git archive -o cweb-4.12.tar.gz cweb-4.12
git archive -o cwebbin-2024.tar.gz cwebbin-2024

respectively, put these two tarballs and the original ctwill.tar.gz in the SOURCES directory, add the patch files

to SOURCES also, and place cwebbin.spec in the SPECS directory of your build arena.

the five patch files upgrade the ctwill macros for modern cweb. originally, they come from branch update-macros-for-cweb-4 and can be recreated by git format-patch master in the archived ctwill project.

depending on your preferences run the magic incantation

{deb|rpm}build -ba SPECS/cwebbin.spec

cweb for texlive

the extended sources and the build system were modified to smoothly integrate with the texlive build system. by invoking

{deb|rpm}build -bi SPECS/cwebbin.spec --with texlive

you receive a small tarball cweb-texlive.tar.gz, which should be extracted in texlive's source directory texlive-source (or the subversion equivalent) with

cd /path/to/texlive-source
pax -rzf /path/to/cweb-texlive.tar.gz

this tarball contains *-w2c.ch files that modify the original cweb sources for the texlive ecosystem. additionally, it contains language catalogs, tex macros, and cweb include files.

updated versions of cweb are added to the texlive source tree with

cd /path/to/texlive-source/texk/web2c/cwebdir
pax -rzf /path/to/cweb-4.12.tar.gz