From c21bd5f2d9f4ec2230b31040fd3c34cbe417476f Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Tue, 25 Nov 2025 15:20:20 +0100 Subject: Fix mode not being kept on the file Also add a revision to the --version --- Makefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index cfb430a..aac5f42 100644 --- a/Makefile +++ b/Makefile @@ -64,6 +64,8 @@ CFLAGS ?= -g -O2 CFLAGS += -Werror -Wall -Wextra -std=c99\ -I $(.CURDIR)/src\ -I $(.CURDIR)/src/main\ + -I $(.OBJDIR)/src\ + -I $(.OBJDIR)/src/main\ -DDATADIR="$(prefix)/$(datadir)"\ -DTEST_ROOT="$(.CURDIR)/test" @@ -120,19 +122,24 @@ FILES = $(DEPS) \ $(MAIN_OBJS) \ $(OBJS) \ $(TEST_OBJS) \ + src/main/revision.h \ dged \ libdged.a +src/main/revision.h: scripts/generate-revision + @$(.CURDIR)/scripts/generate-revision $@ + # dependency generation -.c.d: config.mk +.c.d: config.mk src/main/revision.h @mkdir -p $(@D) $(CC) -MM $(CFLAGS) -MT $*.o $< > $@ @sed -i 's,\($*\)\.o[ :]*,\1.o $@ : ,g' $@ -.c.o: config.mk +.c.o: config.mk src/main/revision.h @mkdir -p $(@D) $(CC) $(CFLAGS) -c $< -o $@ +# TODO: remove this grammars: @if [ "$(SYNTAX_ENABLE)" = "true" ] && [ -n "$$BUNDLE_TREESITTER_GRAMMARS" ]; then \ IFS=":"; for p in "$$BUNDLE_TREESITTER_GRAMMARS"; do \ @@ -142,7 +149,7 @@ grammars: mkdir -p ./grammars; \ fi -dged: $(MAIN_OBJS) libdged.a grammars +dged: src/main/revision.h $(MAIN_OBJS) libdged.a grammars $(CC) $(LDFLAGS) $(MAIN_OBJS) libdged.a -o dged -lm libdged.a: $(OBJS) -- cgit v1.2.3