From 04f0ee07280c823447afc4bb14b2ec6cf1b8e470 Mon Sep 17 00:00:00 2001 From: John Whittington Date: Sun, 3 Sep 2017 13:19:36 +0100 Subject: [PATCH] rm old tags file made safer and only if it exists --- Arduino.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Arduino.mk b/Arduino.mk index 623db90..c647aea 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -1320,7 +1320,7 @@ ifndef TAGS_FILE TAGS_FILE = tags endif -# ctags command: append file with user options before +# ctags command: append, flags unsort (as will be sorted after) and specify filename CTAGS_CMD = $(CTAGS_EXEC) $(CTAGS_OPTS) -auf ######################################################################## @@ -1580,7 +1580,9 @@ generated_assembly: generate_assembly .PHONY: tags tags: - rm -f $(shell pwd)/$(TAGS_FILE) +ifneq ($(words $(wildcard $(TAGS_FILE))), 0) + rm -f $(TAGS_FILE) +endif @$(ECHO) "Generating tags for local sources (INO an PDE files as C++): " $(CTAGS_CMD) $(TAGS_FILE) --langmap=c++:.ino --langmap=c++:.pde $(LOCAL_SRCS) ifneq ($(words $(ARDUINO_LIBS)), 0)