File: rules

package info (click to toggle)
onscripter 20161102-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 1,288 kB
  • ctags: 1,866
  • sloc: cpp: 31,303; makefile: 83; sh: 13
file content (108 lines) | stat: -rwxr-xr-x 3,560 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
#!/usr/bin/make -f
# -*- makefile -*-

DEB_AVIFILE_FLAG    := $(findstring ok installed,$(shell dpkg-query -W -f='$${Status}' libavifile-0.7-dev))
DEB_VORBIS_FLAG     := $(findstring ok installed,$(shell dpkg-query -W -f='$${Status}' libvorbis-dev))
DEB_TREMOR_FLAG     := $(findstring ok installed,$(shell dpkg-query -W -f='$${Status}' libvorbisidec-dev))
DEB_MP3MAD_FLAG     := $(findstring ok installed,$(shell dpkg-query -W -f='$${Status}' libmad0-dev))
DEB_SMPEG_FLAG      := $(findstring ok installed,$(shell dpkg-query -W -f='$${Status}' libsmpeg-dev))
DEB_FONTCONFIG_FLAG := $(findstring ok installed,$(shell dpkg-query -W -f='$${Status}' libfontconfig1-dev))
DEB_LUA_FLAG        := $(findstring ok installed,$(shell dpkg-query -W -f='$${Status}' liblua5.2-dev))

M_CFLAGS = $(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) -Wall
M_LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)

CONFDEFS := -DLINUX -DUSE_CDROM
CONFINCS := $(M_CFLAGS) `sdl-config --cflags`
CONFLIBS := $(M_CFLAGS) $(M_LDFLAGS) `sdl-config --libs` -lSDL_ttf -lSDL_image -lSDL_mixer -lbz2 -ljpeg -lm
CONFEXT_OBJS :=
CONFTARGET := onscripter sardec nsadec sarconv nsaconv

# Use smpeg when it exists
ifneq (,$(DEB_SMPEG_FLAG))
CONFINCS += `smpeg-config --cflags`
CONFLIBS += `smpeg-config --libs`
CONFDEFS += -DUSE_SMPEG
endif

# avifile is only available on i386 and amd64
ifneq (,$(DEB_AVIFILE_FLAG))
CONFINCS += `avifile-config --cflags`
CONFLIBS += `avifile-config --libs`
CONFDEFS += -DUSE_AVIFILE
CONFEXT_OBJS += "AVIWrapper.o"
CONFTARGET += "simple_aviplay"
endif

# Use tremor/vorbis if they are installed
ifneq (,$(DEB_TREMOR_FLAG))
CONFLIBS += -lvorbisidec
CONFDEFS += -DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS
else
ifneq (,$(DEB_VORBIS_FLAG))
CONFINCS += `pkg-config --cflags vorbisfile`
CONFLIBS += `pkg-config --libs vorbisfile`
CONFDEFS += -DUSE_OGG_VORBIS
endif
endif

# Use mad if it is installed
ifneq (,$(DEB_MP3MAD_FLAG))
CONFINCS += `pkg-config --cflags mad`
CONFLIBS += `pkg-config --libs mad`
CONFDEFS += -DMP3_MAD
endif

# Use fontconfig if it is installed
ifneq (,$(DEB_FONTCONFIG_FLAG))
CONFINCS += `pkg-config --cflags fontconfig`
CONFLIBS += `pkg-config --libs fontconfig`
CONFDEFS += -DUSE_FONTCONFIG
endif

# Use lua if it is installed
ifneq (,$(DEB_LUA_FLAG))
CONFINCS += `pkg-config --cflags lua5.2`
CONFLIBS += `pkg-config --libs lua5.2`
CONFDEFS += -DUSE_LUA
CONFEXT_OBJS += LUAHandler.o
endif

%:
	dh  $@

onscripter.6: debian/onscripter.sgml
	docbook-to-man debian/onscripter.sgml > onscripter.6

nsaconv.6: debian/nsaconv.sgml
	docbook-to-man debian/nsaconv.sgml > nsaconv.6

nsadec.6: debian/nsadec.sgml
	docbook-to-man debian/nsadec.sgml > nsadec.6

sardec.6: debian/sardec.sgml
	docbook-to-man debian/sardec.sgml > sardec.6

override_dh_auto_build: onscripter.6 nsaconv.6 nsadec.6 sardec.6
	$(MAKE) DEFS="$(CONFDEFS) -DENABLE_1BYTE_CHAR -DFORCE_1BYTE_CHAR" \
		INCS="$(CONFINCS)" LIBS="$(CONFLIBS)" \
		TARGET="$(CONFTARGET)" EXT_OBJS="$(CONFEXT_OBJS)" \
		-f Makefile.Linux
	if test ! -e onscripter-1byte; then \
		cp -f onscripter onscripter-1byte; \
	fi
	$(MAKE) -f Makefile.Linux clean
	$(MAKE) DEFS="$(CONFDEFS)" INCS="$(CONFINCS)" LIBS="$(CONFLIBS)" \
		TARGET="$(CONFTARGET)" EXT_OBJS="$(CONFEXT_OBJS)" \
		-f Makefile.Linux

override_dh_auto_clean:
	dh_auto_clean
	$(MAKE) -f Makefile.Linux clean

override_dh_auto_install:
	dh_auto_install
	install -D www/* $(CURDIR)/debian/onscripter/usr/share/doc/onscripter/html
	if test -e simple_aviplay; then \
		dh_install simple_aviplay /usr/lib/games/onscripter; \
	fi