summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 5f0866ec5bff9044e136175ebbc6c5abf7ce096c (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
56
57
58
59
60
61
62
63
.PHONY: main testing non-free unstable

rootdir := $(shell pwd)

all: main testing non-free unstable

apkbuilds := $(shell find . -maxdepth 3 -name APKBUILD -print)

all-pkgs := $(sort $(subst ./,,$(patsubst %/,%,$(dir $(apkbuilds)))))

main-pkgs :=  $(shell ./aport.lua deplist $(rootdir) main)

testing-pkgs :=  $(shell ./aport.lua deplist $(rootdir) testing)

non-free-pkgs :=  $(shell ./aport.lua deplist $(rootdir) non-free)

unstable-pkgs :=  $(shell ./aport.lua deplist $(rootdir) unstable)

main: 
	for p in $(main-pkgs) ; \
	do \
		cd $(rootdir)/$@/$$p; \
		abuild -r; \
	done

testing: 
	for p in $(testing-pkgs) ; \
	do \
		cd $(rootdir)/$@/$$p; \
		abuild -r; \
	done

non-free: 
	for p in $(non-free-pkgs) ; \
	do \
		cd $(rootdir)/$@/$$p; \
		abuild -r; \
	done

unstable: 
	for p in $(unstable-pkgs) ; \
	do \
		cd $(rootdir)/$@/$$p; \
		abuild -r; \
	done

clean:
	for p in $(all-pkgs) ; do \
		cd $(rootdir)/$$p; \
		abuild clean; \
		abuild cleanpkg; \
	done

distclean:
	for p in $(all-pkgs) ; \
	do \
		cd $(rootdir)/$$p; \
		abuild clean; \
		abuild cleanoldpkg; \
		abuild cleanpkg; \
		abuild cleancache; \
	done