File: Makefile.inc

package info (click to toggle)
rootskel-gtk 1.21
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 232 kB
  • ctags: 32
  • sloc: makefile: 105; sh: 87; perl: 50
file content (65 lines) | stat: -rw-r--r-- 1,556 bytes parent folder | download | duplicates (18)
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
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)