@matheusbsbs / matheus-bagliano / commits / 6fc301bbf6
Fork 0

Makefile: remove $foo when $foo.exe is built/installed.

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. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Jan 10, 2007 at 12:24 UTC 6fc301bbf68decbda369402a11ef215391bdd533
1 file changed +9 -3
Makefile
+9 -3
@@ -1,5 +1,5 @@
1 # The default target of this Makefile is...
2 -all:
2 +all::
3
4 # Define NO_OPENSSL environment variable if you do not have OpenSSL.
5 # This also implies MOZILLA_SHA1.
@@ -605,9 +605,12 @@ export prefix TAR INSTALL DESTDIR SHELL_PATH template_dir
605
606 ### Build rules
607
608 -all: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk gitweb/gitweb.cgi
608 +all:: $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk gitweb/gitweb.cgi
609 +ifneq (,$X)
610 + $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), rm -f '$p';)
611 +endif
612
610 -all:
613 +all::
614 $(MAKE) -C perl PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' all
615 $(MAKE) -C templates
616
@@ -849,6 +852,9 @@ install: all
852 '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \
853 fi
854 $(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
855 +ifneq (,$X)
856 + $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p';)
857 +endif
858
859 install-doc:
860 $(MAKE) -C Documentation install