File: rules

package info (click to toggle)
snes9x 1.42-2
  • links: PTS
  • area: non-free
  • in suites: sarge
  • size: 5,372 kB
  • ctags: 12,713
  • sloc: cpp: 64,192; asm: 27,209; ansic: 16,060; sh: 2,919; makefile: 481
file content (129 lines) | stat: -rwxr-xr-x 3,573 bytes parent folder | download
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/usr/bin/make -f
# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Some lines taken from debmake, by Cristoph Lameter.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DH_COMPAT=2
SNESDIR=snes9x-1.42-src/

include /usr/share/dpatch/dpatch.make

BUILD_ARCH:=$(shell dpkg --print-gnu-build-architecture)
# New cross-compilation policy may set the DEB_HOST_ARCH variable.
ifdef DEB_HOST_ARCH
 ARCH:=$(DEB_HOST_ARCH)
else
 # dpkg-cross sets the ARCH environment variable, so use it.
 ifdef ARCH
  ARCH:=$(ARCH)
 else
  ARCH:=$(BUILD_ARCH)
 endif
endif

build: build-stamp
build-stamp: patch-stamp
	dh_testdir

	# X11 Binary
	( cd $(SNESDIR)/snes9x; ./configure )
	( cd $(SNESDIR)/snes9x; $(MAKE) )
	# Save Binary before make clean
	cp $(SNESDIR)/snes9x/snes9x $(SNESDIR)/snes9x/debsnes9x
	
	# OpenGL Binary
	( cd $(SNESDIR)/snes9x; $(MAKE) clean)
	( cd $(SNESDIR)/snes9x; ./configure --with-opengl)
	( cd $(SNESDIR)/snes9x; $(MAKE) )
	touch build-stamp
	# *unsave* Binary
	cp $(SNESDIR)/snes9x/debsnes9x $(SNESDIR)/snes9x/snes9x

clean: clean1 unpatch
clean1:
	dh_testdir
	dh_testroot
	rm -f build-stamp install-stamp
	-(cd $(SNESDIR)/snes9x ; make clean )
	-rm $(SNESDIR)/snes9x/config.log  $(SNESDIR)/snes9x/config.status $(SNESDIR)/snes9x/config.info $(SNESDIR)/snes9x/unix/compile-keymap $(SNESDIR)/snes9x/unix/linux-x11_key.c $(SNESDIR)/zlib/example $(SNESDIR)/zlib/minigzip
	-rm $(SNESDIR)/zlib/*.o $(SNESDIR)/snes9x/unix/*.o $(SNESDIR)/snes9x/Makefile snes9x-1.42-src/snes9x/debsnes9x

	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	mkdir -p debian/tmp/usr/bin/
	mkdir -p debian/tmp/usr/share/snes9x
	install -m 755 $(SNESDIR)/snes9x/snes9x  debian/tmp/usr/bin/snes9x
	install -m 755 $(SNESDIR)/snes9x/osnes9x  debian/tmp/usr/bin/osnes9x
	install -m 644 debian/snes9x.ctl debian/tmp/usr/share/snes9x/

	touch install-stamp

# Build architecture-independent files here.
binary-indep: build install
	dh_movefiles -psnes9x-common
	dh_gencontrol -psnes9x-common
	dh_installdocs -psnes9x-common
	dh_installchangelogs -psnes9x-common
	dh_compress -psnes9x-common
	dh_fixperms -psnes9x-common
	dh_installdeb -psnes9x-common
	dh_gencontrol -psnes9x-common
	dh_md5sums -psnes9x-common
	dh_builddeb -psnes9x-common

# Build architecture-dependent files here.
binary-arch: build install
#	dh_testversion
	dh_testdir -a
	dh_testroot -a
#ifeq ($(ARCH),i386)
	dh_movefiles -a
#else
#	dh_movefiles -psnes9x-x
#	dh_movefiles -psnes9x-opengl
#endif
	dh_installdocs -a
	dh_installexamples -a
	dh_installmenu -a
	dh_installcron -a

	dh_installman -psnes9x-x debian/snes9x.1 
	dh_installman -psnes9x-opengl debian/osnes9x.1 
#ifeq ($(ARCH),i386)
# SVGA and Glide manpages only for i386
#	dh_installman -psnes9x-svga debian/ssnes9x.1
#	dh_installman -psnes9x-fx debian/gsnes9x.1
#endif
	dh_installchangelogs -a $(SNESDIR)/snes9x/changes.txt
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
#iifeq ($(ARCH),i386)
# build SVGA packages only for i386
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a
#else
#	dh_gencontrol -psnes9x-x 
#	dh_gencontrol -psnes9x-opengl
#	dh_md5sums -a
#	dh_builddeb -psnes9x-x
#	dh_builddeb -psnes9x-opengl
#endif

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary patch unpatch