File: quilt.mk

package info (click to toggle)
glibc 2.19-16
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 203,652 kB
  • sloc: ansic: 969,800; asm: 241,205; sh: 10,063; makefile: 8,471; cpp: 3,595; perl: 2,077; pascal: 1,839; awk: 1,704; yacc: 317; sed: 73
file content (45 lines) | stat: -rw-r--r-- 1,289 bytes parent folder | download | duplicates (41)
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
# Implements the patch and unpatch targets, called when building packages.

# -*- Makefile -*-, you silly Emacs!
# vim: set ft=make:

DEBQUILTRC = debian/quiltrc
QUILTOPT   = --quiltrc $(DEBQUILTRC)
QUILT      = quilt $(QUILTOPT)

patch: $(stamp)patch
$(stamp)patch:
	@if test -r debian/patches/series.$(DEB_HOST_ARCH); then \
	  pc=".pc.$(DEB_HOST_ARCH)"; \
	  mkdir -p "$$pc"; \
	  ln -sf ../debian/patches/series.$(DEB_HOST_ARCH) $$pc/series; \
	  QUILT_PC="$$pc" $(QUILT) upgrade || true; \
	  if QUILT_PC="$$pc" $(QUILT) next >/dev/null 2>&1; then \
	    echo "Applying architecture specific patches... "; \
	    QUILT_PC="$$pc" $(QUILT) push -a -v ; \
	  fi ; \
	fi
	touch $@

unpatch:
	@if test -r debian/patches/series.$(DEB_HOST_ARCH); then \
	  pc=".pc.$(DEB_HOST_ARCH)"; \
	  QUILT_PC="$$pc" $(QUILT) upgrade || true; \
	  if QUILT_PC="$$pc" $(QUILT) applied >/dev/null 2>&1; then \
	    echo "Unapplying architecture specific patches..."; \
	    QUILT_PC="$$pc" $(QUILT) pop -a -v ; \
	  fi ; \
	  rm -rf $$pc ; \
	fi
	rm -f $(stamp)patch

refresh: unpatch
	@if $(QUILT) applied >/dev/null 2>&1; then \
	  echo "Unapplying Debian patches..." ; \
	  $(QUILT) pop -a -v ; \
	fi
	@while $(QUILT) next ; do \
	  $(QUILT) push ; \
	  $(QUILT) refresh ; \
	done ; \
	$(QUILT) pop -a