summaryrefslogtreecommitdiff
path: root/debian/rules
blob: 85dc65d664f48076a6bce7e9ae6afb7e058dff16 (plain)
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
#!/usr/bin/make -f

# We deduce the target based on the available version of the Maemo SDK
ifeq (1,$(shell pkg-config --atleast-version=5 maemo-version && echo 1))
TARGET=nokian900
else
TARGET=nokian8xx
endif

CONFIGURE_OPTIONS := --target=$(TARGET) --ram=8 --rbdir=/.rockbox --type=N
DESKTOP_DIR := `pkg-config --variable=desktopentrydir osso-af-settings`

export DH_VERBOSE=1

builddir:
	test -d builddir || mkdir -p builddir

builddir/Makefile: builddir
	cd builddir && test -f Makefile || ../tools/configure $(CONFIGURE_OPTIONS)

build: build-stamp

build-stamp: builddir/Makefile
	dh_testdir
	cd builddir && $(MAKE)
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	rm -rf builddir
	dh_clean
install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	cd builddir && $(MAKE) PREFIX=$(CURDIR)/debian/rockbox/opt/rockbox fullinstall

	# Remove broken plugins (keymap missing)
	# Note: Credits and f.e. mikmod are included and working
	rm -f $(CURDIR)/debian/rockbox/opt/rockbox/lib/rockbox/rocks/apps/*
	rm -f $(CURDIR)/debian/rockbox/opt/rockbox/lib/rockbox/rocks/demos/*
	rm -f $(CURDIR)/debian/rockbox/opt/rockbox/lib/rockbox/rocks/games/*

	# Install icon and .desktop file
	mkdir -p $(CURDIR)/debian/rockbox/usr/share/icons/hicolor/64x64/apps
	cp -f debian/maemo/rockbox.png $(CURDIR)/debian/rockbox/usr/share/icons/hicolor/64x64/apps
	mkdir -p $(CURDIR)/debian/rockbox$(DESKTOP_DIR)
	cp -f debian/maemo/rockbox.desktop $(CURDIR)/debian/rockbox$(DESKTOP_DIR)

	# Ignore built in sounds
	mkdir -p $(CURDIR)/debian/rockbox/usr/share/sounds
	touch    $(CURDIR)/debian/rockbox/usr/share/sounds/database.ignore

# Build architecture-independent files here.
binary-indep:
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installexamples
	dh_installman
	dh_link
	dh_strip --dbg-package=rockbox-dbg
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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