feat: add conditional VERBOSE variable to Makefiles for suppressing @ prefix
Introduce a V variable that defaults to @ and is cleared when VERBOSE=1 is set, replacing all hardcoded @ prefixes in Makefile and util/wren.mk with $(V) to allow users to enable verbose build output.
This commit is contained in:
@@ -2,73 +2,79 @@
|
||||
# compile Wren itself, it invokes util/wren.mk for the various configurations
|
||||
# that Wren can be built with.
|
||||
|
||||
# Allows one to enable verbose builds with VERBOSE=1
|
||||
V := @
|
||||
ifeq ($(VERBOSE),1)
|
||||
V :=
|
||||
endif
|
||||
|
||||
# Executables are built to bin/. Libraries are built to lib/.
|
||||
|
||||
# A normal, optimized release build for the current CPU architecture.
|
||||
release:
|
||||
@ $(MAKE) -f util/wren.mk
|
||||
@ cp bin/wren wren # For convenience, copy the interpreter to the top level.
|
||||
$(V) $(MAKE) -f util/wren.mk
|
||||
$(V) cp bin/wren wren # For convenience, copy the interpreter to the top level.
|
||||
|
||||
# A debug build for the current architecture.
|
||||
debug:
|
||||
@ $(MAKE) -f util/wren.mk MODE=debug
|
||||
$(V) $(MAKE) -f util/wren.mk MODE=debug
|
||||
|
||||
# A release build of just the VM, both shared and static libraries.
|
||||
vm:
|
||||
@ $(MAKE) -f util/wren.mk vm
|
||||
$(V) $(MAKE) -f util/wren.mk vm
|
||||
|
||||
# A release build of the shared library for the VM.
|
||||
shared:
|
||||
@ $(MAKE) -f util/wren.mk shared
|
||||
$(V) $(MAKE) -f util/wren.mk shared
|
||||
|
||||
# A release build of the shared library for the VM.
|
||||
static:
|
||||
@ $(MAKE) -f util/wren.mk static
|
||||
$(V) $(MAKE) -f util/wren.mk static
|
||||
|
||||
# Build all configurations.
|
||||
all: debug release
|
||||
@ $(MAKE) -f util/wren.mk LANG=cpp
|
||||
@ $(MAKE) -f util/wren.mk MODE=debug LANG=cpp
|
||||
@ $(MAKE) -f util/wren.mk ARCH=32
|
||||
@ $(MAKE) -f util/wren.mk LANG=cpp ARCH=32
|
||||
@ $(MAKE) -f util/wren.mk MODE=debug ARCH=32
|
||||
@ $(MAKE) -f util/wren.mk MODE=debug LANG=cpp ARCH=32
|
||||
@ $(MAKE) -f util/wren.mk ARCH=64
|
||||
@ $(MAKE) -f util/wren.mk LANG=cpp ARCH=64
|
||||
@ $(MAKE) -f util/wren.mk MODE=debug ARCH=64
|
||||
@ $(MAKE) -f util/wren.mk MODE=debug LANG=cpp ARCH=64
|
||||
$(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
|
||||
|
||||
# Remove all build outputs and intermediate files. Does not remove downloaded
|
||||
# dependencies. Use cleanall for that.
|
||||
clean:
|
||||
@ rm -rf bin
|
||||
@ rm -rf build
|
||||
@ rm -rf lib
|
||||
$(V) rm -rf bin
|
||||
$(V) rm -rf build
|
||||
$(V) rm -rf lib
|
||||
|
||||
# Remove all build outputs, intermediate files, and downloaded dependencies.
|
||||
cleanall: clean
|
||||
@ rm -rf deps
|
||||
$(V) rm -rf deps
|
||||
|
||||
# Run the tests against the debug build of Wren.
|
||||
test: debug
|
||||
@ $(MAKE) -f util/wren.mk MODE=debug test
|
||||
@ ./util/test.py $(suite)
|
||||
$(V) $(MAKE) -f util/wren.mk MODE=debug test
|
||||
$(V) ./util/test.py $(suite)
|
||||
|
||||
benchmark: release
|
||||
@ $(MAKE) -f util/wren.mk test
|
||||
@ ./util/benchmark.py -l wren $(suite)
|
||||
$(V) $(MAKE) -f util/wren.mk test
|
||||
$(V) ./util/benchmark.py -l wren $(suite)
|
||||
|
||||
# Generate the Wren site.
|
||||
docs:
|
||||
@ ./util/generate_docs.py
|
||||
$(V) ./util/generate_docs.py
|
||||
|
||||
# Continuously generate the Wren site.
|
||||
watchdocs:
|
||||
@ ./util/generate_docs.py --watch
|
||||
$(V) ./util/generate_docs.py --watch
|
||||
|
||||
# Build the docs and copy them to a local "gh-pages" directory.
|
||||
gh-pages: docs
|
||||
@ cp -r build/docs/. build/gh-pages
|
||||
$(V) cp -r build/docs/. build/gh-pages
|
||||
|
||||
# Build amalgamation of all Wren library files.
|
||||
amalgamation: src/include/wren.h src/vm/*.h src/vm/*.c
|
||||
|
||||
Reference in New Issue
Block a user