Makefile: split install target for binaries and documentation

This commit is contained in:
Lorenzo Figini 2024-05-30 17:52:40 +02:00
parent 2b8ec53d70
commit 4f0e06ea71

View File

@ -116,7 +116,7 @@ endif
## Targets
##
.PHONY: all clean check install docs
.PHONY: all clean check install-bin install-doc install docs
# Don't update archives in parallel, it's unsupported
.NOTPARALLEL: $(LIBDIR)/libgray.a
@ -135,15 +135,20 @@ tests.%: $(GRAY)
python -Bm tests '$@' --binary '$(GRAY)'
# Install libraries, binaries and documentation
install: $(BINARIES) $(LIBRARIES) $(SHAREDIR)/doc $(MANPAGES)
mkdir -p $(PREFIX)/{bin,lib,share/{doc/res,man/man{1,5}}}
install-bin: $(BINARIES) $(LIBRARIES)
mkdir -p $(PREFIX)/{bin,lib}
install -m555 -t $(PREFIX)/bin $(BINDIR)/*
install -m555 -t $(PREFIX)/lib $(LIBDIR)/*
install-doc: $(SHAREDIR)/doc $(MANPAGES)
mkdir -p $(PREFIX)/share/{doc/res,man/man{1,5}}
install -m644 -t $(PREFIX)/share/doc $(SHAREDIR)/doc/manual.*
install -m644 -t $(PREFIX)/share/doc/res $(SHAREDIR)/doc/res/*
install -m644 -t $(PREFIX)/share/man/man1 $(SHAREDIR)/*.1
install -m644 -t $(PREFIX)/share/man/man5 $(SHAREDIR)/*.5
install: install-bin install-doc
# dependencies
$(OBJDIR)/%.o: $(OBJDIR)/%.d