Skip to content

Commit 04f0ee0

Browse files
committed
rm old tags file made safer and only if it exists
1 parent 85db740 commit 04f0ee0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Arduino.mk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ ifndef TAGS_FILE
13201320
TAGS_FILE = tags
13211321
endif
13221322

1323-
# ctags command: append file with user options before
1323+
# ctags command: append, flags unsort (as will be sorted after) and specify filename
13241324
CTAGS_CMD = $(CTAGS_EXEC) $(CTAGS_OPTS) -auf
13251325

13261326
########################################################################
@@ -1580,7 +1580,9 @@ generated_assembly: generate_assembly
15801580

15811581
.PHONY: tags
15821582
tags:
1583-
rm -f $(shell pwd)/$(TAGS_FILE)
1583+
ifneq ($(words $(wildcard $(TAGS_FILE))), 0)
1584+
rm -f $(TAGS_FILE)
1585+
endif
15841586
@$(ECHO) "Generating tags for local sources (INO an PDE files as C++): "
15851587
$(CTAGS_CMD) $(TAGS_FILE) --langmap=c++:.ino --langmap=c++:.pde $(LOCAL_SRCS)
15861588
ifneq ($(words $(ARDUINO_LIBS)), 0)

0 commit comments

Comments
 (0)