blob: e35767543c8a82212c24da6b535c68b1406b82b2 (
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
# Configuration
DESTDIR=
#prefix=/usr/local
prefix=/usr
exec_prefix=$(prefix)
datarootdir=$(prefix)/share
bindir=$(exec_prefix)/bin
sbindir=$(exec_prefix)/sbin
datadir=$(datarootdir)
pkgdatadir=$(datadir)/devtools
devtoolsdir=../../../devtools-par
default: all
all: build
######################################################################
copy: \
archroot.in \
checkpkg.in \
find-libdeps.in \
finddeps.in \
lddd.in \
lib/common.sh.in \
lib/makechrootpkg.sh.in
archroot.in: $(devtoolsdir)/mkarchroot.in ; cp $< $@
checkpkg.in: $(devtoolsdir)/checkpkg.in ; cp $< $@
find-libdeps.in: $(devtoolsdir)/find-libdeps.in ; cp $< $@
finddeps.in: $(devtoolsdir)/finddeps.in ; cp $< $@
lddd.in: $(devtoolsdir)/lddd.in ; cp $< $@
lib/common.sh.in: $(devtoolsdir)/lib/common.sh ; cp $< $@
lib/makechrootpkg.sh.in: $(devtoolsdir)/makechrootpkg.in ; cp $< $@
######################################################################
build: \
archroot \
checkpkg \
find-libdeps \
finddeps \
lddd \
lib/common.sh \
lib/makechrootpkg.sh
edit = sed -e 's|m4_include(lib/\(.*\))|. @pkgdatadir@/\1|' -e "s|@pkgdatadir[@]|$(pkgdatadir)|g"
indent = emacs --batch $1 \
--eval '(setq sh-basic-offset 8)' \
--eval '(indent-region (point-min) (point-max) nil)' \
-f save-buffer &>/dev/null
%: %.in Makefile
@echo "GEN $@"
@$(edit) <"$<" >"$@"
@chmod 755 "$@"
lib/common.sh: %: %.in Makefile
@echo "GEN $@"
@{ \
echo 'if [[ -z $${_INCLUDE_COMMON_SH:-} ]]; then' && \
echo '_INCLUDE_COMMON_SH=true' && \
cat "$<" && \
echo 'fi'; } > "$@"
lib/makechrootpkg.sh.ugly: %.ugly: %.in %.patch Makefile
@echo "GEN $@"
@cp $*.in $@
@patch $@ $*.patch
lib/makechrootpkg.sh: %: %.ugly Makefile
@echo "GEN $@"
@$(edit) <"$<" >"$@"
$(call indent,$@)
######################################################################
install: \
$(DESTDIR)$(sbindir)/archroot \
$(DESTDIR)$(bindir)/checkpkg \
$(DESTDIR)$(bindir)/find-libdeps \
$(DESTDIR)$(bindir)/find-libprovides \
$(DESTDIR)$(bindir)/finddeps \
$(DESTDIR)$(bindir)/lddd \
$(DESTDIR)$(pkgdatadir)/common.sh \
$(DESTDIR)$(pkgdatadir)/makechrootpkg.sh
$(DESTDIR)$(sbindir)/%: %
install -Dm755 $< $@
$(DESTDIR)$(bindir)/%: %
install -Dm755 $< $@
$(DESTDIR)$(pkgdatadir)/%: lib/%
install -Dm644 $< $@
$(DESTDIR)$(bindir)/find-libprovides:
install -d $(@D)
ln -sf find-libdeps $@
|