diff options
author | Joshua I. Haase H. (xihh) <hahj87@gmail.com> | 2012-12-04 21:19:22 -0600 |
---|---|---|
committer | Joshua I. Haase H. (xihh) <hahj87@gmail.com> | 2012-12-04 21:19:22 -0600 |
commit | acc2c792c423c5aa81aa95f0516de7724dba3ab9 (patch) | |
tree | 73cacea8eff5cdfd23f42b740597b5498d152509 /Makefile | |
parent | d11741d73bbf6940c45ee0f2cadea980e9e40785 (diff) | |
parent | 098d7430e6447c4658704c3bcf88ea1ed7a5206b (diff) |
Merge branch 'master' of gitpar:libretools
Conflicts:
librechroot
libremakepkg
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..802117a --- /dev/null +++ b/Makefile @@ -0,0 +1,68 @@ +# Configuration +DESTDIR= + +#prefix=/usr/local +prefix=/usr +exec_prefix=$(prefix) +datarootdir=$(prefix)/share + +bindir=$(exec_prefix)/bin +sbindir=$(exec_prefix)/sbin +#sysconfdir=$(prefix)/etc +sysconfdir=/etc +datadir=$(datarootdir) +docdir=$(datarootdir)/doc + +################################################################################ + +pseudo-packages=abslibre-tools chroot-tools fullpkg mips64el-tools pr-tools toru +packages=libretools libretools-pr libretools-mips64el + +libretools=abslibre-tools chroot-tools fullpkg toru misc +libretools-pr=pr-tools +libretools-mips64el=mips64el-tools + +################################################################################ + +all: PHONY libretools +install: PHONY install-libretools install-doc + +install-doc: $(patsubst doc/%,$(DESTDIR)$(docdir)/libretools/%,$(wildcard doc/*)) + +$(DESTDIR)$(docdir)/libretools/%: doc/% + install -Dm644 '$<' '$@' + +$(DESTDIR)$(sysconfdir)/libretools.conf: src/libretools.conf + install -Dm644 '$<' '$@' + +$(foreach pkg,$(pseudo-packages) ., \ +$(eval \ +$(DESTDIR)$(bindir)/%: src/$(pkg)/%; \ + install -Dm755 '$$<' '$$@' \ +) \ +$(eval \ +$(DESTDIR)$(sysconfdir)/libretools.d/%: src/$(pkg)/%; \ + install -Dm644 '$$<' '$$@' \ +)) + +################################################################################ + +progs = $(shell find src/$1 -maxdepth 1 -type f -executable -printf '%f\n') +confs = $(shell find src/$1 -maxdepth 1 -type f -not -executable -printf '%f\n') +files = $(addprefix $(DESTDIR)$2/,$(call progs,$1)) \ + $(addprefix $(DESTDIR)$3/,$(call confs,$1)) + +.SECONDEXPANSION: +$(packages): %: PHONY $$($$*) +$(addprefix install-,$(packages)): install-%: PHONY $$(addprefix install-,$$($$*)) + +$(pseudo-packages) misc: %: PHONY +$(addprefix install-,$(pseudo-packages)): install-%: PHONY $$(call files,$$*,$(bindir),$(sysconfdir)/libretools.d) +# special cases +install-misc: PHONY $(call files,.,$(bindir),$(sysconfdir)) + +################################################################################ + +FORCE: PHONY +PHONY: +.PHONY: FORCE PHONY |