2024-01-15 15:30:21 -07:00
|
|
|
|
# Copyright (c) 2023–2024 Emma Tebibyte <emma@tebibyte.media>
|
2024-01-16 00:06:48 -07:00
|
|
|
|
# Copyright (c) 2023–2024 DTB <trinity@trinity.moe>
|
2023-12-24 19:22:05 -07:00
|
|
|
|
# Copyright (c) 2023 Sasha Koshka <sashakoshka@tebibyte.media>
|
2024-03-26 21:36:19 -06:00
|
|
|
|
# Copyright (c) 2024 Aaditya Aryal <aryalaadi123@gmail.com>
|
2023-12-24 17:13:17 -07: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 12:27:21 -06:00
|
|
|
|
#.POSIX:
|
2024-03-09 11:53:03 -07:00
|
|
|
|
|
2024-03-30 12:27:21 -06:00
|
|
|
|
include config.mk
|
2023-12-24 17:13:17 -07:00
|
|
|
|
|
2024-01-15 23:54:42 -07:00
|
|
|
|
.PHONY: all
|
2024-03-30 12:27:21 -06:00
|
|
|
|
all: prepare
|
|
|
|
|
@$(MAKE) -C lib
|
|
|
|
|
@$(MAKE) -C bin
|
2023-12-24 17:13:17 -07:00
|
|
|
|
|
2024-03-30 12:27:21 -06:00
|
|
|
|
|
|
|
|
|
.PHONY: prepare
|
|
|
|
|
prepare:
|
2023-12-27 23:20:31 -07:00
|
|
|
|
# keep build/include until bindgen(1) has stdin support
|
|
|
|
|
# https://github.com/rust-lang/rust-bindgen/issues/2703
|
2024-01-15 15:50:12 -07:00
|
|
|
|
mkdir -p build/bin build/include build/lib build/o build/test
|
2023-12-24 17:13:17 -07:00
|
|
|
|
|
2024-01-15 23:54:42 -07:00
|
|
|
|
.PHONY: clean
|
2023-12-24 17:13:17 -07:00
|
|
|
|
clean:
|
2024-03-24 13:28:42 -06:00
|
|
|
|
rm -rf build dist
|
2024-01-15 14:34:59 -07:00
|
|
|
|
|
|
|
|
|
dist: all
|
2024-03-24 13:28:42 -06:00
|
|
|
|
mkdir -p $(DESTDIR)/$(PREFIX)/bin $(DESTDIR)/$(PREFIX)/share/man/man1
|
|
|
|
|
cp build/bin/* $(DESTDIR)/$(PREFIX)/bin
|
2024-03-30 12:27:21 -06:00
|
|
|
|
cp bin/*/*.1 $(DESTDIR)/$(PREFIX)/share/man/man1
|
|
|
|
|
|
2024-01-15 14:34:59 -07:00
|
|
|
|
|
2024-01-15 23:54:42 -07:00
|
|
|
|
.PHONY: install
|
2024-01-15 14:34:59 -07:00
|
|
|
|
install: dist
|
2024-03-09 11:53:03 -07:00
|
|
|
|
cp -r $(DESTDIR)/* /
|
2023-12-24 17:13:17 -07:00
|
|
|
|
|
2024-01-15 23:54:42 -07:00
|
|
|
|
.PHONY: test
|
2024-03-30 12:27:21 -06:00
|
|
|
|
test: prepare
|
2023-12-24 17:13:17 -07:00
|
|
|
|
tests/posix-compat.sh
|
2024-01-15 15:50:12 -07:00
|
|
|
|
$(RUSTC) --test src/getopt-rs/lib.rs -o build/test/getopt
|