summaryrefslogtreecommitdiff
path: root/Makefile
blob: 6eeb0527eb0bbf19e9fd9192bdc60893f7f5a390 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
all: config.db

pkgbuilds = $(wildcard *.PKGBUILD)
$(foreach e,$(shell grep -e ^pkgver= -e ^pkgrel= -e ^pkgname= -- $(pkgbuilds)|sed 's/\.PKGBUILD:/./'),$(eval $e))
$(foreach p,$(patsubst %.PKGBUILD,%,$(pkgbuilds)),                   \
  $(eval pkgfiles += $($p.pkgname)-$($p.pkgver)-$($p.pkgrel)-any.pkg.tar.xz)  \
  $(eval $($p.pkgname)-$($p.pkgver)-$($p.pkgrel)-any.pkg.tar.xz: $p.PKGBUILD) )

%.pkg.tar.xz:
	makepkg -d -f -p $<

%.db %.db.tar.gz %.files %.files.tar.gz: .var.pkgfiles $(pkgfiles)
	find $^ -newer $*.db
	rm -f $*.db $*.db.tar.gz $*.files $*.files.tar.gz
	repo-add $*.db.tar.gz $(filter %.pkg.tar.xz,$^)
	touch --no-create --no-dereference $*.db $*.db.tar.gz $*.files $*.files.tar.gz

.var.%: FORCE
	@printf '%s' '$(subst ','\\'',$($*))' | sed 's/^/#/' | ./write-ifchanged $@
-include $(wildcard .var.*)
.PHONY: FORCE