I just went this very same dance with an old project, smart, which evaluates string matching algorithms. Faster strstr(). From 2013. It was in a better shape than zlib, but still.<p>Their shell build script was called makefile, kid me not. So first create a proper dependency management: GNUmakefile. A BSD makefile would have been prettier, but not many are used to this.
dos2unix, chmod -x `find . -name *.c -o name *\.h`, clang-format -i
All in seperate commits.<p>Turns out there was a .h file not a header, but some custom list of algorithm states, broken by fmt. Dontg do that. Either keep it a header file, or rename it to .lst or such.<p>Fix all the warnings, hundreds.
Check with sanitizers.
Check the tests, disable broken algorithms, and mark them as such.<p>Improve the codebase. There are lots of hints of thought about features. write them. Simplify the state handling. Improve the tests.<p>Add make check lint.
Check all the linter warnings.<p>Add a CI. Starting with Linux, Windows mingw, macos and aarch64. Turns out the code is Linux x64 only, ha. Make it compat with sse checks, windows quirks.<p>Waiting for GH actions suck, write Dockerfiles and qemu drivers into your makefile. Maybe automake would have been a better idea after all. Or even proper autoconf.<p>Find the missing algorithms described elsewhere. Add them. Check their limitations.<p>Reproducible builds? Not for this one, sorry. This is luxury. Rather check clang-tidy, and add fuzzing.<p><a href="https://github.com/rurban/smart">https://github.com/rurban/smart</a>