Files
args/Makefile
2026-01-14 22:57:45 +05:30

39 lines
506 B
Makefile

.POSIX:
.PHONY: build docs
NAME := args
ifneq "$(wildcard src/*.h)" ''
HEADERS = $(wildcard src/*.h)
endif
define DOCS
$(subst docs/, build/man/,
$(patsubst
%.md, %,
$(wildcard docs/*.md)
)
)
endef
build: build/ build/$(NAME)
build/$(NAME): src/main.c $(HEADERS)
cc -o $@ $<
test:
$(error testing using `make' not supported; use `just')
docs:
make $(strip $(DOCS))
build/man/%: docs/%.md build/man/ docs/
pandoc --to man \
--standalone \
--output $@ \
$<
%/:
@mkdir -p $@