Commit 08daffd3 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov

ioping: rework binary packs

- add pdf and txt versions of man page into archive
Signed-off-by: default avatarKonstantin Khlebnikov <koct9i@gmail.com>
parent 0ac1276f
......@@ -8,6 +8,7 @@ SRCS=ioping.c
OBJS=$(SRCS:.c=.o)
BINS=ioping
MANS=ioping.1
MANS_F=$(MANS:.1=.txt) $(MANS:.1=.pdf)
DOCS=README changelog
SPEC=ioping.spec
......@@ -15,6 +16,7 @@ PACKAGE=ioping
VERSION=$(shell cat version)
DISTDIR=$(PACKAGE)-$(VERSION)
DISTFILES=$(SRCS) $(MANS) $(DOCS) $(SPEC) Makefile
PACKFILES=$(BINS) $(MANS) $(MANS_F) $(DOCS)
STRIP=strip
TARGET=$(shell ${CC} -dumpmachine | cut -d- -f 2)
......@@ -32,7 +34,7 @@ version: $(DISTFILES)
test ! -d .git || git describe --tags --dirty=+ | sed 's/^v//;s/-/./g' > $@
clean:
$(RM) -f $(OBJS) $(BINS)
$(RM) -f $(OBJS) $(BINS) $(MANS_F)
install: $(BINS) $(MANS)
mkdir -p $(DESTDIR)$(BINDIR)
......@@ -40,8 +42,8 @@ install: $(BINS) $(MANS)
mkdir -p $(DESTDIR)$(MAN1DIR)
install -m 644 $(MANS) $(DESTDIR)$(MAN1DIR)
%.o: %.c
$(CC) $(CFLAGS) -DVERSION=\"${VERSION}\" -c -o $@ $^
%.o: %.c version
$(CC) $(CFLAGS) -DVERSION=\"${VERSION}\" -c -o $@ $<
%.ps: %.1
man -t ./$< > $@
......@@ -49,19 +51,21 @@ install: $(BINS) $(MANS)
%.pdf: %.ps
ps2pdf $< $@
%.txt: %.1
MANWIDTH=80 man ./$< | col -b > $@
$(BINS): $(OBJS)
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS)
dist: version $(DISTFILES)
tar -cz --transform='s,^,$(DISTDIR)/,S' $^ -f $(DISTDIR).tar.gz
binary-tar: clean all
binary-tgz: $(PACKFILES)
${STRIP} ${BINS}
tar czf ${PACKAGE}-${VERSION}-${TARGET}.tgz ${BINS} ${MANS}
tar czf ${PACKAGE}-${VERSION}-${TARGET}.tgz $^
binary-zip: clean all ${MANS}
binary-zip: $(PACKFILES)
${STRIP} ${BINS}
MANWIDTH=80 man ./${MANS} | col -b > ioping.txt
zip ${PACKAGE}-${VERSION}-${TARGET}.zip ${BINS} ioping.txt
zip ${PACKAGE}-${VERSION}-${TARGET}.zip $^
.PHONY: all clean install dist
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment