File: rules

package info (click to toggle)
glide 2002.04.10ds1-15
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 59,556 kB
  • sloc: ansic: 290,125; asm: 23,305; sh: 8,089; pascal: 3,854; makefile: 1,276; perl: 73
file content (114 lines) | stat: -rwxr-xr-x 2,762 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

#export DH_VERBOSE = 1

INSTALL = install
INSTALL_LIB = $(INSTALL) -m 644

DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
DEB_CFLAGS_MAINT_APPEND = -Wall

include /usr/share/dpkg/default.mk

ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
ifeq ($(DEB_HOST_ARCH),alpha)
  CFLAGS += -mcpu=ev5 -fomit-frame-pointer \
	    -fexpensive-optimizations -mieee -DBIG_OPT
else
ifeq ($(DEB_HOST_ARCH),i386)
  CFLAGS += -O3 -march=i686 -fomit-frame-pointer -funroll-loops \
	    -fexpensive-optimizations -ffast-math -DBIG_OPT
else
  CFLAGS += -fomit-frame-pointer -fexpensive-optimizations -ffast-math \
	    -DBIG_OPT
endif
endif
endif

export FX_GLIDE_PIC = 1

define glide3_build
( \
  cd $(CURDIR)/glide3x; \
  mkdir $(CURDIR)/debian/tmp.$(1); \
  ./chores.3dfx --generate "--configure=--enable-fx-glide-hw=$(1) \
    --prefix=/usr" --build-dir=build.$(1); \
  cd build.$(1); \
  ./build.3dfx --no-x DESTDIR="$(CURDIR)/debian/tmp.$(1)/" \
    CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" install; \
)
endef

pkg_dir := $(CURDIR)/debian
libglide3_dir := $(pkg_dir)/libglide3

debian/po/templates.pot: debian/libglide3.templates
	@debconf-updatepo

build-indep:

build-arch: build-arch.stamp
build-arch.stamp: debian/po/templates.pot
	ln -fs ../swlibs glide3x/
	$(call glide3_build,h3)
	$(call glide3_build,h5)
	
	touch $@

build: build-indep build-arch

clean:
	ln -fs ../swlibs glide3x/
	cd $(CURDIR)/glide3x; ./chores.3dfx --clean
	rm -f glide3x/swlibs
	
	rm -rf $(CURDIR)/glide3x/build.h3 $(CURDIR)/debian/tmp.h3
	rm -rf $(CURDIR)/glide3x/build.h5 $(CURDIR)/debian/tmp.h5
	rm -f *.stamp
	
	dh_clean

binary: binary-indep binary-arch

binary-indep:
	# Nothing to do.

binary-arch: build-arch
	dh_testdir
	dh_testroot
	dh_prep -a
	
	dh_installdirs -a
	
	# libglide3
	$(INSTALL_LIB) $(CURDIR)/debian/tmp.h3/usr/lib/libglide3.so.3.10.0 \
		       $(libglide3_dir)/usr/lib/glide3/libglide3_h3.so.3.10.0
	$(INSTALL_LIB) $(CURDIR)/debian/tmp.h5/usr/lib/libglide3.so.3.10.0 \
		       $(libglide3_dir)/usr/lib/glide3/libglide3_h5.so.3.10.0
	
	dh_install -a
	dh_installdocs -a
	dh_installchangelogs -a
	dh_installdebconf -a
	
	dh_lintian -a
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -a
	dh_installdeb -a
	
	dh_shlibdeps -a
	#dh_shlibdeps -a -Nglide3-bin
	# XXX: We use $(CURDIR) instead of $(libglide3_dir) because we do not
	# ship in the .deb the symlink to the hardware specific library.
	# XXX: dh_shlibdeps forces the -l argument to be an absolute path
	# breaking the build, so pass -l directly to dpkg-shlibdeps.
	#dh_shlibdeps -pglide3-bin -Llibglide3 -l$(CURDIR)/glide3/h5/lib
	
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

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