diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml new file mode 100644 index 0000000..6fd4b1c --- /dev/null +++ b/.github/workflows/makefile.yml @@ -0,0 +1,77 @@ +name: Makefile CI + +on: push + +jobs: + build: + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Install dependencies + run: | + sudo apt update + sudo apt install pandoc texlive-latex-base texlive-latex-recommended + + - name: Cache Tcl build + id: cache-tcl + uses: actions/cache@v4 + with: + path: /opt/tcl8.7 + key: ${{ runner.os }}-f7629abff2 + + - name: Build Tcl 8.7 + if: steps.cache-tcl.outputs.cache-hit != 'true' + run: | + mkdir -p /tmp/src/tcl + cd /tmp/src/tcl + wget https://core.tcl-lang.org/tcl/tarball/f7629abff2/tcl.tar.gz -O - | tar xz --strip-components=1 + cd unix + ./configure CFLAGS="-DPURIFY" --enable-symbols --enable-testmode --prefix=/opt/tcl8.7 + make -j 8 + sudo make install + + - uses: actions/checkout@v4 + with: + submodules: 'true' + + - name: Build parse_args + run: | + autoconf + ./configure --with-tcl=/opt/tcl8.7/lib --enable-testmode + make + + - name: Run tests + run: make test 2>&1 | tee /tmp/test_results.log + + - name: Upload test results + uses: actions/upload-artifact@v4 + with: + name: test-results + path: /tmp/test_results.log + + - name: Dist + #if: startsWith(github.ref, 'refs/tags/v') + run: | + make dist + - uses: actions/upload-artifact@v4 + with: + name: release-tarball + path: /tmp/dist/parse_args*.tar.gz + + - name: Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/v') + with: + draft: false + prerelease: true + files: | + /tmp/dist/parse_args*.tar.gz + + token: ${{ secrets.GITHUB_TOKEN }} + +# - name: debug +# if: ${{ failure() }} +# uses: mxschmitt/action-tmate@v3 diff --git a/.gitignore b/.gitignore index 516b098..f540042 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.swp *.o *.so +*.dll pkgIndex.tcl Makefile core diff --git a/Makefile.in b/Makefile.in index 0af0cd2..a8cb199 100644 --- a/Makefile.in +++ b/Makefile.in @@ -172,15 +172,8 @@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) \ GDB = gdb VALGRIND = valgrind -VALGRINDEXTRA = VALGRINDARGS = --tool=memcheck --num-callers=8 --leak-resolution=high \ - --leak-check=yes -v --suppressions=suppressions --keep-debuginfo=yes \ - --trace-children=yes $(VALGRINDEXTRA) - -PGOGEN_BUILD = -fprofile-generate=prof -PGO_BUILD = @PGO_BUILD@ -PGO= -CFLAGS += $(PGO) + --leak-check=yes --show-reachable=yes -v .SUFFIXES: .c .$(OBJEXT) @@ -260,21 +253,9 @@ test: binaries libraries -load "package ifneeded $(PACKAGE_NAME) $(PACKAGE_VERSION) \ [list load `@CYGPATH@ $(PKG_LIB_FILE)` $(PACKAGE_NAME)]" -benchmark: binaries libraries - $(TCLSH) `@CYGPATH@ $(srcdir)/bench/run.tcl` $(BENCHFLAGS) -load package\ ifneeded\ $(PACKAGE_NAME)\ $(PACKAGE_VERSION)\ [list\ load\ `@CYGPATH@ $(PKG_LIB_FILE)`\ [string\ totitle\ $(PACKAGE_NAME)]] - shell: binaries libraries @$(TCLSH) $(SCRIPT) -vim-gdb: binaries libraries - $(TCLSH_ENV) $(PKG_ENV) vim -c "set number" -c "set mouse=a" -c "set foldlevel=100" -c "Termdebug --args $(TCLSH_PROG) tests/all.tcl $(TESTFLAGS) -singleproc 1 -load package\ ifneeded\ $(PACKAGE_NAME)\ $(PACKAGE_VERSION)\ [list\ load\ `@CYGPATH@ $(PKG_LIB_FILE)`\ [string\ totitle\ $(PACKAGE_NAME)]]" generic/parse_args.c - -vim-core: - $(TCLSH_ENV) $(PKG_ENV) vim -c 'packadd termdebug' -c "set mouse=a" -c "set number" -c "set foldlevel=100" -c "Termdebug -ex layout\ asm -ex layout\ regs -ex focus\ cmd $(TCLSH_PROG) core" -c Winbar generic/main.c - -vim-gdb-benchmark: binaries libraries - $(TCLSH_ENV) $(PKG_ENV) vim -c "set number" -c "set mouse=a" -c "set foldlevel=100" -c "Termdebug --args $(TCLSH_PROG) bench/run.tcl $(TESTFLAGS) -load package\ ifneeded\ $(PACKAGE_NAME)\ $(PACKAGE_VERSION)\ [list\ load\ `@CYGPATH@ $(PKG_LIB_FILE)`\ [string\ totitle\ $(PACKAGE_NAME)]]" generic/parse_args.c - gdb: $(TCLSH_ENV) $(PKG_ENV) $(GDB) $(TCLSH_PROG) $(SCRIPT) @@ -285,14 +266,6 @@ gdb-test: binaries libraries -load "package ifneeded $(PACKAGE_NAME) $(PACKAGE_VERSION) \ [list load `@CYGPATH@ $(PKG_LIB_FILE)` $(PACKAGE_NAME)]" -pgo: - rm -rf prof - make -C . PGO="$(PGOGEN_BUILD)" clean binaries libraries test benchmark - make -C . PGO="$(PGO_BUILD)" clean binaries libraries - -coverage: - make -C . PGO="--coverage" clean binaries libraries test - valgrind: binaries libraries $(TCLSH_ENV) $(PKG_ENV) $(VALGRIND) $(VALGRINDARGS) $(TCLSH_PROG) \ `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) @@ -353,7 +326,8 @@ DIST_ROOT = /tmp/dist DIST_DIR = $(DIST_ROOT)/$(PKG_DIR) DIST_INSTALL_DATA = CPPROG='cp -p' $(INSTALL) -m 644 -DIST_INSTALL_SCRIPT = CPPROG='cp -p' $(INSTALL) -m 755 +DIST_INSTALL_SCRIPT = CPPROG='cp -p' $(INSTALL) +DIST_INSTALL_ASIS = cp -a dist-clean: rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.* @@ -372,16 +346,32 @@ dist: dist-clean $(srcdir)/tclconfig/tcl.m4 $(srcdir)/tclconfig/install-sh \ $(DIST_DIR)/tclconfig/ + $(INSTALL_DATA_DIR) $(DIST_DIR)/teabase + $(DIST_INSTALL_DATA) \ + $(srcdir)/teabase/teabase.m4 \ + $(srcdir)/teabase/Makefile.in \ + $(srcdir)/teabase/ax_cc_for_build.m4 \ + $(srcdir)/teabase/ax_check_compile_flag.m4 \ + $(srcdir)/teabase/ax_gcc_builtin.m4 \ + $(srcdir)/teabase/tclstuff.h \ + $(srcdir)/teabase/tip445.h \ + $(srcdir)/teabase/polyfill.h \ + $(DIST_DIR)/teabase/ + + $(INSTALL_DATA_DIR) $(DIST_DIR)/bench + $(DIST_INSTALL_DATA) \ + $(srcdir)/teabase/teabase_bench-0.1.tm \ + $(DIST_DIR)/bench/ + # Extension files $(DIST_INSTALL_DATA) \ - $(srcdir)/ChangeLog \ - $(srcdir)/README.sha \ - $(srcdir)/license.terms \ - $(srcdir)/README \ + $(srcdir)/README.md \ + $(srcdir)/LICENSE \ $(srcdir)/pkgIndex.tcl.in \ + $(srcdir)/suppressions \ $(DIST_DIR)/ - list='demos doc generic library mac tests unix win'; \ + list='demos doc generic library mac tests unix win bench'; \ for p in $$list; do \ if test -d $(srcdir)/$$p ; then \ $(INSTALL_DATA_DIR) $(DIST_DIR)/$$p; \ @@ -491,12 +481,10 @@ uninstall-binaries: rm -f $(DESTDIR)$(bindir)/$$p; \ done -tags: - ctags-exuberant generic/* - .PHONY: all binaries clean depend distclean doc install libraries test .PHONY: gdb gdb-test valgrind valgrindshell tags -.PHONY: vim-gdb vim-core vim-gdb-benchmark + +include $(top_builddir)/teabase/Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/bench/run.tcl b/bench/run.tcl deleted file mode 120000 index 4ae89d9..0000000 --- a/bench/run.tcl +++ /dev/null @@ -1 +0,0 @@ -../teabase/run_bench.tcl \ No newline at end of file diff --git a/bench/run.tcl b/bench/run.tcl new file mode 100644 index 0000000..4ae89d9 --- /dev/null +++ b/bench/run.tcl @@ -0,0 +1 @@ +../teabase/run_bench.tcl \ No newline at end of file diff --git a/configure.ac b/configure.ac index dd220cd..fbe634f 100644 --- a/configure.ac +++ b/configure.ac @@ -73,7 +73,7 @@ TEA_SETUP_COMPILER TEA_ADD_SOURCES([parse_args.c]) TEA_ADD_HEADERS([]) -TEA_ADD_INCLUDES([]) +TEA_ADD_INCLUDES([-I$srcdir/teabase]) TEA_ADD_LIBS([]) TEA_ADD_CFLAGS([]) TEA_ADD_STUB_SOURCES([]) @@ -181,7 +181,7 @@ TEA_MAKE_LIB TEA_PROG_TCLSH #TEA_PROG_WISH -AC_CONFIG_FILES([Makefile pkgIndex.tcl]) +AC_CONFIG_FILES([Makefile pkgIndex.tcl teabase/Makefile]) #AC_CONFIG_FILES([sampleConfig.sh]) #-------------------------------------------------------------------- diff --git a/generic/tclstuff.h b/generic/tclstuff.h deleted file mode 120000 index ade55f1..0000000 --- a/generic/tclstuff.h +++ /dev/null @@ -1 +0,0 @@ -../teabase/tclstuff.h \ No newline at end of file diff --git a/generic/tip445.h b/generic/tip445.h deleted file mode 120000 index a53b808..0000000 --- a/generic/tip445.h +++ /dev/null @@ -1 +0,0 @@ -../teabase/tip445.h \ No newline at end of file diff --git a/teabase b/teabase index 5085949..b179fcf 160000 --- a/teabase +++ b/teabase @@ -1 +1 @@ -Subproject commit 508594963a61932ba6a752586f5913e8359de7b5 +Subproject commit b179fcffcb9c5e51951e3c9de794580bc4caa654