2012-07-13 11:22:00 +02:00
|
|
|
#!/usr/bin/make
|
|
|
|
|
2012-07-24 14:13:27 +02:00
|
|
|
PACKAGE := tiramisu
|
|
|
|
|
2012-07-13 11:22:00 +02:00
|
|
|
INSTALL := install
|
|
|
|
INSTALL_DATA := install -m 644
|
|
|
|
INSTALL_PROGRAM := install -m 755
|
|
|
|
INSTALL_DIR := install -m 755 -d
|
|
|
|
|
|
|
|
PYTHON_OPTS =
|
|
|
|
ifneq ($(DESTDIR),)
|
|
|
|
PYTHON_OPTS += --root $(DESTDIR)
|
|
|
|
endif
|
|
|
|
|
2012-07-24 14:13:27 +02:00
|
|
|
LAST_TAG := $(shell git describe --tags --abbrev=0)
|
|
|
|
VERSION := $(shell echo $(LAST_TAG) | awk -F'/' '{print $$2}' || true)
|
|
|
|
VERSION_FILE := version.in
|
|
|
|
|
|
|
|
all:
|
2012-07-13 11:22:00 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) -r build
|
|
|
|
$(RM) -r tiramisu.egg-info/
|
2012-07-24 14:13:27 +02:00
|
|
|
|
2013-04-23 14:14:19 +02:00
|
|
|
#test: clean
|
|
|
|
# py.test
|
2012-07-24 14:13:27 +02:00
|
|
|
|
2012-07-13 11:22:00 +02:00
|
|
|
install:
|
|
|
|
python setup.py install --no-compile $(PYTHON_OPTS)
|
|
|
|
|
2012-07-24 14:13:27 +02:00
|
|
|
# List in .PHONY to force generation at each call
|
|
|
|
version.in:
|
|
|
|
@if test -n $(VERSION) ; then \
|
|
|
|
echo $(VERSION) > $(VERSION_FILE) ; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
dist: version.in
|
|
|
|
git archive --format=tar --prefix $(PACKAGE)-$(VERSION)/ -o $(PACKAGE)-$(VERSION).tar $(LAST_TAG) \
|
|
|
|
&& tar --xform "s,\(.*\),$(PACKAGE)-$(VERSION)/\1," -f $(PACKAGE)-$(VERSION).tar -r version.in \
|
|
|
|
&& gzip -9 $(PACKAGE)-$(VERSION).tar
|
|
|
|
|
|
|
|
.PHONY: all clean test install version.in dist
|