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>
Junio C Hamano committed
Sep 28, 2010 at 16:08 UTC
2f76919517e98bb5e979d6c8c7bbc3478a066a21
1 file changed
+9
-6
Makefile
+9
-6
@@ -390,6 +390,8 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
390
$(patsubst %.py,%,$(SCRIPT_PYTHON)) \
391
git-instaweb
392
393
+ETAGS_TARGET = TAGS
394
+
395
# Empty...
396
EXTRA_PROGRAMS =
397
@@ -1122,6 +1124,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
1124
NO_REGEX = YesPlease
1125
NO_PYTHON = YesPlease
1126
BLK_SHA1 = YesPlease
1127
+ ETAGS_TARGET = ETAGS
1128
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/fnmatch -Icompat/win32
1129
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
1130
COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/winansi.o \
@@ -1961,11 +1964,11 @@ info:
1964
pdf:
1965
$(MAKE) -C Documentation pdf
1966
1964
-TAGS:
1965
- $(RM) TAGS
1966
- $(FIND) . -name '*.[hcS]' -print | xargs etags -a
1967
+$(ETAGS_TARGET): FORCE
1968
+ $(RM) $(ETAGS_TARGET)
1969
+ $(FIND) . -name '*.[hcS]' -print | xargs etags -a -o $(ETAGS_TARGET)
1970
1968
-tags:
1971
+tags: FORCE
1972
$(RM) tags
1973
$(FIND) . -name '*.[hcS]' -print | xargs ctags -a
1974
@@ -2235,7 +2238,7 @@ clean:
2238
$(RM) $(TEST_PROGRAMS)
2239
$(RM) -r bin-wrappers
2240
$(RM) -r $(dep_dirs)
2238
- $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*
2241
+ $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h $(ETAGS_TARGET) tags cscope*
2242
$(RM) -r autom4te.cache
2243
$(RM) config.log config.mak.autogen config.mak.append config.status config.cache
2244
$(RM) -r $(GIT_TARNAME) .doc-tmp-dir
@@ -2259,7 +2262,7 @@ endif
2262
2263
.PHONY: all install clean strip
2264
.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
2262
-.PHONY: FORCE TAGS tags cscope
2265
+.PHONY: FORCE cscope
2266
2267
### Check documentation
2268
#