mirror of
https://github.com/facebook/zstd.git
synced 2025-12-09 00:03:18 -05:00
programs/Makefile : better support for GNU conventions
see https://www.gnu.org/prep/standards/html_node/Command-Variables.html
This commit is contained in:
parent
3a12531a3d
commit
baa37c3362
@ -7,6 +7,8 @@ in order to make it easier to select or exclude specific features.
|
|||||||
|
|
||||||
#### Building
|
#### Building
|
||||||
|
|
||||||
|
`Makefile` script is provided, supporting the standard set of commands,
|
||||||
|
directories, and variables (see https://www.gnu.org/prep/standards/html_node/Command-Variables.html).
|
||||||
- `make` : generates both static and dynamic libraries
|
- `make` : generates both static and dynamic libraries
|
||||||
- `make install` : install libraries in default system directories
|
- `make install` : install libraries in default system directories
|
||||||
|
|
||||||
|
|||||||
@ -209,8 +209,8 @@ zstd-decompress: $(ZSTDCOMMON_FILES) $(ZSTDDECOMP_FILES) zstdcli.c fileio.c
|
|||||||
zstd-compress: $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES) zstdcli.c fileio.c
|
zstd-compress: $(ZSTDCOMMON_FILES) $(ZSTDCOMP_FILES) zstdcli.c fileio.c
|
||||||
$(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NODECOMPRESS $^ -o $@$(EXT)
|
$(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NODECOMPRESS $^ -o $@$(EXT)
|
||||||
|
|
||||||
# zstd is now built with multithreading enabled y default
|
|
||||||
zstdmt: zstd
|
zstdmt: zstd
|
||||||
|
ln -sf zstd zstdmt
|
||||||
|
|
||||||
.PHONY: generate_res
|
.PHONY: generate_res
|
||||||
generate_res:
|
generate_res:
|
||||||
@ -252,25 +252,35 @@ ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD Ne
|
|||||||
list:
|
list:
|
||||||
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
|
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
|
||||||
|
|
||||||
|
DESTDIR ?=
|
||||||
|
# directory variables : GNU conventions prefer lowercase
|
||||||
|
# see https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html
|
||||||
|
# support both lower and uppercase (BSD), use uppercase in script
|
||||||
|
prefix ?= /usr/local
|
||||||
|
PREFIX ?= $(prefix)
|
||||||
|
exec_prefix ?= $(PREFIX)
|
||||||
|
bindir ?= $(exec_prefix)/bin
|
||||||
|
BINDIR ?= $(bindir)
|
||||||
|
datarootdir ?= $(PREFIX)/share
|
||||||
|
mandir ?= $(datarootdir)/man
|
||||||
|
man1dir ?= $(mandir)/man1
|
||||||
|
|
||||||
|
ifneq (,$(filter $(shell uname),OpenBSD FreeBSD NetBSD DragonFly SunOS))
|
||||||
|
MANDIR ?= $(PREFIX)/man/man1
|
||||||
|
else
|
||||||
|
MANDIR ?= $(man1dir)
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter $(shell uname),SunOS))
|
ifneq (,$(filter $(shell uname),SunOS))
|
||||||
INSTALL ?= ginstall
|
INSTALL ?= ginstall
|
||||||
else
|
else
|
||||||
INSTALL ?= install
|
INSTALL ?= install
|
||||||
endif
|
endif
|
||||||
|
|
||||||
PREFIX ?= /usr/local
|
INSTALL_PROGRAM ?= $(INSTALL)
|
||||||
DESTDIR ?=
|
INSTALL_SCRIPT ?= $(INSTALL_PROGRAM)
|
||||||
BINDIR ?= $(PREFIX)/bin
|
INSTALL_DATA ?= $(INSTALL) -m 644
|
||||||
|
INSTALL_MAN ?= $(INSTALL_DATA)
|
||||||
ifneq (,$(filter $(shell uname),OpenBSD FreeBSD NetBSD DragonFly SunOS))
|
|
||||||
MANDIR ?= $(PREFIX)/man/man1
|
|
||||||
else
|
|
||||||
MANDIR ?= $(PREFIX)/share/man/man1
|
|
||||||
endif
|
|
||||||
|
|
||||||
INSTALL_PROGRAM ?= $(INSTALL) -m 755
|
|
||||||
INSTALL_SCRIPT ?= $(INSTALL) -m 755
|
|
||||||
INSTALL_MAN ?= $(INSTALL) -m 644
|
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install: zstd
|
install: zstd
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user