-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.inc
65 lines (51 loc) · 1.52 KB
/
Makefile.inc
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
outdir = $(DESTDIR)/$(dir)
define check_destdir
@if [ -z "$(DESTDIR)" ]; then \
echo "You *must* give a DESTDIR!"; \
exit 1; \
fi
endef
build: build-local build-recursive
build-local::
install: install-auto install-local install-recursive
install-auto: $(outdir) install-auto-dirs install-auto-files install-auto-files-exec
install-auto-dirs:
$(call check_destdir)
@list='$(subdirs_empty)'; for file in $$list; do \
echo "install -d -m755 $(outdir)/$$file"; \
install -d -m755 $(outdir)/$$file; \
done
install-auto-files:
$(call check_destdir)
@list='$(files)'; for file in $$list; do \
case $$file in \
*:*) in=`echo "$$file" | sed 's,[^:]*:,,'` \
out=$(outdir)/`echo "$$file" | sed 's,:.*,,'`;; \
*) in=$$file out=$(outdir);; \
esac; \
echo "install -m644 $$in $$out"; \
install -m644 $$in $$out; \
done
install-auto-files-exec:
$(call check_destdir)
@list='$(files_exec)'; for file in $$list; do \
case $$file in \
*:*) in=`echo "$$file" | sed 's,[^:]*:,,'` \
out=$(outdir)/`echo "$$file" | sed 's,:.*,,'`;; \
*) in=$$file out=$(outdir);; \
esac; \
echo "install -m755 $$in $$out"; \
install -m755 $$in $$out; \
done
install-local::
clean: clean-local clean-recursive
clean-local::
build-recursive clean-recursive install-recursive:
@target=`echo $@ | sed s/-recursive//`; \
list='$(subdirs)'; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $$target) || exit 1; \
done
$(outdir):
install -d $(outdir)