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 905b3df..a84d07c 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 06a23d9..43b6cc4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -173,15 +173,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) @@ -354,7 +347,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.* @@ -365,6 +359,7 @@ dist: dist-clean $(srcdir)/manifest.uuid # TEA files $(DIST_INSTALL_DATA) $(srcdir)/Makefile.in \ $(srcdir)/aclocal.m4 $(srcdir)/configure.ac \ + $(srcdir)/config.h.in \ $(DIST_DIR)/ $(DIST_INSTALL_SCRIPT) $(srcdir)/configure $(DIST_DIR)/ @@ -374,13 +369,29 @@ dist: dist-clean $(srcdir)/manifest.uuid $(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 macosx tests unix win'; \ @@ -493,12 +504,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 c9c785c..0eca676 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]) AC_CONFIG_HEADERS([config.h]) 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 db4c1c8..1459d2e 160000 --- a/teabase +++ b/teabase @@ -1 +1 @@ -Subproject commit db4c1c87199c0dd79c51d5a0a96a601ce5d1a210 +Subproject commit 1459d2e240671b6521426f3b99e2762a213723f1