summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2010-09-17 17:23:00 +0400
committerAndrey Nazarov <skuller@skuller.net>2010-09-17 17:23:00 +0400
commit45e6aff04accfbafeeb27ebe32382dd75ff80939 (patch)
treeea419dafa77c101473edf0568ffd7494ad3b4ba3 /Makefile
parente8918e68192d1a2350d3d930f1c2b5730d38b6df (diff)
Cleaned up top level Makefile.
Split install/uninstall targets and moved them into ‘build/*.mk’ files. Parallel and individual builds of main targets are now possible.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile98
1 files changed, 32 insertions, 66 deletions
diff --git a/Makefile b/Makefile
index 45b47d5..68f4bd8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,81 +1,47 @@
include config.mk
-.PHONY: default all binaries clean distclean install strip tags
+.PHONY: default all binary strip tags clean distclean
default: all
-all: binaries
+all: binary
-binaries:
- for t in $(TARGETS) ; do \
- $(MAKE) -C .$$t -f $(SRCDIR)/build/$$t.mk all || exit 1 ; \
- done
+%-binary:
+ $(MAKE) -C .$* -f $(SRCDIR)/build/$*.mk binary
-clean:
- for t in $(TARGETS) ; do \
- $(MAKE) -C .$$t -f $(SRCDIR)/build/$$t.mk clean ; \
- done
+%-strip:
+ $(MAKE) -C .$* -f $(SRCDIR)/build/$*.mk strip
+
+%-clean:
+ $(MAKE) -C .$* -f $(SRCDIR)/build/$*.mk clean
+
+binary: $(patsubst %,%-binary,$(TARGETS))
+
+strip: $(patsubst %,%-strip,$(TARGETS))
+
+tags:
+ ctags $(SRCDIR)/src/*.[ch] $(SRCDIR)/src/baseq2/*.[ch]
+
+clean: $(patsubst %,%-clean,$(TARGETS))
distclean: clean
- for t in $(TARGETS) ; do \
- rm -r .$$t ; \
- done
+ rm -rf .q2pro .q2proded .baseq2
rm -f config.mk config.h
rm -f tags
-ifdef SINGLEUSER
-
-install:
- echo "Single user mode configured, can't install" && exit 1
-
-uninstall:
- echo "Single user mode configured, can't uninstall" && exit 1
-
-else # SINGLEUSER
-
-install:
- for t in $(EXECUTABLES) ; do \
- install -m 755 -D $$t $(DESTDIR)$(BINDIR)/$$t ; \
- done
- for t in $(LIBRARIES) ; do \
- install -m 755 -D $$t $(DESTDIR)$(LIBDIR)/baseq2/$$t ; \
- done
- install -m 644 -D $(SRCDIR)/man/q2pro.6 \
- $(DESTDIR)$(MANDIR)/q2pro.6
- install -m 644 -D $(SRCDIR)/man/q2proded.6 \
- $(DESTDIR)$(MANDIR)/q2proded.6
- install -m 644 -D $(SRCDIR)/src/q2pro.menu \
- $(DESTDIR)$(DATADIR)/baseq2/q2pro.menu
- install -m 644 -D $(SRCDIR)/src/q2pro.desktop \
- $(DESTDIR)$(APPDIR)/q2pro.desktop
- install -m 644 -D $(SRCDIR)/src/q2pro.xpm \
- $(DESTDIR)$(PIXDIR)/q2pro.xpm
+ifndef SINGLEUSER
+.PHONY: install uninstall
+
+%-install:
+ $(MAKE) -C .$* -f $(SRCDIR)/build/$*.mk install
+
+%-uninstall:
+ $(MAKE) -C .$* -f $(SRCDIR)/build/$*.mk uninstall
+
+install: $(patsubst %,%-install,$(TARGETS))
install -m 644 -D $(SRCDIR)/src/q2pro.default \
$(DESTDIR)$(SITECFG)
-uninstall:
- for t in $(EXECUTABLES) ; do \
- rm -f $(DESTDIR)$(BINDIR)/$$t ; \
- done
- for t in $(LIBRARIES) ; do \
- rm -f $(DESTDIR)$(LIBDIR)/baseq2/$$t ; \
- done
- rm -f $(DESTDIR)$(MANDIR)/q2pro.6
- rm -f $(DESTDIR)$(MANDIR)/q2proded.6
- rm -f $(DESTDIR)$(DATADIR)/baseq2/q2pro.menu
- rm -f $(DESTDIR)$(APPDIR)/q2pro.desktop
- rm -f $(DESTDIR)$(PIXDIR)/q2pro.xpm
- rm -f $(DESTDIR)$(SITECFG)
-
-endif # !SINGLEUSER
-
-strip:
- for t in $(BINARIES) ; do \
- $(STRIP) $$t ; \
- done
-
-docs:
- $(MAKE) -C doc/wiki
-
-tags:
- ctags $(SRCDIR)/src/*.[ch] $(SRCDIR)/src/baseq2/*.[ch]
+uninstall: $(patsubst %,%-uninstall,$(TARGETS))
+ -rm $(DESTDIR)$(SITECFG)
+endif