24 lines
525 B
Text
24 lines
525 B
Text
TOP := $(dir $(lastword $(MAKEFILE_LIST)))
|
|
LEAN_FILES = $(shell find . -type f -name '*.lean')
|
|
OLEAN_FILES = $(LEAN_FILES:.lean=.olean)
|
|
DEP_FILES = $(LEAN_FILES:.lean=.d)
|
|
|
|
all: $(OLEAN_FILES) $(DEP_FILES)
|
|
|
|
%.olean: %.lean
|
|
$(LEAN) $(LEAN_OPTIONS) $< -o $@
|
|
|
|
%.olean: %.lua
|
|
$(LEAN) $(LEAN_OPTIONS) $< -o $@
|
|
|
|
%.d: %.lean
|
|
@echo Making dependency file \'$@\' ...
|
|
@printf "$(basename $@).olean : $< $@ " > $@
|
|
@$(LEAN) --deps $< | tr "\n" " " >> $@
|
|
|
|
-include $(LEAN_FILES:.lean=.d)
|
|
|
|
.PHONY: all clean
|
|
|
|
clean:
|
|
rm -f *.olean *.d
|