git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Makefile: add clean-obsolete-scripts target

From
Junio C Hamano <junkio@cox.net>
Date
Jan 10, 2007, 20:22 UTC
Message-ID
<7vhcuyaaxq.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0701101319480.22628@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 6 quoted lines
> On Cygwin, newly builtins are not recognized, because there exist both
> the executable binaries (with .exe extension) _and_ the now-obsolete
> scripts (without extension), but the script is executed.
>
> "make clean-obsolete-scripts" removes these ambiguities by removing the
> older of these file pairs.
I would prefer it to be rather automatic -- how about this instead?
-- >8 --
diff --git a/Makefile b/Makefile
index e4f520a..9077941 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 # The default target of this Makefile is...
-all:
+all::
 
 # Define NO_OPENSSL environment variable if you do not have OpenSSL.
 # This also implies MOZILLA_SHA1.
@@ -605,9 +605,12 @@ export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir
 
 ### Build rules
 
-all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk gitweb/gitweb.cgi
+all:: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk gitweb/gitweb.cgi
+ifneq (,$X)
+	$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), echo rm -f '$p';) 
+endif
 
-all:
+all::
 	$(MAKE) -C perl PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all
 	$(MAKE) -C templates
 
@@ -849,6 +852,9 @@ install: all
 			'$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \
 	fi
 	$(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
+ifneq (,$X)
+	$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), echo rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p';) 
+endif
 
 install-doc:
 	$(MAKE) -C Documentation install
Previous: Alex RiesenNext: Alex Riesen
Message 5 of 10 in “Makefile: add clean-obsolete-scripts target”
  1. Makefile: add clean-obsolete-scripts targetJohannes Schindelin, Jan 10, 2007
  2. Alex RiesenJan 10, 2007
  3. Johannes SchindelinJan 10, 2007
  4. Alex RiesenJan 10, 2007
  5. Junio C HamanoJan 10, 2007
  6. Alex RiesenJan 10, 2007
  7. Junio C HamanoJan 11, 2007
  8. Alex RiesenJan 11, 2007
  9. Johannes SchindelinJan 11, 2007
  10. Johannes SchindelinJan 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.