summaryrefslogtreecommitdiff
path: root/src/chroot-tools/Makefile
blob: 7f6a7ead153bd505857babb41a156cee4cdb1a92 (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
# The makechrootpkg flow is:
# $(devtoolsdir)/*.in -> *.sh.in + *.sh.patch -> *.sh.ugly -> *.sh

copy_files = makechrootpkg.sh.in archroot.in
libs = makechrootpkg.sh
progs = archroot
clean_files = makechrootpkg.sh.ugly* *~
include ../../common.mk

# Copy ###############################################################

makechrootpkg.sh.in: %.sh.in: $(devtoolsdir)/%.in
	cp $< $@

archroot.in: $(devtoolsdir)/mkarchroot.in
	cp $< $@

# Build ##############################################################

makechrootpkg.sh.ugly: %.ugly: %.in %.patch Makefile
	@echo "GEN $@"
	@cp $*.in $@
	@patch $@ $*.patch || { rm -f -- '$@'; false; }

makechrootpkg.sh: %: %.ugly Makefile
	@echo "GEN $@"
	@$(edit) <"$<" >"$@" || { rm -f -- '$@'; false; }
	$(call indent,$@) || { rm -f -- '$@'; false; }

archroot: %: %.in Makefile
	@echo "GEN $@"
	@$(edit) <"$<" >"$@" || { rm -f -- '$@'; false; }
	@chmod 755 "$@" || { rm -f -- '$@'; false; }