Skip to content

Commit 1b8bd22

Browse files
committed
Merge branch 'ab/make-tags-cleanup'
Build clean-up for "make tags" and friends. * ab/make-tags-cleanup: Makefile: normalize clobbering & xargs for tags targets Makefile: remove "cscope.out", not "cscope*" in cscope.out target Makefile: don't use "FORCE" for tags targets Makefile: add QUIET_GEN to "cscope" target Makefile: move ".PHONY: cscope" near its target
2 parents 5331af2 + 8990624 commit 1b8bd22

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

Makefile

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2735,19 +2735,25 @@ FIND_SOURCE_FILES = ( \
27352735
| sed -e 's|^\./||' \
27362736
)
27372737

2738-
$(ETAGS_TARGET): FORCE
2739-
$(QUIET_GEN)$(RM) "$(ETAGS_TARGET)+" && \
2740-
$(FIND_SOURCE_FILES) | xargs etags -a -o "$(ETAGS_TARGET)+" && \
2741-
mv "$(ETAGS_TARGET)+" "$(ETAGS_TARGET)"
2738+
FOUND_SOURCE_FILES = $(shell $(FIND_SOURCE_FILES))
27422739

2743-
tags: FORCE
2744-
$(QUIET_GEN)$(RM) tags+ && \
2745-
$(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \
2746-
mv tags+ tags
2740+
$(ETAGS_TARGET): $(FOUND_SOURCE_FILES)
2741+
$(QUIET_GEN)$(RM) $@+ && \
2742+
echo $(FOUND_SOURCE_FILES) | xargs etags -a -o $@+ && \
2743+
mv $@+ $@
2744+
2745+
tags: $(FOUND_SOURCE_FILES)
2746+
$(QUIET_GEN)$(RM) $@+ && \
2747+
echo $(FOUND_SOURCE_FILES) | xargs ctags -a -o $@+ && \
2748+
mv $@+ $@
2749+
2750+
cscope.out: $(FOUND_SOURCE_FILES)
2751+
$(QUIET_GEN)$(RM) $@+ && \
2752+
echo $(FOUND_SOURCE_FILES) | xargs cscope -f$@+ -b && \
2753+
mv $@+ $@
27472754

2748-
cscope:
2749-
$(RM) cscope*
2750-
$(FIND_SOURCE_FILES) | xargs cscope -b
2755+
.PHONY: cscope
2756+
cscope: cscope.out
27512757

27522758
### Detect prefix changes
27532759
TRACK_PREFIX = $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\
@@ -2936,7 +2942,7 @@ check: config-list.h command-list.h
29362942
exit 1; \
29372943
fi
29382944

2939-
FOUND_C_SOURCES = $(filter %.c,$(shell $(FIND_SOURCE_FILES)))
2945+
FOUND_C_SOURCES = $(filter %.c,$(FOUND_SOURCE_FILES))
29402946
COCCI_SOURCES = $(filter-out $(THIRD_PARTY_SOURCES),$(FOUND_C_SOURCES))
29412947

29422948
%.cocci.patch: %.cocci $(COCCI_SOURCES)
@@ -3266,7 +3272,7 @@ endif
32663272

32673273
.PHONY: all install profile-clean cocciclean clean strip
32683274
.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
3269-
.PHONY: FORCE cscope
3275+
.PHONY: FORCE
32703276

32713277
### Check documentation
32723278
#

0 commit comments

Comments
 (0)