2014-06-29 01:32:44 +00:00
|
|
|
TOP := $(dir $(lastword $(MAKEFILE_LIST)))
|
2014-08-03 02:47:55 +00:00
|
|
|
DIR = $(shell pwd)
|
|
|
|
LEAN_FILES = $(shell find $(DIR) -type f -name '*.lean')
|
2014-06-29 01:32:44 +00:00
|
|
|
OLEAN_FILES = $(LEAN_FILES:.lean=.olean)
|
2014-08-01 16:08:16 +00:00
|
|
|
DEP_FILES = $(LEAN_FILES:.lean=.d)
|
2014-06-29 01:32:44 +00:00
|
|
|
|
2014-08-01 16:08:16 +00:00
|
|
|
all: $(OLEAN_FILES) $(DEP_FILES)
|
2014-06-29 01:32:44 +00:00
|
|
|
|
|
|
|
%.olean: %.lean
|
2014-07-15 20:56:36 +00:00
|
|
|
$(LEAN) $(LEAN_OPTIONS) $< -o $@
|
2014-06-29 01:32:44 +00:00
|
|
|
|
|
|
|
%.olean: %.lua
|
2014-07-15 20:56:36 +00:00
|
|
|
$(LEAN) $(LEAN_OPTIONS) $< -o $@
|
2014-06-29 01:32:44 +00:00
|
|
|
|
2014-08-01 16:08:16 +00:00
|
|
|
%.d: %.lean
|
|
|
|
@echo Making dependency file \'$@\' ...
|
2014-08-01 17:21:17 +00:00
|
|
|
@printf "$(basename $@).olean : $< $@ " > $@
|
|
|
|
@$(LEAN) --deps $< | tr "\n" " " >> $@
|
2014-08-01 16:08:16 +00:00
|
|
|
|
2014-08-01 17:11:01 +00:00
|
|
|
-include $(LEAN_FILES:.lean=.d)
|
2014-08-01 16:08:16 +00:00
|
|
|
|
2014-06-29 01:32:44 +00:00
|
|
|
.PHONY: all clean
|
|
|
|
|
|
|
|
clean:
|
2014-08-01 17:21:17 +00:00
|
|
|
rm -f *.olean *.d
|