From: Lady <redacted>
Date: Fri, 28 Mar 2025 17:44:30 +0000 (-0400)
Subject: Dot‐prefix version and flags files
X-Git-Url: https://git.ladys.computer/CGirls/commitdiff_plain/ffe1bd11b097144214c47a568705112dffebdfa4?ds=inline;hp=259adc84f29a70aa2ba33f1eaa7f6a461bb51759

Dot‐prefix version and flags files

These clutter up the directory and really don¦t need to be visible to
an average user.
---

diff --git a/.gitignore b/.gitignore
index 38b847a..42b79cb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,8 @@
 # SPDX-FileCopyrightText: 2025 Lady <https://www.ladys.computer/about/#lady>
 # SPDX-License-Identifier: CC0-1.0
 
-CGIRLS-CFLAGS
-VERSION
+.CGIRLS-CFLAGS
+.VERSION
 .depend
 *.o
 cgirls
diff --git a/make/cgirls.mak b/make/cgirls.mak
index ccbc9eb..7dca4ce 100644
--- a/make/cgirls.mak
+++ b/make/cgirls.mak
@@ -15,13 +15,13 @@ cgirls : $(CGIRLSDIR)/cgirls
 .PHONY : cgirls
 include Makefile
 
-# The `gen-version.sh´ script updates the `VERSION´ file when·ever the version changes.
+# The `gen-version.sh´ script updates the `.VERSION´ file when·ever the version changes.
 # This file is then included to set `CGIRLS_VERSION´.
-$(CGIRLSDIR)/VERSION : VERSIONFORCE
-	@cd '$(CGIRLSDIR)' && $(SHELL_PATH_SQ) sh/gen-version.sh VERSION
+$(CGIRLSDIR)/.VERSION : VERSIONFORCE
+	@cd '$(CGIRLSDIR)' && $(SHELL_PATH_SQ) sh/gen-version.sh .VERSION
 VERSIONFORCE : ;
 .PHONY : VERSIONFORCE
--include $(CGIRLSBUILDDIR)/VERSION
+-include $(CGIRLSBUILDDIR)/.VERSION
 
 # `CGIRLS_CFLAGS´ is a separate variable so that it can be tracked separately, to avoid rebuilding all of Git when these variables change.
 # `ALL_CGIRLS_CFLAGS´ is the same as `ALL_CFLAGS´ plus `CGIRLS_CFLAGS´, except that it changes the C standard target to be `c2x´.
@@ -43,7 +43,7 @@ CGIRLS_ALLOBJS = $(CGIRLS_OBJS) $(CGIRLS_TESTOBJS)
 
 # Only `cgirls.c´ references CGIRLS_VERSION so we only rebuild its objects when the version changes.
 CGIRLS_VERSION_OBJS := $(CGIRLSDIR)/cgirls.o
-$(CGIRLS_VERSION_OBJS) : $(CGIRLSDIR)/VERSION
+$(CGIRLS_VERSION_OBJS) : $(CGIRLSDIR)/.VERSION
 $(CGIRLS_VERSION_OBJS) : EXTRA_CPPFLAGS = \
 	-DCGIRLS_VERSION='"$(CGIRLS_VERSION)"'
 
@@ -70,15 +70,15 @@ endif
 -include $(CGIRLSDIR)/make/config.mak
 
 # This saves the value of `CGIRLS_CFLAGS´ to force a rebuild of `CGIRLS_OBJS´ if the flags should change.
-$(CGIRLSDIR)/CGIRLS-CFLAGS : FORCE
+$(CGIRLSDIR)/.CGIRLS-CFLAGS : FORCE
 	@FLAGS='$(subst ','"'"',$(CGIRLS_CFLAGS))'; \
-		if test x"$$FLAGS" != x"$$(cat $(CGIRLSDIR)/CGIRLS-CFLAGS 2>/dev/null)" ; then \
+		if test x"$$FLAGS" != x"$$(cat $(CGIRLSDIR)/.CGIRLS-CFLAGS 2>/dev/null)" ; then \
 			echo 1>&2 "    * new CGit build flags"; \
-			echo "$$FLAGS" >$(CGIRLSDIR)/CGIRLS-CFLAGS; \
+			echo "$$FLAGS" >$(CGIRLSDIR)/.CGIRLS-CFLAGS; \
 		fi
 
-# Objects are built and linked the same as with Git, except depending on the additional `CGIRLS-CFLAGS´ file and using `ALL_CGIRLS_CFLAGS´ in place of `ALL_CFLAGS´.
-$(CGIRLS_ALLOBJS) : $(CGIRLSDIR)/%.o : $(CGIRLSDIR)/%.c GIT-CFLAGS $(CGIRLSDIR)/CGIRLS-CFLAGS $(missing_dep_dirs)
+# Objects are built and linked the same as with Git, except depending on the additional `.CGIRLS-CFLAGS´ file and using `ALL_CGIRLS_CFLAGS´ in place of `ALL_CFLAGS´.
+$(CGIRLS_ALLOBJS) : $(CGIRLSDIR)/%.o : $(CGIRLSDIR)/%.c GIT-CFLAGS $(CGIRLSDIR)/.CGIRLS-CFLAGS $(missing_dep_dirs)
 	$(QUIET_CC)$(CC) -o $@ -c $(dep_args) $(ALL_CGIRLS_CFLAGS) $(EXTRA_CPPFLAGS) $<
 $(CGIRLSDIR)/cgirls : $(CGIRLS_OBJS) GIT-LDFLAGS $(GITLIBS)
 	$(QUIET_LINK)$(CC) $(ALL_CGIRLS_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)