# Copyright (c) 2023–2024 Emma Tebibyte # Copyright (c) 2023–2024 DTB # Copyright (c) 2023 Sasha Koshka # Copyright (c) 2024 Aaditya Aryal # 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. #.POSIX: include config.mk .PHONY: all all: prepare @$(MAKE) -C lib @$(MAKE) -C bin .PHONY: prepare prepare: # keep build/include until bindgen(1) has stdin support # https://github.com/rust-lang/rust-bindgen/issues/2703 mkdir -p build/bin build/include build/lib build/o build/test .PHONY: clean clean: rm -rf build dist dist: all mkdir -p $(DESTDIR)/$(PREFIX)/bin $(DESTDIR)/$(PREFIX)/share/man/man1 cp build/bin/* $(DESTDIR)/$(PREFIX)/bin cp bin/*/*.1 $(DESTDIR)/$(PREFIX)/share/man/man1 .PHONY: install install: dist cp -r $(DESTDIR)/* / .PHONY: test test: prepare tests/posix-compat.sh $(RUSTC) --test src/getopt-rs/lib.rs -o build/test/getopt