summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: bee264cf6d9f7fbb434f86509c35bbadd013f80f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# expac - an alpm data dump tool
VERSION = $(shell git describe --always)

# paths
PREFIX ?= /usr/local
MANPREFIX ?= $(PREFIX)/share/man

# compiler flags
CPPFLAGS := -DVERSION=\"$(VERSION)\" $(CPPFLAGS)
CFLAGS   := -std=c99 -g -pedantic -Wall -Wextra $(CFLAGS)
LDLIBS    = -lalpm

DISTFILES = expac.c README.pod

all: expac doc

doc: expac.1
expac.1: README.pod
	pod2man --section=1 --center="expac manual" --name="EXPAC" --release="expac $(VERSION)" $< $@

install: expac
	install -D -m755 expac $(DESTDIR)$(PREFIX)/bin/expac
	install -D -m644 expac.1 $(DESTDIR)$(MANPREFIX)/man1/expac.1

dist: clean
	mkdir expac-$(VERSION)
	cp $(DISTFILES) expac-$(VERSION)
	sed "s/^VERSION = .*/VERSION = $(VERSION)/" Makefile > expac-$(VERSION)/Makefile
	tar cf - expac-$(VERSION) | gzip -9 > expac-$(VERSION).tar.gz
	rm -rf expac-$(VERSION)

clean:
	$(RM) expac.o expac expac.1

.PHONY: all clean dist doc install doc