test(tests/playground/parser): create directory and Makefile for experiment

This commit is contained in:
Leonardo de Moura 2019-04-04 10:33:17 -07:00
parent 5f6106be83
commit dd72df26bd
4 changed files with 51 additions and 0 deletions

View file

@ -0,0 +1,40 @@
LEANC=../../../bin/leanc
LEAN=../../../bin/lean
SRCS = $(shell ls *.lean)
OLEANS = $(SRCS:.lean=.olean)
CPPS = $(SRCS:.lean=.cpp)
OBJS = $(SRCS:.lean=.o)
DEPS = $(SRCS:.lean=.depend)
CPPFLAGS = -O3
.PHONY: all clean
all: parser $(OLEANS)
depends: $(DEPS)
%.depend: %.lean
@echo $(<:.lean=.olean): `$(LEAN) --deps $< | python relative.py` > $@
%.olean: %.lean %.depend
$(LEAN) --make --cpp="$*.cpp.tmp" $<
mv "$*.cpp.tmp" "$*.cpp"
@touch $*.olean
%.cpp: %.olean
@
%.o: %.cpp
$(LEANC) -c $(CPPFLAGS) -o $@ $<
parser: $(OBJS)
$(LEANC) -o parser $(OBJS)
clean:
rm -f *.olean
rm -f *.cpp
rm -f *.o
rm -f *.depend
rm -f parser
include $(DEPS)

View file

@ -0,0 +1,2 @@
builtin_path
path .

View file

@ -0,0 +1,9 @@
# Copyright (c) 2018 Microsoft Corporation. All rights reserved.
# Released under Apache 2.0 license as described in the file LICENSE.
# Authors: Simon Hudon
import sys
import os
for x in sys.stdin:
print(os.path.relpath(x))