File: rules

package info (click to toggle)
slang2 2.2.2-4
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,868 kB
  • ctags: 22
  • sloc: makefile: 98; sh: 4
file content (132 lines) | stat: -rwxr-xr-x 3,916 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
#!/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

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 -fno-strength-reduce -D_REENTRANT -D_XOPEN_SOURCE=500 $(CFLAGS_ALPHA)
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
        CFLAGS += -O0
else
        CFLAGS += -O2
endif
ELF_CFLAGS = $(CFLAGS) -fPIC

SOMAJOR=2
SOMINOR=2.2

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
	# Prepare .links files from templates:
	for i in `ls $(CURDIR)/debian/*links.in`; do \
		sed -e "1i\# Automatically generated from the .in" \
		    -e "s/@@major@@/$(SOMAJOR)/g; s/@@minor@@/$(SOMINOR)/" \
		     < $$i > $${i%%.in} ; \
	done
	# Prepare the build tree:
	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
	$(MAKE) -C $(BUILD_TREE)/src CFLAGS="$(CFLAGS)" \
		MODULE_INSTALL_DIR=/usr/lib/slang/v2/modules RPATH= \
		install_doc_dir=/usr/share/doc/libslang2 all 
	# 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)
	# Clean up generated .links:
	for i in `ls $(CURDIR)/debian/*links.in`; do rm -f $${i%%.in} ; done
	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 SLSH_LOCALLIB_DIR="" \
		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
	cp $(BUILD_TREE)/src/slang.ver debian/libslang2-pic/usr/lib/libslang_pic.map
	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.7-1)" --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