2024-01-15 22:30:21 +00:00
|
|
|
|
# Copyright (c) 2023–2024 Emma Tebibyte <emma@tebibyte.media>
|
2024-01-16 07:06:48 +00:00
|
|
|
|
# Copyright (c) 2023–2024 DTB <trinity@trinity.moe>
|
2023-12-25 02:22:05 +00:00
|
|
|
|
# Copyright (c) 2023 Sasha Koshka <sashakoshka@tebibyte.media>
|
2024-03-27 03:36:19 +00:00
|
|
|
|
# Copyright (c) 2024 Aaditya Aryal <aryalaadi123@gmail.com>
|
2023-12-25 00:13:17 +00:00
|
|
|
|
# SPDX-License-Identifier: FSFAP
|
|
|
|
|
#
|
|
|
|
|
# Copying and distribution of this file, with or without modification, are
|
|
|
|
|
# permitted in any medium without royalty provided the copyright notice and this
|
|
|
|
|
# notice are preserved. This file is offered as-is, without any warranty.
|
|
|
|
|
|
2024-03-30 18:27:21 +00:00
|
|
|
|
#.POSIX:
|
2024-03-09 18:53:03 +00:00
|
|
|
|
|
2024-03-30 18:27:21 +00:00
|
|
|
|
include config.mk
|
2023-12-25 00:13:17 +00:00
|
|
|
|
|
2024-01-16 06:54:42 +00:00
|
|
|
|
.PHONY: all
|
2024-03-30 18:27:21 +00:00
|
|
|
|
all: prepare
|
|
|
|
|
@$(MAKE) -C lib
|
|
|
|
|
@$(MAKE) -C bin
|
2023-12-25 00:13:17 +00:00
|
|
|
|
|
2024-03-30 18:27:21 +00:00
|
|
|
|
|
|
|
|
|
.PHONY: prepare
|
|
|
|
|
prepare:
|
2023-12-28 06:20:31 +00:00
|
|
|
|
# keep build/include until bindgen(1) has stdin support
|
|
|
|
|
# https://github.com/rust-lang/rust-bindgen/issues/2703
|
2024-01-15 22:50:12 +00:00
|
|
|
|
mkdir -p build/bin build/include build/lib build/o build/test
|
2023-12-25 00:13:17 +00:00
|
|
|
|
|
2024-01-16 06:54:42 +00:00
|
|
|
|
.PHONY: clean
|
2023-12-25 00:13:17 +00:00
|
|
|
|
clean:
|
2024-03-24 19:28:42 +00:00
|
|
|
|
rm -rf build dist
|
2024-01-15 21:34:59 +00:00
|
|
|
|
|
|
|
|
|
dist: all
|
2024-03-24 19:28:42 +00:00
|
|
|
|
mkdir -p $(DESTDIR)/$(PREFIX)/bin $(DESTDIR)/$(PREFIX)/share/man/man1
|
|
|
|
|
cp build/bin/* $(DESTDIR)/$(PREFIX)/bin
|
2024-03-30 18:27:21 +00:00
|
|
|
|
cp bin/*/*.1 $(DESTDIR)/$(PREFIX)/share/man/man1
|
|
|
|
|
|
2024-01-15 21:34:59 +00:00
|
|
|
|
|
2024-01-16 06:54:42 +00:00
|
|
|
|
.PHONY: install
|
2024-01-15 21:34:59 +00:00
|
|
|
|
install: dist
|
2024-03-09 18:53:03 +00:00
|
|
|
|
cp -r $(DESTDIR)/* /
|
2023-12-25 00:13:17 +00:00
|
|
|
|
|
2024-01-16 06:54:42 +00:00
|
|
|
|
.PHONY: test
|
2024-03-30 18:27:21 +00:00
|
|
|
|
test: prepare
|
2023-12-25 00:13:17 +00:00
|
|
|
|
tests/posix-compat.sh
|
2024-01-15 22:50:12 +00:00
|
|
|
|
$(RUSTC) --test src/getopt-rs/lib.rs -o build/test/getopt
|