Skip to content

Commit

Permalink
Added Makefile target to create source distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
dvarrazzo committed Apr 6, 2011
1 parent 2ec010e commit 061f673
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -11,3 +11,4 @@ docs/html
docs/_static/jsMath/
sandbox/hello/hello
sandbox/bench/*.png
dist/*
21 changes: 20 additions & 1 deletion Makefile
Expand Up @@ -38,6 +38,15 @@ OBJS = src/pgmp.o src/pgmp_utils.o \
src/pmpz_roots.o src/pmpz_theor.o src/pmpz_bits.o src/pmpz_rand.o \
src/pmpq.o src/pmpq_io.o src/pmpq_arith.o src/pmpq_agg.o

SRCFILES = $(wildcard src/*.[ch])
TESTFILES = $(wildcard sql/*.sql) $(wildcard expected/*.out)
DOCS = $(wildcard docs/*.rst) docs/conf.py docs/Makefile docs/_static/pgmp.css

PKGFILES = AUTHORS COPYING README Makefile \
pgmp.control pgmp.pysql uninstall_pgmp.sql \
$(SRCFILES) $(DOCS) $(TESTFILES) \
$(wildcard tools/*.py)

ifeq ($(PG91),91)
INSTALLSCRIPT=pgmp--$(PGMP_VERSION).sql
UPGRADESCRIPT=pgmp--unpackaged--$(PGMP_VERSION).sql
Expand All @@ -49,7 +58,9 @@ endif

REGRESS = setup-$(PG91) mpz mpq
EXTRA_CLEAN = $(INSTALLSCRIPT) $(UPGRADESCRIPT)
DOCS=$(wildcard docs/*.rst) docs/conf.py docs/Makefile docs/_static/pgmp.css

PKGNAME = pgmp-$(PGMP_VERSION)
SRCPKG = dist/$(PKGNAME).tar.gz

USE_PGXS=1
PGXS := $(shell $(PG_CONFIG) --pgxs)
Expand All @@ -67,3 +78,11 @@ $(UPGRADESCRIPT): $(INSTALLSCRIPT)
docs:
$(MAKE) -C docs

sdist: $(SRCPKG)

$(SRCPKG): $(PKGFILES)
ln -sf . $(PKGNAME)
mkdir -p dist
rm -rf $@
tar czvf $@ $(addprefix $(PKGNAME)/,$^)
rm $(PKGNAME)

0 comments on commit 061f673

Please sign in to comment.