File: rules

package info (click to toggle)
slang 1.4.9dbs-11
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,544 kB
  • ctags: 27
  • sloc: makefile: 101; sh: 10
file content (138 lines) | stat: -rwxr-xr-x 4,525 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
137
138
#!/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=5

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

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

# The original info is from src/slang.h
SOMAJOR=1
SOMINOR=4.9

LIBSLANG_NONUTF8=libslang1
LIBSLANG_NONUTF8_PIC=libslang1-pic
LIBSLANG_NONUTF8_DEV=libslang1-dev
LIBSLANG_UTF8=libslang1-utf8
LIBSLANG_UTF8_PIC=libslang1-utf8-pic
LIBSLANG_UTF8_DEV=libslang1-utf8-dev
LIBSLANG_UTF8_UDEB=$(LIBSLANG_UTF8)-udeb

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


# the dbs rules
TAR_DIR=slang-1.4.9
include /usr/share/dbs/dbs-build.mk

ifeq (,$(DEB_BUILD_GNU_TYPE))
 include /usr/share/dbs/dpkg-arch.mk
endif
ARCH=$(shell dpkg --print-architecture)

build: 
	true;

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

BUILD_TREE_UTF8=$(BUILD_TREE)-utf8
BUILD_TREE_NONUTF8=$(BUILD_TREE)-nonutf8

$(configure-stamp): $(patched)
	dh_testdir
	cp -a $(BUILD_TREE) $(BUILD_TREE_UTF8)
	mv  $(BUILD_TREE) $(BUILD_TREE_NONUTF8)
	cd $(BUILD_TREE_NONUTF8)  && ./configure --prefix=/usr --enable-warnings 
	cd $(BUILD_TREE_UTF8)  && ./configure --prefix=/usr --enable-warnings
	touch $@

$(build-nonutf8-stamp): $(configure-stamp)
	dh_testdir
	$(MAKE) -C $(BUILD_TREE_NONUTF8) CFLAGS="$(CFLAGS)" all demos
	$(MAKE) -C $(BUILD_TREE_NONUTF8) ELF_CFLAGS="$(ELF_CFLAGS)" UTF8MODIFIER=""  prefix=/ elf
	cp $(BUILD_TREE_NONUTF8)/src/slang.h $(BUILD_TREE_NONUTF8)/slang.h
	# Produce the -pic archive for use by the bootfloppies package.
	ar cqv $(BUILD_TREE_NONUTF8)/libslang_pic.a $(BUILD_TREE_NONUTF8)/src/elfobjs/*.o 
	touch $@

$(build-utf8-stamp): $(configure-stamp)
	dh_testdir
	$(MAKE) -C $(BUILD_TREE_UTF8) CFLAGS="$(CFLAGS) -DUTF8" all demos
	$(MAKE) -C $(BUILD_TREE_UTF8) UTF8MODIFIER="-UTF8" ELF_CFLAGS="$(ELF_CFLAGS) -DUTF8"  prefix=/ elf
	# Prepend to the start
	cat debian/slang.h.prepend $(BUILD_TREE_UTF8)/src/slang.h >  $(BUILD_TREE_UTF8)/slang.h
	# Produce the -pic archive for use by the bootfloppies package.
	ar cqv $(BUILD_TREE_UTF8)/libslang_pic.a \
		$(BUILD_TREE_UTF8)/src/elfobjs/*.o 
	touch $@

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

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

# Build the non-utf8 version
binary-nonutf8: $(build-nonutf8-stamp)
	dh_testdir -a
	dh_testroot -a
	dh_installdirs -a
	dh_install -p $(LIBSLANG_NONUTF8) --sourcedir $(BUILD_TREE_NONUTF8)
	dh_install -p $(LIBSLANG_NONUTF8_PIC) --sourcedir $(BUILD_TREE_NONUTF8)
	dh_install -p $(LIBSLANG_NONUTF8_DEV) --sourcedir $(BUILD_TREE_NONUTF8)

# Build the utf8 version
binary-utf8: $(build-utf8-stamp)
	dh_testdir -a
	dh_testroot -a
	dh_installdirs -a
	dh_install -p $(LIBSLANG_UTF8) --sourcedir $(BUILD_TREE_UTF8)
	dh_install -p $(LIBSLANG_UTF8_PIC) --sourcedir $(BUILD_TREE_UTF8)
	dh_install -p $(LIBSLANG_UTF8_DEV) --sourcedir $(BUILD_TREE_UTF8)
	dh_install -p $(LIBSLANG_UTF8_UDEB)  --sourcedir $(BUILD_TREE_UTF8)
	
binary-arch: binary-nonutf8 binary-utf8
	dh_testdir 
	dh_testroot 
	dh_link -a
	dh_installdocs -a -N$(LIBSLANG_UTF8_UDEB)
	dh_installchangelogs -a -N$(LIBSLANG_UTF8_UDEB) $(BUILD_TREE_UTF8)/changes.txt
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -p$(LIBSLANG_NONUTF8) -V "$(LIBSLANG_NONUTF8) (>> 1.4.9dbs-4)"
	dh_makeshlibs -p$(LIBSLANG_UTF8) -V "${LIBSLANG_UTF8} (>> 1.4.9dbs-4)"
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a -N$(LIBSLANG_UTF8_UDEB)
	dh_md5sums -a -N$(LIBSLANG_UTF8_UDEB)
	dh_builddeb -a -N$(LIBSLANG_UTF8_UDEB)

	# don't know how to do shlibdeps
	# dh_shlibdeps
	dh_gencontrol -a -p$(LIBSLANG_UTF8_UDEB) -- -fdebian/files~
	dpkg-distaddfile $(UDEBNAME) debian-installer extra
	dh_builddeb -p$(LIBSLANG_UTF8_UDEB) --filename=$(UDEBNAME)

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

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