MinGW: avoid collisions between "tags" and "TAGS"

On case insensitive filesystems, "tags" and "TAGS" target will try to
overwrite the same file.  Allow MinGW to use "ETAGS" instead.

These two targets do produce real files; do not put them on .PHONY target
list.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano 2010-09-28 16:08:38 -05:00
parent 9ec26eb7cd
commit 2f76919517

View File

@ -390,6 +390,8 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
$(patsubst %.py,%,$(SCRIPT_PYTHON)) \ $(patsubst %.py,%,$(SCRIPT_PYTHON)) \
git-instaweb git-instaweb
ETAGS_TARGET = TAGS
# Empty... # Empty...
EXTRA_PROGRAMS = EXTRA_PROGRAMS =
@ -1122,6 +1124,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NO_REGEX = YesPlease NO_REGEX = YesPlease
NO_PYTHON = YesPlease NO_PYTHON = YesPlease
BLK_SHA1 = YesPlease BLK_SHA1 = YesPlease
ETAGS_TARGET = ETAGS
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/fnmatch -Icompat/win32 COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/fnmatch -Icompat/win32
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\" COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/winansi.o \ COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/winansi.o \
@ -1961,11 +1964,11 @@ info:
pdf: pdf:
$(MAKE) -C Documentation pdf $(MAKE) -C Documentation pdf
TAGS: $(ETAGS_TARGET): FORCE
$(RM) TAGS $(RM) $(ETAGS_TARGET)
$(FIND) . -name '*.[hcS]' -print | xargs etags -a $(FIND) . -name '*.[hcS]' -print | xargs etags -a -o $(ETAGS_TARGET)
tags: tags: FORCE
$(RM) tags $(RM) tags
$(FIND) . -name '*.[hcS]' -print | xargs ctags -a $(FIND) . -name '*.[hcS]' -print | xargs ctags -a
@ -2235,7 +2238,7 @@ clean:
$(RM) $(TEST_PROGRAMS) $(RM) $(TEST_PROGRAMS)
$(RM) -r bin-wrappers $(RM) -r bin-wrappers
$(RM) -r $(dep_dirs) $(RM) -r $(dep_dirs)
$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope* $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h $(ETAGS_TARGET) tags cscope*
$(RM) -r autom4te.cache $(RM) -r autom4te.cache
$(RM) config.log config.mak.autogen config.mak.append config.status config.cache $(RM) config.log config.mak.autogen config.mak.append config.status config.cache
$(RM) -r $(GIT_TARNAME) .doc-tmp-dir $(RM) -r $(GIT_TARNAME) .doc-tmp-dir
@ -2259,7 +2262,7 @@ endif
.PHONY: all install clean strip .PHONY: all install clean strip
.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
.PHONY: FORCE TAGS tags cscope .PHONY: FORCE cscope
### Check documentation ### Check documentation
# #