summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile82
1 files changed, 39 insertions, 43 deletions
diff --git a/Makefile b/Makefile
index 8b94f80..92017f3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,55 +1,51 @@
-V=20121128.6
+# Configuration
+DESTDIR=
-PREFIX = /usr/local
-pkgdatadir=$(PREFIX)/share/devtools
+#prefix=/usr/local
+prefix=/usr
+exec_prefix=$(prefix)
+datarootdir=$(prefix)/share
-BINPROGS = \
- checkpkg \
- find-libdeps \
- finddeps \
- lddd
+bindir=$(exec_prefix)/bin
+sbindir=$(exec_prefix)/sbin
+#sysconfdir=$(prefix)/etc
+sysconfdir=/etc
+datadir=$(datarootdir)
+docdir=$(datarootdir)/doc
-SBINPROGS = \
- mkarchroot
+################################################################################
-all: $(BINPROGS) $(SBINPROGS) bash_completion zsh_completion
+# these are directories
+pseudo-packages=abslibre-tools chroot-tools fullpkg lib mips64el-tools toru
-edit = sed -e "s|@pkgdatadir[@]|$(pkgdatadir)|g"
+# these are the resulting packages
+packages=libretools libretools-pr libretools-mips64el
+# and which directories they contains
+libretools=abslibre-tools lib chroot-tools fullpkg toru misc
+libretools-mips64el=mips64el-tools
-%: %.in Makefile
- @echo "GEN $@"
- @$(RM) "$@"
- @m4 -P $@.in | $(edit) >$@
- @chmod a-w "$@"
- @chmod +x "$@"
+################################################################################
-clean:
- rm -f $(BINPROGS) $(SBINPROGS) bash_completion zsh_completion
+all: PHONY build
+build: PHONY build-libretools build-doc
+install: PHONY install-libretools install-doc
-install: all
- install -dm0755 $(DESTDIR)$(PREFIX)/bin
- install -dm0755 $(DESTDIR)$(PREFIX)/sbin
- install -dm0755 $(DESTDIR)$(pkgdatadir)
+%-doc: PHONY doc
+ $(MAKE) -C doc $*
+%-misc: PHONY src
+ $(MAKE) -C src $*
- install -m0755 ${BINPROGS} $(DESTDIR)$(PREFIX)/bin
-# install -m0755 ${SBINPROGS} $(DESTDIR)$(PREFIX)/sbin
- install -m0755 mkarchroot $(DESTDIR)$(PREFIX)/sbin/archroot
+build-%: PHONY src/%
+ $(MAKE) -C src/$* build
+install-%: PHONY src/%
+ $(MAKE) -C src/$* install
- ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides
+.SECONDEXPANSION:
+$(addprefix build-, $(packages)): build-%: PHONY $$(addprefix build-, $$($$*))
+$(addprefix install-,$(packages)): install-%: PHONY $$(addprefix install-,$$($$*))
- install -m0644 lib/common.sh $(DESTDIR)$(pkgdatadir)/common.sh
- install -m0644 makechrootpkg.in $(DESTDIR)$(pkgdatadir)/makechrootpkg.sh
- install -Dm0644 bash_completion $(DESTDIR)$(PREFIX)/share/bash-completion/completions/devtools
- install -Dm0644 zsh_completion $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
+################################################################################
-uninstall:
- for f in ${BINPROGS} ; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
-# for f in ${SBINPROGS} ; do rm -f $(DESTDIR)$(PREFIX)/sbin/$$f; done
- rm -f $(DESTDIR)$(PREFIX)/sbin/archroot
-
- rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides
-
- rm -f $(DESTDIR)$(PREFIX)/share/bash-completion/completions/devtools
- rm -f $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
-
-.PHONY: all clean install uninstall
+FORCE: PHONY
+PHONY:
+.PHONY: FORCE PHONY