## The main source files.
SOURCES += chpwd
+SOURCES += agpl.py
SOURCES += backend.py
SOURCES += cgi.py
SOURCES += cmdutil.py
SOURCES += crypto.py
SOURCES += dbmaint.py
SOURCES += format.py
+SOURCES += hash.py
SOURCES += httpauth.py
SOURCES += operation.py
SOURCES += output.py
CLEANFILES = *.pyc
###--------------------------------------------------------------------------
+### Additional machinery.
+
+V = 0
+
+V_AT = $(V_AT_$V)
+V_AT_0 = @
+
+v_tag = $(call v_tag_$V,$1)
+v_tag_0 = @printf " %-8s %s\n" '$1' '$@';
+
+###--------------------------------------------------------------------------
### The automatically-generated installation module.
TARGETS += auto.py auto-$(VERSION).py
-auto-$(VERSION).py: Makefile get-version $(SOURCES)
+auto-$(VERSION).py: Makefile get-version $(SOURCES) $(wildcard RELEASE)
+ $(call v_tag,GEN)\
{ echo "### -*-python-*-"; \
echo "PACKAGE = '$(PACKAGE)'"; \
echo "VERSION = '$(VERSION)'"; \
echo "HOME = '$$(pwd)'"; \
- } >$@.new
- mv $@.new $@
- rm -f auto.py.new && ln -s $@ auto.py.new && mv auto.py.new auto.py
+ } >$@.new && mv $@.new $@
auto.py: auto-$(VERSION).py
- for i in auto-*.py; do \
+ $(call v_tag,SYMLINK)\
+ rm -f auto.py.new && ln -s $^ auto.py.new && mv auto.py.new auto.py
+ $(V_AT)for i in auto-*.py; do \
case $$i in auto-$(VERSION).py) ;; *) rm -f $$i ;; esac; \
done
TARGETS += static/stamp
static/stamp: $(SOURCES) auto.py
- rm -rf static.new
- ./chpwd static static.new
- touch static.new/stamp
- rm -rf static && mv static.new static
+ $(V_AT)rm -rf static.new
+ $(call v_tag,GEN)./chpwd static static.new
+ $(V_AT)touch static.new/stamp
+ $(V_AT)rm -rf static && mv static.new static
clean::; rm -rf static
clean::; rm -f $(CLEANFILES)
.PHONY: clean
+###--------------------------------------------------------------------------
+### Distributions.
+
+distdir = $(PACKAGE)-$(VERSION)
+
+DISTFILES = $(SOURCES)
+DISTFILES += AGPLv3
+DISTFILES += Makefile get-version
+DISTFILES += userv.rc
+
+dist:
+ rm -rf $(distdir)
+ mkdir $(distdir)
+ cp $(DISTFILES) $(distdir)
+ echo $(VERSION) >$(distdir)/RELEASE
+ tar cvfz $(distdir).tar.gz $(distdir)
+ rm -rf $(distdir)
+.PHONY: dist
+
###----- That's all, folks --------------------------------------------------