make tags target for ctags

I want to generate ctags whenever I make
This commit is contained in:
2025-10-05 00:19:09 +02:00
parent e585134339
commit eb47bcda9b
2 changed files with 10 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
tags
+9 -1
View File
@@ -7,7 +7,7 @@ TESTBIN := /tmp/all_tests
.PHONY: test
test:
test: tags
@echo "Discovering test files..."
@files=$$(find . -type f -name 'test*.c'); \
if [ -z "$$files" ]; then \
@@ -18,3 +18,11 @@ test:
echo "Running tests..."; \
$(TESTBIN); \
fi
PROJECT_ROOT := $(shell pwd)
PROJECT_C_FILES := $(shell find $(PROJECT_ROOT) \( -name '*.c' -o -name '*.h' \))
CRITERION_HEADERS := $(shell find /usr/include/criterion)
ALL_FILES := $(PROJECT_C_FILES) $(CRITERION_HEADERS)
tags: $(ALL_FILES)
ctags $(ALL_FILES)