File: rules

package info (click to toggle)
glide 2002.04.10ds1-21
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 59,668 kB
  • sloc: ansic: 290,122; asm: 23,305; sh: 8,090; pascal: 3,854; makefile: 1,258; perl: 73
file content (79 lines) | stat: -rwxr-xr-x 2,158 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
#!/usr/bin/make -f

#export DH_VERBOSE = 1

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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all future=+lfs
export DEB_CFLAGS_MAINT_APPEND = -Wall

include /usr/share/dpkg/default.mk

ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  confflags += --build=$(DEB_HOST_GNU_TYPE)
else
  confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
endif

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) \
    $(confflags) \
    --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

%:
	dh $@

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

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

execute_before_dh_auto_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

execute_before_dh_auto_install:
	# 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

override_dh_installchangelogs:
	dh_installchangelogs --no-trim