File: rules

package info (click to toggle)
cthugha 1.4-2
  • links: PTS
  • area: non-free
  • in suites: sarge, woody
  • size: 2,840 kB
  • ctags: 1,889
  • sloc: cpp: 14,904; sh: 2,717; ansic: 1,559; makefile: 224
file content (136 lines) | stat: -rwxr-xr-x 4,067 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
130
131
132
133
134
135
136
#!/usr/bin/make -f
# debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Architecture
#BUILD_ARCH := $(if $(DEB_BUILD_ARCH),$(DEB_BUILD_ARCH),$(shell dpkg-architecture -qDEB_BUILD_ARCH))
#HOST_ARCH  := $(if $(DEB_HOST_ARCH),$(DEB_HOST_ARCH),$(shell dpkg-architecture -qDEB_HOST_ARCH))
BUILD_TYPE := $(if $(DEB_BUILD_GNU_TYPE),$(DEB_BUILD_GNU_TYPE),$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE))
HOST_TYPE  := $(if $(DEB_HOST_GNU_TYPE),$(DEB_HOST_GNU_TYPE),$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE))

# Special Debian build options - nostrip handled by dh_strip
export CXXFLAGS
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CXXFLAGS += -g
endif

#export CXXFLAGS=#
# Special Debian build options
#ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
#CXXFLAGS += -g
#endif
#ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
#INSTALL_PROGRAM += -s
#endif

# for now, we leave this to configure
ARCH_SVGA  = # i386 alpha m68k
ARCH_NO_GL = # i386 m68k
ARCH_NO_X  = # m68k
ARCH_CFG   =
ifeq (,$(findstring $(HOST_ARCH),$(ARCH_SVGA)))
#ARCH_CFG  += --disable-svga
endif
ifneq (,$(findstring $(HOST_ARCH),$(ARCH_NO_GL)))
ARCH_CFG  += --disable-gl
endif
ifneq (,$(findstring $(HOST_ARCH),$(ARCH_NO_X)))
ARCH_CFG  += --disable-xwin
endif


build: build-stamp
build-stamp:
	dh_testdir
	./configure --prefix=/usr         --mandir=/usr/share/man	\
	            --disable-tabtools    --infodir=/usr/share/info	\
		    --build=$(BUILD_TYPE) --host=$(HOST_TYPE)		\
		    $(ARCH_CFG)
	$(MAKE)
	( cd doc; makeinfo --no-split --html cthugha.texi; )
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	-$(MAKE) -i distclean
	rm -f						\
	 doc/cthugha.{info,ps,html}			\
	 build-stamp debian/menu debian/links
	dh_clean

# Build architecture-independent files here.
binary-indep: build
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs
	$(MAKE) prefix=`pwd`/debian/tmp/usr		\
		mandir=`pwd`/debian/tmp/usr/share/man	\
		infodir=`pwd`/debian/tmp/usr/share/info	install
#	rm -f debian/tmp/usr/bin/tabinfo debian/tmp/usr/bin/tabheader
	cp cthugha.ini.eg debian/tmp/etc/cthugha.ini
	dh_installdocs
	dh_installexamples

	# menus and man links only for programs that were actually built
	set -e; rm -f debian/menu debian/links;		\
	if [ -f debian/tmp/usr/bin/cthugha-server ];	\
	then cat debian/links.serv >>debian/links;	\
	fi;						\
	if [ -f debian/tmp/usr/bin/cthugha ]; then	\
	    cat debian/menu.svga >>debian/menu;		\
	fi;						\
	if [ -f debian/tmp/usr/bin/xcthugha ]; then	\
	    cat debian/menu.x >>debian/menu;		\
	    cat debian/links.x >>debian/links;		\
	fi;						\
	if [ -f debian/tmp/usr/bin/glcthugha ]; then	\
	    cat debian/menu.gl >>debian/menu;		\
	    cat debian/links.gl >>debian/links;		\
	fi
	dh_installmenu
#	dh_installmanpages
#	dh_undocumented
	dh_installchangelogs ChangeLog
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	# cthugha should be suid because it is a svga program
	if [ -f debian/tmp/usr/bin/cthugha ]; then chmod u+s debian/tmp/usr/bin/cthugha; fi
#	dh_suidregister
	dh_installdeb
	dh_shlibdeps

	set -e; \
	if ! grep svgalib-dummyg1 debian/substvars >/dev/null ; then \
		mv debian/substvars debian/substvars-unhacked ; \
		sed -e 's/svgalibg1\( *([^)]*)\)\{0,1\}/& | svgalib-dummyg1\1/' \
			<debian/substvars-unhacked >debian/substvars; \
		rm debian/substvars-unhacked; \
	fi

	dh_gencontrol
	dh_md5sums
	dh_builddeb

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

environment:
	dpkg-architecture
	@echo DEB_BUILD_OPTIONS = $(DEB_BUILD_OPTIONS)
	@echo BUILD_ARCH = $(BUILD_ARCH), BUILD_TYPE = $(BUILD_TYPE)
	@echo HOST_ARCH = $(HOST_ARCH), HOST_TYPE = $(HOST_TYPE)
	@echo ARCH_CFG = $(ARCH_CFG)
	@echo CXXFLAGS = $(CXXFLAGS), INSTALL_PROGRAM = $(INSTALL_PROGRAM)