d8ae285f93
[skip ci]
26 lines
606 B
Makefile
26 lines
606 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
|
|
$(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:
|
|
find . -type f -name "*.olean" -delete
|
|
find . -type f -name "*.d" -delete
|