mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 01:08:41 -09:00
Makefile: Add ZIG variable and build target
The ZIG variable helps to test ncdu with different zig installations, and it allows Gentoo to inject the zig version that should be used to build zig into the Makefile. Also add a phony 'build' target as first target to the Makefile so that it becomes the default target. This allows the Gentoo package to use the default src_compile() function. See also https://bugs.gentoo.org/900547
This commit is contained in:
parent
46b88bcb5c
commit
74be277249
1 changed files with 7 additions and 2 deletions
9
Makefile
9
Makefile
|
|
@ -4,6 +4,8 @@
|
||||||
# Optional semi-standard Makefile with some handy tools.
|
# Optional semi-standard Makefile with some handy tools.
|
||||||
# Ncdu itself can be built with just the zig build system.
|
# Ncdu itself can be built with just the zig build system.
|
||||||
|
|
||||||
|
ZIG ?= zig
|
||||||
|
|
||||||
PREFIX ?= /usr/local
|
PREFIX ?= /usr/local
|
||||||
BINDIR ?= ${PREFIX}/bin
|
BINDIR ?= ${PREFIX}/bin
|
||||||
MANDIR ?= ${PREFIX}/share/man/man1
|
MANDIR ?= ${PREFIX}/share/man/man1
|
||||||
|
|
@ -11,11 +13,14 @@ ZIG_FLAGS ?= -Drelease-fast
|
||||||
|
|
||||||
NCDU_VERSION=$(shell grep 'program_version = "' src/main.zig | sed -e 's/^.*"\(.\+\)".*$$/\1/')
|
NCDU_VERSION=$(shell grep 'program_version = "' src/main.zig | sed -e 's/^.*"\(.\+\)".*$$/\1/')
|
||||||
|
|
||||||
|
.PHONY: build
|
||||||
|
build: release doc
|
||||||
|
|
||||||
release:
|
release:
|
||||||
zig build ${ZIG_FLAGS}
|
$(ZIG) build ${ZIG_FLAGS}
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
zig build
|
$(ZIG) build
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf zig-cache zig-out
|
rm -rf zig-cache zig-out
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue