feat(library/Makefile.common): add tags target

This commit is contained in:
Soonho Kong 2014-08-15 12:25:21 -07:00
parent 1c4f59853d
commit 009e9fb3e6

View file

@ -1,9 +1,12 @@
TOP := $(dir $(lastword $(MAKEFILE_LIST))) TOP := $(dir $(lastword $(MAKEFILE_LIST)))
DIR = $(shell pwd) DIR := $(shell pwd)
LEAN_FILES = $(shell find $(DIR) -type f -name '*.lean') LEAN_FILES := $(shell find $(DIR) -type f -name '*.lean')
OLEAN_FILES = $(LEAN_FILES:.lean=.olean) OLEAN_FILES := $(LEAN_FILES:.lean=.olean)
DEP_FILES = $(LEAN_FILES:.lean=.d) ILEAN_FILES := $(LEAN_FILES:.lean=.ilean)
LEAN_VERSION_FILE = $(shell dirname $(LEAN))/version DEP_FILES := $(LEAN_FILES:.lean=.d)
LEAN_BIN_DIR := $(dir $(LEAN))
LEAN_VERSION_FILE := $(LEAN_BIN_DIR)version
LTAGS := $(LEAN_BIN_DIR)ltags
all: $(OLEAN_FILES) $(DEP_FILES) all: $(OLEAN_FILES) $(DEP_FILES)
@ -20,9 +23,17 @@ all: $(OLEAN_FILES) $(DEP_FILES)
@tr "\n" " " < $@.tmp >> $@ @tr "\n" " " < $@.tmp >> $@
@rm -f $@.tmp @rm -f $@.tmp
%.ilean: %.lean %.olean $(LEAN_VERSION_FILE)
$(LEAN) $(LEAN_OPTIONS) $< -i $@
etags tags: TAGS
TAGS: $(ILEAN_FILES)
$(LTAGS)
-include $(LEAN_FILES:.lean=.d) -include $(LEAN_FILES:.lean=.d)
.PHONY: all clean .PHONY: all clean tags etags gtags
clean: clean:
find . -type f -name "*.olean" -delete find . -type f -name "*.olean" -delete