When building on Windows, for example, from a git checkout one will see
an error like this:

   x86_64-w64-mingw32-gcc -DLOCALEDIR=\"/usr/local/share/locale\" 
-DHAVE_CONFIG_H -I.  -Ilib -I./lib -Isrc -I./src   -g -O2 -MT src/hello.o -MD 
-MP -MF $depbase.Tpo -c -o src/hello.o src/hello.c &&\
   mv -f $depbase.Tpo $depbase.Po
   x86_64-w64-mingw32-gcc  -g -O2   -o hello.exe src/hello.o ./lib/libhello.a   
 -lintl    
   make[2]: *** No rule to make target 'hello', needed by 'hello.1'.  Stop.

This is because hello.1 has a dependency on 'hello', but on this
platform 'hello.exe' is built.

This patch fixes it by using $(EXEEXT).

Collin

>From 9744dc450adf8f14c127f0a647da9abc3a037054 Mon Sep 17 00:00:00 2001
Message-ID: <9744dc450adf8f14c127f0a647da9abc3a037054.1752348640.git.collin.fu...@gmail.com>
From: Collin Funk <[email protected]>
Date: Sat, 12 Jul 2025 12:28:29 -0700
Subject: [PATCH] build: fix build on platforms with non-empty $(EXEEXT)

* Makefile.am (hello.1): Add $(EXEEXT) to the 'hello' program dependency
and invocation.
* .gitignore (*.exe): Add entry.
---
 .gitignore  | 2 +-
 Makefile.am | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index 65b5ec7..c304674 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,7 +3,7 @@
 *.[oa]
 *.cache
 .dirstamp
-
+*.exe
 /.sc-start-sc*
 /aclocal.m4
 /ChangeLog
diff --git a/Makefile.am b/Makefile.am
index 3d9a9d7..1a0ee0f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -56,8 +56,8 @@ EXTRA_DIST += $(man_MANS)
 endif
 
 if BUILD_FROM_GIT
-hello.1: hello
-	$(HELP2MAN) --include=$(top_srcdir)/man/hello.x $(top_builddir)/hello -o $@-t
+hello.1: hello$(EXEEXT)
+	$(HELP2MAN) --include=$(top_srcdir)/man/hello.x $(top_builddir)/hello$(EXEEXT) -o $@-t
 	chmod a=r $@-t
 	mv -f $@-t $@
 
-- 
2.50.1

Reply via email to