-
Notifications
You must be signed in to change notification settings - Fork 124
/
Makefile
92 lines (66 loc) · 3.03 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
all: help
EXTERNALS=externals
PYTHON ?= `env which -a python2 python2.7 | head -n1`
PYTHONPATH=$$PYTHONPATH:$(EXTERNALS)/pypy
COMMON_BUILD_OPTS?=--thread --gcrootfinder=shadowstack --continuation
JIT_OPTS?=--opt=jit
TARGET_OPTS?=target.py
help:
@echo "make help - display this message"
@echo "make run - run the compiled interpreter"
@echo "make run_interactive - run without compiling (slow)"
@echo "make build_with_jit - build with jit enabled"
@echo "make build_no_jit - build without jit"
@echo "make fetch_externals - download and unpack external deps"
build_with_jit: fetch_externals
@if [ ! -d /usr/local/include/boost -a ! -d /usr/include/boost ] ; then echo "Boost C++ Library not found" && false; fi && \
$(PYTHON) $(EXTERNALS)/pypy/rpython/bin/rpython $(COMMON_BUILD_OPTS) --opt=jit target.py && \
make compile_basics
build_no_jit: fetch_externals
@if [ ! -d /usr/local/include/boost -a ! -d /usr/include/boost ] ; then echo "Boost C++ Library not found" && false; fi && \
$(PYTHON) $(EXTERNALS)/pypy/rpython/bin/rpython $(COMMON_BUILD_OPTS) target.py && \
make compile_basics
build_no_jit_shared: fetch_externals
@if [ ! -d /usr/local/include/boost -a ! -d /usr/include/boost ] ; then echo "Boost C++ Library not found" && false; fi && \
$(PYTHON) $(EXTERNALS)/pypy/rpython/bin/rpython $(COMMON_BUILD_OPTS) --shared target.py && \
make compile_basics
compile_basics:
@echo -e "\n\n\n\nWARNING: Compiling core libs. If you want to modify one of these files delete the .pxic files first\n\n\n\n"
./pixie-vm -c pixie/uv.pxi -c pixie/io.pxi -c pixie/stacklets.pxi -c pixie/stdlib.pxi -c pixie/repl.pxi
build: fetch_externals
$(PYTHON) $(EXTERNALS)/pypy/rpython/bin/rpython $(COMMON_BUILD_OPTS) $(JIT_OPTS) $(TARGET_OPTS)
fetch_externals: $(EXTERNALS)/pypy externals.fetched
externals.fetched:
echo https://github.com/pixie-lang/external-deps/releases/download/1.0/`uname -s`-`uname -m`.tar.bz2
curl -L https://github.com/pixie-lang/external-deps/releases/download/1.0/`uname -s`-`uname -m`.tar.bz2 > /tmp/externals.tar.bz2
tar -jxf /tmp/externals.tar.bz2 --strip-components=2
touch externals.fetched
$(EXTERNALS)/pypy:
mkdir $(EXTERNALS); \
cd $(EXTERNALS); \
curl https://bitbucket.org/pypy/pypy/get/91db1a9.tar.bz2 > pypy.tar.bz2; \
mkdir pypy; \
cd pypy; \
tar -jxf ../pypy.tar.bz2 --strip-components=1
run:
./pixie-vm
run_interactive:
@PYTHONPATH=$(PYTHONPATH) $(PYTHON) target.py
run_interactive_stacklets:
@PYTHONPATH=$(PYTHONPATH) $(PYTHON) target.py pixie/stacklets.pxi
run_built_tests: pixie-vm
./pixie-vm run-tests.pxi
run_interpreted_tests: target.py
PYTHONPATH=$(PYTHONPATH) $(PYTHON) target.py run-tests.pxi
compile_tests:
find "tests" -name "*.pxi" | xargs -L1 ./pixie-vm -l "tests" -c
compile_src:
find * -name "*.pxi" | grep "^pixie/" | xargs -L1 ./pixie-vm $(EXTERNALS_FLAGS) -c
clean_pxic:
find * -name "*.pxic" | xargs --no-run-if-empty rm
clean: clean_pxic
rm -rf ./lib
rm -rf ./include
rm -rf ./externals*
rm -f ./pixie-vm
rm -f ./*.pyc