summaryrefslogtreecommitdiff
path: root/Makefile
blob: 9992d49d88c8acb636205901c60837abf968fc11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
include $(dir $(lastword $(MAKEFILE_LIST)))/config.mk
include $(topsrcdir)/build-aux/Makefile.head.mk

# these are the resulting packages
pkgs=libretools librelib gitget xbs
# and which directories they contain
pkg.libretools=\
	src \
	src/abslibre-tools \
	src/chroot-tools \
	src/devtools \
	src/librefetch \
	src/toru
pkg.librelib=src/lib
pkg.gitget=src/gitget
pkg.xbs=\
	src/xbs \
	src/xbs-abs \
	src/xbs-abslibre

define _pkg_rule
%(verb)-%(pkg): $(addsuffix /%(verb),$(pkg.%(pkg)))
.PHONY: %(verb)-%(pkg)
endef
$(eval $(foreach verb,$(nested.targets),$(foreach pkg,$(pkgs),\
  $(subst %(verb),$(verb),$(subst %(pkg),$(pkg),$(value _pkg_rule)))$(at.nl))))

$(outdir)/check:
	cd $(@D)/test && ./testenv $(TESTENVFLAGS) roundup

$(outdir)/shellcheck: private shellcheck.flags = --exclude=1090,1091,2016,2059,2064,2164,2191
$(outdir)/shellcheck: private shellcheck.prune = -false
$(outdir)/shellcheck: private shellcheck.prune += -o -type d -name doc
$(outdir)/shellcheck: private shellcheck.prune += -o -type d -name man
$(outdir)/shellcheck: private shellcheck.prune += -o -type f -name indent
$(outdir)/shellcheck: private shellcheck.prune += -o -type f -name Makefile
$(outdir)/shellcheck: private shellcheck.prune += -o -type f -name makepkg.gen
$(outdir)/shellcheck: private shellcheck.prune += -o -type f -name source.sh.gen
$(outdir)/shellcheck:
	cd $(@D)/test && ./testenv $(TESTENVFLAGS) 'cd "$$TMPDIR/destdir" && find \( $(shellcheck.prune) \) -prune -o -not -type d -exec shellcheck $(shellcheck.flags) {} +'

$(eval $(foreach pkg,$(pkgs),\
  $(call at.path,$(srcdir)/po/$(pkg).pot): $(call at.addprefix,$(topsrcdir),$(addsuffix /dir.pot,$(pkg.$(pkg))))$(at.nl)))

libretools.out.mans =
libretools.out.bins =
libretools.out.libexecs =
libretools.out.libs =
libretools.out.docs =
libretools.out.confs =

files.src.gen += .srcversion-libretools.mk .srcversion-devtools.mk
nested.subdirs = $(foreach pkg,$(pkgs),$(pkg.$(pkg))) po

include $(topsrcdir)/build-aux/Makefile.tail.mk