2015-02-22 10:19:23 -08:00
|
|
|
# Top-level Makefile. This has targets for various utility things. To actually
|
2015-09-22 07:45:58 -07:00
|
|
|
# compile Wren itself, it invokes util/wren.mk for the various configurations
|
2015-02-22 10:19:23 -08:00
|
|
|
# that Wren can be built with.
|
|
|
|
|
|
2016-07-02 11:17:14 +02:00
|
|
|
# Allows one to enable verbose builds with VERBOSE=1
|
|
|
|
|
V := @
|
|
|
|
|
ifeq ($(VERBOSE),1)
|
|
|
|
|
V :=
|
|
|
|
|
endif
|
|
|
|
|
|
2015-02-22 10:19:23 -08:00
|
|
|
# Executables are built to bin/. Libraries are built to lib/.
|
|
|
|
|
|
|
|
|
|
# A normal, optimized release build for the current CPU architecture.
|
2017-04-09 09:31:44 -07:00
|
|
|
# For convenience, also copies the interpreter to the top level.
|
2015-08-28 19:31:03 -07:00
|
|
|
release:
|
2016-07-02 11:17:14 +02:00
|
|
|
$(V) $(MAKE) -f util/wren.mk
|
2017-04-09 09:31:44 -07:00
|
|
|
$(V) cp bin/wren wren
|
2015-02-22 10:19:23 -08:00
|
|
|
|
|
|
|
|
# A debug build for the current architecture.
|
2015-08-28 19:31:03 -07:00
|
|
|
debug:
|
2016-07-02 11:17:14 +02:00
|
|
|
$(V) $(MAKE) -f util/wren.mk MODE=debug
|
2015-02-22 10:19:23 -08:00
|
|
|
|
2016-02-19 07:22:10 -08:00
|
|
|
# A release build of just the VM, both shared and static libraries.
|
2015-08-02 10:43:38 -07:00
|
|
|
vm:
|
2016-07-02 11:17:14 +02:00
|
|
|
$(V) $(MAKE) -f util/wren.mk vm
|
2015-08-02 10:43:38 -07:00
|
|
|
|
2016-02-19 07:22:10 -08:00
|
|
|
# A release build of the shared library for the VM.
|
|
|
|
|
shared:
|
2016-07-02 11:17:14 +02:00
|
|
|
$(V) $(MAKE) -f util/wren.mk shared
|
2016-02-19 07:22:10 -08:00
|
|
|
|
|
|
|
|
# A release build of the shared library for the VM.
|
|
|
|
|
static:
|
2016-07-02 11:17:14 +02:00
|
|
|
$(V) $(MAKE) -f util/wren.mk static
|
2016-02-19 07:22:10 -08:00
|
|
|
|
2015-02-22 10:19:23 -08:00
|
|
|
# Build all configurations.
|
|
|
|
|
all: debug release
|
2016-07-02 11:17:14 +02:00
|
|
|
$(V) $(MAKE) -f util/wren.mk LANG=cpp
|
|
|
|
|
$(V) $(MAKE) -f util/wren.mk MODE=debug LANG=cpp
|
|
|
|
|
$(V) $(MAKE) -f util/wren.mk ARCH=32
|
|
|
|
|
$(V) $(MAKE) -f util/wren.mk LANG=cpp ARCH=32
|
|
|
|
|
$(V) $(MAKE) -f util/wren.mk MODE=debug ARCH=32
|
|
|
|
|
$(V) $(MAKE) -f util/wren.mk MODE=debug LANG=cpp ARCH=32
|
|
|
|
|
$(V) $(MAKE) -f util/wren.mk ARCH=64
|
|
|
|
|
$(V) $(MAKE) -f util/wren.mk LANG=cpp ARCH=64
|
|
|
|
|
$(V) $(MAKE) -f util/wren.mk MODE=debug ARCH=64
|
|
|
|
|
$(V) $(MAKE) -f util/wren.mk MODE=debug LANG=cpp ARCH=64
|
2015-02-22 10:19:23 -08:00
|
|
|
|
2017-01-12 21:55:35 -08:00
|
|
|
# Travis uses these targets for continuous integration.
|
2016-10-09 09:18:27 +01:00
|
|
|
ci: ci_32 ci_64
|
|
|
|
|
|
|
|
|
|
ci_32:
|
2018-03-24 10:52:16 -07:00
|
|
|
$(V) $(MAKE) -f util/wren.mk MODE=debug LANG=c ARCH=32 vm cli api_test
|
2016-10-09 09:18:27 +01:00
|
|
|
$(V) ./util/test.py --suffix=d-32 $(suite)
|
2018-03-24 10:52:16 -07:00
|
|
|
$(V) $(MAKE) -f util/wren.mk MODE=debug LANG=cpp ARCH=32 vm cli api_test
|
2016-10-09 09:18:27 +01:00
|
|
|
$(V) ./util/test.py --suffix=d-cpp-32 $(suite)
|
2018-03-24 10:52:16 -07:00
|
|
|
$(V) $(MAKE) -f util/wren.mk MODE=release LANG=c ARCH=32 vm cli api_test
|
2016-10-09 09:18:27 +01:00
|
|
|
$(V) ./util/test.py --suffix=-32 $(suite)
|
2018-03-24 10:52:16 -07:00
|
|
|
$(V) $(MAKE) -f util/wren.mk MODE=release LANG=cpp ARCH=32 vm cli api_test
|
2016-10-09 09:18:27 +01:00
|
|
|
$(V) ./util/test.py --suffix=-cpp-32 $(suite)
|
|
|
|
|
|
|
|
|
|
ci_64:
|
2018-03-24 10:52:16 -07:00
|
|
|
$(V) $(MAKE) -f util/wren.mk MODE=debug LANG=c ARCH=64 vm cli api_test
|
2016-10-09 09:18:27 +01:00
|
|
|
$(V) ./util/test.py --suffix=d-64 $(suite)
|
2018-03-24 10:52:16 -07:00
|
|
|
$(V) $(MAKE) -f util/wren.mk MODE=debug LANG=cpp ARCH=64 vm cli api_test
|
2016-10-09 09:18:27 +01:00
|
|
|
$(V) ./util/test.py --suffix=d-cpp-64 $(suite)
|
2018-03-24 10:52:16 -07:00
|
|
|
$(V) $(MAKE) -f util/wren.mk MODE=release LANG=c ARCH=64 vm cli api_test
|
2016-10-09 09:18:27 +01:00
|
|
|
$(V) ./util/test.py --suffix=-64 $(suite)
|
2018-03-24 10:52:16 -07:00
|
|
|
$(V) $(MAKE) -f util/wren.mk MODE=release LANG=cpp ARCH=64 vm cli api_test
|
2016-10-09 09:18:27 +01:00
|
|
|
$(V) ./util/test.py --suffix=-cpp-64 $(suite)
|
|
|
|
|
|
2015-08-28 19:31:03 -07:00
|
|
|
# Remove all build outputs and intermediate files. Does not remove downloaded
|
|
|
|
|
# dependencies. Use cleanall for that.
|
2014-04-26 08:07:03 -07:00
|
|
|
clean:
|
2016-07-02 11:17:14 +02:00
|
|
|
$(V) rm -rf bin
|
|
|
|
|
$(V) rm -rf build
|
|
|
|
|
$(V) rm -rf lib
|
2015-01-15 21:12:51 -08:00
|
|
|
|
2014-01-23 23:29:50 -08:00
|
|
|
# Run the tests against the debug build of Wren.
|
2014-01-30 09:12:44 -08:00
|
|
|
test: debug
|
2018-03-24 10:52:16 -07:00
|
|
|
$(V) $(MAKE) -f util/wren.mk MODE=debug api_test
|
2016-07-02 11:17:14 +02:00
|
|
|
$(V) ./util/test.py $(suite)
|
2014-01-21 10:20:35 -06:00
|
|
|
|
2015-12-15 16:02:13 -08:00
|
|
|
benchmark: release
|
2018-03-24 10:52:16 -07:00
|
|
|
$(V) $(MAKE) -f util/wren.mk api_test
|
2016-07-02 11:17:14 +02:00
|
|
|
$(V) ./util/benchmark.py -l wren $(suite)
|
2015-12-15 16:02:13 -08:00
|
|
|
|
2018-07-18 08:20:11 -07:00
|
|
|
benchmark_baseline: release
|
|
|
|
|
$(V) $(MAKE) -f util/wren.mk api_test
|
|
|
|
|
$(V) ./util/benchmark.py --generate-baseline
|
|
|
|
|
|
2018-03-24 10:52:16 -07:00
|
|
|
unit_test:
|
|
|
|
|
$(V) $(MAKE) -f util/wren.mk MODE=debug unit_test
|
|
|
|
|
$(V) ./build/debug/test/unit_wrend
|
|
|
|
|
|
2014-01-23 23:29:50 -08:00
|
|
|
# Generate the Wren site.
|
2014-01-21 10:20:35 -06:00
|
|
|
docs:
|
2018-03-29 14:26:45 +01:00
|
|
|
mkdir -p build
|
2016-07-02 11:17:14 +02:00
|
|
|
$(V) ./util/generate_docs.py
|
2014-01-30 06:51:52 -08:00
|
|
|
|
2017-10-12 06:38:34 -07:00
|
|
|
# Continuously generate and serve the Wren site.
|
|
|
|
|
servedocs:
|
|
|
|
|
$(V) ./util/generate_docs.py --serve
|
|
|
|
|
|
2014-01-30 06:51:52 -08:00
|
|
|
# Continuously generate the Wren site.
|
|
|
|
|
watchdocs:
|
2016-07-02 11:17:14 +02:00
|
|
|
$(V) ./util/generate_docs.py --watch
|
2015-01-01 20:58:36 -08:00
|
|
|
|
|
|
|
|
# Build the docs and copy them to a local "gh-pages" directory.
|
|
|
|
|
gh-pages: docs
|
2016-07-02 11:17:14 +02:00
|
|
|
$(V) cp -r build/docs/. build/gh-pages
|
2015-02-22 10:19:23 -08:00
|
|
|
|
2015-03-26 21:21:41 +01:00
|
|
|
# Build amalgamation of all Wren library files.
|
2015-04-25 08:38:45 -07:00
|
|
|
amalgamation: src/include/wren.h src/vm/*.h src/vm/*.c
|
2015-09-22 07:45:58 -07:00
|
|
|
./util/generate_amalgamation.py > build/wren.c
|
2015-03-26 21:21:41 +01:00
|
|
|
|
2018-03-24 10:52:16 -07:00
|
|
|
.PHONY: all amalgamation benchmark builtin clean debug docs gh-pages release test vm watchdocs ci ci_32 ci_64
|