lean2/library/Makefile.common
Leonardo de Moura f319d084d4 feat(library/Makefile.common): use new --cache/-c option at Makefile.common
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-08-10 11:20:08 -07:00

29 lines
688 B
Makefile

TOP := $(dir $(lastword $(MAKEFILE_LIST)))
DIR = $(shell pwd)
LEAN_FILES = $(shell find $(DIR) -type f -name '*.lean')
OLEAN_FILES = $(LEAN_FILES:.lean=.olean)
DEP_FILES = $(LEAN_FILES:.lean=.d)
all: $(OLEAN_FILES) $(DEP_FILES)
%.olean: %.lean
@rm -f $@
$(LEAN) $(LEAN_OPTIONS) $< -o $@ -c $(@:.olean=.clean)
%.d: %.lean
@echo Making dependency file \'$@\' ...
@rm -f $@
@rm -f $@.tmp
@$(LEAN) --deps $< > $@.tmp
@printf "$(basename $@).olean : $< $@ " > $@
@tr "\n" " " < $@.tmp >> $@
@rm -f $@.tmp
-include $(LEAN_FILES:.lean=.d)
.PHONY: all clean
clean:
find . -type f -name "*.olean" -delete
find . -type f -name "*.clean" -delete
find . -type f -name "*.d" -delete