]> git.ipfire.org Git - pakfire.git/blobdiff - Makefile
Huge change: Introduce pakfire-client and -daemon.
[pakfire.git] / Makefile
index 5b9c98b1b7058641714858daad03d45891e8363d..e9d80ed4867c013c1e89d591789dd3912fbc3048 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,29 +1,51 @@
 
-DESTDIR ?= /
+include Makeconfig
+
+SUBDIRS = po python tools tools/fake-environ
 
 all: build
 
 .PHONY: build
 build:
-       python setup.py build
+       for dir in $(SUBDIRS); do \
+               $(MAKE) -C $${dir} || exit; \
+       done
 
 .PHONY: clean
 clean:
-       python setup.py clean
-       -rm -rfv build
+       for dir in $(SUBDIRS); do \
+               $(MAKE) -C $${dir} clean || exit; \
+       done
 
 .PHONY: dist
 dist:
-       python setup.py sdist
+       git archive --format=tar --prefix=$(PACKAGE_NAME)-$(PACKAGE_VERSION)/ HEAD | \
+               gzip -9 > $(PACKAGE_NAME)-$(PACKAGE_VERSION).tar.gz
 
 .PHONY: install
-install:
-       python setup.py install  --root $(DESTDIR)
+install: build
+       for dir in $(SUBDIRS); do \
+               $(MAKE) -C $${dir} install || exit; \
+       done
+
+       -mkdir -pv $(DESTDIR)$(PREFIX)/lib/pakfire/macros
+       cp -vf macros/*.macro $(DESTDIR)$(PREFIX)/lib/pakfire/macros
 
+       # Install example configuration.
        -mkdir -pv $(DESTDIR)/etc/pakfire.repos.d
-       cp -vf examples/pakfire.conf $(DESTDIR)/etc/pakfire.conf
+       # Don't overwrite already installed configuration file.
+       [ -e "$(DESTDIR)/etc/pakfire.conf" ] || \
+               cp -vf examples/pakfire.conf $(DESTDIR)/etc/pakfire.conf
+       [ -e "$(DESTDIR)/etc/pakfire-client.conf" ] || \
+               cp -vf examples/pakfire-client.conf $(DESTDIR)/etc/pakfire-client.conf
+       [ -e "$(DESTDIR)/etc/pakfire-daemon.conf" ] || \
+               cp -vf examples/pakfire-daemon.conf $(DESTDIR)/etc/pakfire-daemon.conf
        cp -vf examples/pakfire.repos.d/* $(DESTDIR)/etc/pakfire.repos.d/
 
 .PHONY: check
 check:
        ./runpychecker.sh
+
+.PHONY: po
+po:
+       $(MAKE) -C po