File: rules

package info (click to toggle)
slang2 2.0.6-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,964 kB
  • ctags: 23
  • sloc: makefile: 84; sh: 7
file content (115 lines) | stat: -rwxr-xr-x 3,211 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
#!/usr/bin/make -f
# Made with the aid of dh_make, by Craig Small

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

DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE  = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
CONFARGS= --host=$(DEB_HOST_GNU_TYPE)
endif

ARCH:=$(shell dpkg --print-architecture)

# Append -mieee on Alpha in case of toolchain problems. This should be
# safely removed post-etch. See #337304.
ifeq ($(ARCH),alpha)
  CFLAGS_ALPHA := -mieee
endif

CC=gcc
INSTALL=/usr/bin/install
CFLAGS := -g -O2 -fno-strength-reduce -D_REENTRANT -D_XOPEN_SOURCE=500 $(CFLAGS_ALPHA)
ELF_CFLAGS = $(CFLAGS) -fPIC

SOMAJOR=2
SOMINOR=0.6

LIBSLANG=libslang2
LIBSLANG_PIC=libslang2-pic
LIBSLANG_DEV=libslang2-dev
LIBSLANG_UDEB=libslang2-udeb
SLSH=slsh

DEBVERSION=$(shell dpkg-parsechangelog | grep '^Version: ' | sed -e 's/^Version: //')
UDEBNAME=$(LIBSLANG_UDEB)_$(DEBVERSION)_$(shell dpkg --print-architecture).udeb


# the dbs rules
TAR_DIR=slang-$(SOMAJOR).$(SOMINOR)
include /usr/share/dbs/dbs-build.mk

ifeq (,$(DEB_BUILD_GNU_TYPE))
 include /usr/share/dbs/dpkg-arch.mk
endif

# Hack to ensure -mieee always defined
ifeq ($(ARCH),alpha)
  CFLAGS += -mieee
endif

build: $(build-stamp)

build-stamp=$(STAMP_DIR)/build-stamp
configure-stamp=$(STAMP_DIR)/configure-stamp

$(configure-stamp): $(patched)
	dh_testdir
	cd $(BUILD_TREE)  && ./configure --prefix=/usr \
		--enable-warnings $(CONFARGS)
	touch $@

$(build-stamp): $(configure-stamp)
	dh_testdir
	$(MAKE) -C $(BUILD_TREE) CFLAGS="$(CFLAGS)" \
		MODULE_INSTALL_DIR=/usr/lib/slang/v2/modules RPATH= \
		install_doc_dir=/usr/share/doc/libslang2 all 
	$(MAKE) -C $(BUILD_TREE) ELF_CFLAGS="$(ELF_CFLAGS)" prefix=/ \
		MODULE_INSTALL_DIR=/usr/lib/slang/v2/modules RPATH= \
		install_doc_dir=/usr/share/doc/libslang2 elf
	# Produce the -pic archive for use by the bootfloppies package.
	ar cqv $(BUILD_TREE)/libslang_pic.a $(BUILD_TREE)/src/elfobjs/*.o
	INSTANT_OPT=" " docbook-to-man debian/slsh.sgml > $(SOURCE_DIR)/slsh.1
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -rf $(SOURCE_DIR) $(STAMP_DIR)
	dh_clean

# Build architecture-independent files here.
binary-indep:

binary-arch: $(build-stamp)
	dh_testdir 
	dh_testroot 
	$(MAKE) -C $(BUILD_TREE)/slsh install SLSH_CONF_DIR=/etc \
		SLANG_INST_LIB="-L${CURDIR}/${BUILD_TREE}/src/elfobjs -lslang" \
		MODULE_INSTALL_DIR=/usr/lib/slang/v2/modules RPATH= \
		DESTDIR=$(CURDIR)/debian/slsh
	dh_link -a
	dh_installdirs -a
	dh_install -a
	dh_installexamples
	dh_installdocs -a 
	dh_installchangelogs -a $(BUILD_TREE)/changes.txt
	dh_installman -p$(SLSH) $(SOURCE_DIR)/slsh.1
	dh_strip -a
	dh_compress -a -X.sl -Xslangfun.txt
	dh_fixperms -a
	dh_makeshlibs  -V "${LIBSLANG} (>= 2.0.6-3)" --add-udeb="${LIBSLANG_UDEB}"
	dh_installdeb -a
	rm -rf debian/$(SLSH)/usr/man
	dh_shlibdeps -a
	dh_gencontrol -a 
	dh_md5sums -a 
	dh_builddeb -a 

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

binary: binary-indep binary-arch
.PHONY: clean binary binary binary-indep binary-arch binary