mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-22 18:19:54 -04:00
MAINT: Makefile improvements
This commit is contained in:
parent
1623c540bc
commit
9f787972ac
26
Makefile
26
Makefile
@ -1,10 +1,28 @@
|
|||||||
SHELL = /bin/bash -o pipefail
|
SHELL = /bin/bash -o pipefail
|
||||||
|
|
||||||
|
# some platform compatibility hacks
|
||||||
|
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
|
||||||
|
execsuffix := $(if $(findstring Windows_NT,$(OS)),.exe, )
|
||||||
|
pathchar := $(if $(findstring Windows_NT,$(OS)),\,/)
|
||||||
|
|
||||||
|
sourcefiles := $(call rwildcard,src,*.rs)
|
||||||
|
|
||||||
all: test build
|
all: test build
|
||||||
|
|
||||||
build:
|
debugtarget := target$(pathchar)debug$(pathchar)ucg$(execsuffix)
|
||||||
|
releasetarget := target$(pathchar)release$(pathchar)ucg$(execsuffix)
|
||||||
|
|
||||||
|
$(debugtarget): $(sourcefiles)
|
||||||
cargo build
|
cargo build
|
||||||
|
|
||||||
|
$(releasetarget): $(sourcefiles)
|
||||||
|
cargo build --release
|
||||||
|
|
||||||
|
build: $(debugtarget)
|
||||||
|
cargo build
|
||||||
|
|
||||||
|
buildrelease: $(releasetarget)
|
||||||
|
|
||||||
test: unit integration stdlibtest
|
test: unit integration stdlibtest
|
||||||
|
|
||||||
unit:
|
unit:
|
||||||
@ -23,5 +41,9 @@ publish: build test
|
|||||||
cargo publish
|
cargo publish
|
||||||
(cd docsite; make deploysite)
|
(cd docsite; make deploysite)
|
||||||
|
|
||||||
|
bench: buildrelease
|
||||||
|
hyperfine --warmup=5 --runs=50 "target$(pathchar)release$(pathchar)ucg$(execsuffix) test -r integration_tests"
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f integration.log stdlibtest.log unittest.log
|
rm -f integration.log stdlibtest.log unittest.log
|
||||||
|
cargo clean
|
Loading…
x
Reference in New Issue
Block a user