2014-06-29 01:32:44 +00:00
|
|
|
TOP := $(dir $(lastword $(MAKEFILE_LIST)))
|
2014-08-01 16:08:16 +00:00
|
|
|
LEAN_FILES = $(shell find . -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)
|
|
|
|
SED = sed
|
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 \'$@\' ...
|
|
|
|
@echo -n "$(basename $@).olean : $< $@ " > $@.tmp.1
|
|
|
|
@$(LEAN) --deps $< | $(SED) -e ':a;N;$$!ba;s/\n/ /g' > $@.tmp.2
|
|
|
|
@cat $@.tmp.1 $@.tmp.2 > $@
|
|
|
|
@rm -f $@.tmp.1
|
|
|
|
@rm -f $@.tmp.2
|
|
|
|
|
|
|
|
include $(LEAN_FILES:.lean=.d)
|
|
|
|
|
2014-06-29 01:32:44 +00:00
|
|
|
.PHONY: all clean
|
|
|
|
|
|
|
|
clean:
|
2014-08-01 16:08:16 +00:00
|
|
|
rm -f *.olean *.d *.d.tmp.1 $.d.tmp.2
|
2014-06-29 01:32:44 +00:00
|
|
|
|