The project structure includes flavour-of-the-week litter like .devcontainer, .github, .vscode.
compile_commands.json should be getting generated, not stored.
Not sure if I would recommend anyone follow this information.
The build system situation in the C world is dire. And I should know, given I write my own build systems for C.
I would say, while I've never actually used it, Meson seems the least non-sensical out of the box experience.
Ideal in some ways but not in others is designing and implementing your own build system because genuinely everything else out there has some major shortcoming or other.
If you are insistent on make, stick to GNU make, read the GNU make manual, understand make and then write something simple and non-recursive.
This is the most recent Makefile I helped create:
CXX ?= clang++
CXXFLAGS += -std=c++20 -Wall -Wextra -fsanitize=address -ggdb3 -MMD -MP
LDFLAGS += -fsanitize=address
OBJ := program.o parse.o
all: program compile_flags.txt
program: $(OBJ)
$(CXX) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@
$(OBJ): Makefile
compile_flags.txt: Makefile
printf "%s\n" $(CXXFLAGS) >$@
clean:
$(RM) *.o *.d program compile_flags.txt
-include $(OBJ:.o=.d)
.PHONY: clean
If you want to do something like run a linter, code formatter, etc, before building, then this should be performed by a script which calls into make. Make is not designed to be used as a switch statement for your bash snippets.