| 1 |
|
| 2 |
-include config.mak |
| 3 |
|
| 4 |
PG_CONFIG ?= pg_config |
| 5 |
PG_INCDIR = $(shell $(PG_CONFIG) --includedir) |
| 6 |
PG_LIBDIR = $(shell $(PG_CONFIG) --libdir) |
| 7 |
RST2MAN = rst2man |
| 8 |
|
| 9 |
bin_PROGRAMS = pgqd |
| 10 |
man_MANS = pgqd.1 |
| 11 |
|
| 12 |
pgqd_SOURCES = src/pgqd.c src/maint.c src/ticker.c src/retry.c \ |
| 13 |
src/pgsocket.c src/pgsocket.h \ |
| 14 |
src/pgqd.h |
| 15 |
nodist_pgqd_SOURCES = pgqd.ini.h |
| 16 |
pgqd_CPPFLAGS = -I$(PG_INCDIR) -Isrc -I. |
| 17 |
pgqd_LDFLAGS = -L$(PG_LIBDIR) |
| 18 |
pgqd_LIBS = -lpq -lm |
| 19 |
|
| 20 |
pgqd_EMBED_LIBUSUAL = 1 |
| 21 |
USUAL_DIR = lib |
| 22 |
AM_FEATURES = libusual |
| 23 |
|
| 24 |
EXTRA_DIST = pgqd.ini autogen.sh configure.ac Makefile \ |
| 25 |
README.rst NEWS.rst tests/test.sh \ |
| 26 |
lib/find_modules.sh \ |
| 27 |
lib/mk/antimake.mk lib/mk/amext-libusual.mk \ |
| 28 |
lib/mk/install-sh lib/mk/std-autogen.sh \ |
| 29 |
config.mak.in lib/usual/config.h.in \ |
| 30 |
configure config.sub config.guess install-sh |
| 31 |
CLEANFILES = pgqd.ini.h |
| 32 |
|
| 33 |
CONFIG_H = $(USUAL_DIR)/lib/usual/config.h |
| 34 |
|
| 35 |
include $(USUAL_DIR)/mk/antimake.mk |
| 36 |
|
| 37 |
pgqd.ini.h: pgqd.ini |
| 38 |
sed -e 's/.*/"&\\n"/' $< > $@ |
| 39 |
|
| 40 |
install: install-conf |
| 41 |
install-conf: |
| 42 |
mkdir -p '$(DESTDIR)$(docdir)/conf' |
| 43 |
$(INSTALL) -m 644 pgqd.ini '$(DESTDIR)$(docdir)/conf/pgqd.ini.templ' |
| 44 |
|
| 45 |
tags: |
| 46 |
ctags src/*.[ch] lib/usual/*.[ch] |
| 47 |
|
| 48 |
configure: |
| 49 |
./autogen.sh |
| 50 |
|
| 51 |
#config.mak: configure |
| 52 |
# ./configure |
| 53 |
|
| 54 |
*.o: $(CONFIG_H) |
| 55 |
|
| 56 |
$(CONFIG_H): |
| 57 |
$(error Please run ./configure first) |
| 58 |
|
| 59 |
xclean: clean |
| 60 |
rm -f config.mak config.guess config.sub config.log config.sub config.status |
| 61 |
rm -f configure install-sh lib/usual/config.h |
| 62 |
|
| 63 |
pgqd.1: README.rst |
| 64 |
$(RST2MAN) $< > $@ |
| 65 |
|
| 66 |
citest: check |
| 67 |
|
| 68 |
check: |
| 69 |
./tests/test.sh |
| 70 |
|
| 71 |
# PACKAGE_VERSION |
| 72 |
VERSION = $(shell ./configure --version | head -n 1 | sed -e 's/.* //') |
| 73 |
RXVERSION = $(shell echo $(VERSION) | sed 's/\./[.]/g') |
| 74 |
NEWS = NEWS.rst |
| 75 |
TAG = v$(VERSION) |
| 76 |
|
| 77 |
checkver: |
| 78 |
@echo "Checking version" |
| 79 |
@test -f configure || { echo "need ./configure"; exit 1; } |
| 80 |
@grep -q '^pgqd $(RXVERSION)\b' $(NEWS) \ |
| 81 |
|| { echo "Version '$(VERSION)' not in $(NEWS)"; exit 1; } |
| 82 |
@echo "Checking git repo" |
| 83 |
@git diff --stat --exit-code || { echo "ERROR: Unclean repo"; exit 1; } |
| 84 |
|
| 85 |
release: checkver |
| 86 |
git tag $(TAG) |
| 87 |
git push github $(TAG):$(TAG) |
| 88 |
|
| 89 |
unrelease: |
| 90 |
git push github :$(TAG) |
| 91 |
git tag -d $(TAG) |
| 92 |
|
| 93 |
shownote: |
| 94 |
awk -v VER="$(VERSION)" -f etc/note.awk $(NEWS) \ |
| 95 |
| pandoc -f rst -t gfm --wrap=none |
| 96 |
|