summaryrefslogtreecommitdiffstats
path: root/src/2/build.mk
blob: aa5b84131b6d037da15b2ee11b76eb030bc0c851 (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
ppt_plat = $${OPK_SOURCE\#config-}
ppt_pkg_dir = config-$${pkg}-$(ppt_plat).data
ppt_platconf_dir = $(ppt_pkg_dir)/usr/share/platconf/$(ppt_plat)/$${pkg}_$${ver}
0 = /usr/share/platconf-pkg-tools/$(ppt_version)/build.mk

nop build:
	@:

ppt-mkpkgs ppt-rmpkgs:
	@cd ../ && $@

install-build:
	set -e; \
	for pkg in src/build/*/; do \
		pkg="$${pkg#src/build/}"; \
		pkg="$${pkg%/}"; \
		for ver in "src/build/$${pkg}/"*/; do \
			ver="$${ver#src/build/$${pkg}/}"; \
			ver="$${ver%/}"; \
			mkdir -p "$(ppt_platconf_dir)"; \
			cp -p "src/build/$${pkg}/$${ver}/"* \
				"$(ppt_platconf_dir)"; \
		done; \
	done

install-run:
	set -e; \
	for pkg in src/run/*/; do \
		pkg="$${pkg#src/run/}"; \
		pkg="$${pkg%/}"; \
		mkdir "config-$${pkg}.data"; \
		find "src/run/$${pkg}" -type f | while read -r file; do \
			file="$${file#src/run/$${pkg}}"; \
			mkdir -p "config-$${pkg}.data/$${file%/*}"; \
			cp -p "src/run/$${pkg}/$${file}" \
				"config-$${pkg}.data/$${file}"; \
		done; \
	done

install:
	[ -d src/build/ ] && $(MAKE) -f $0 install-build
	[ -d src/run/   ] && $(MAKE) -f $0 install-run