Rename sb2-qemu to sb2-qemu-arm
[qemu] / debian / rules
1 #!/usr/bin/make -f
2 #
3 # $Id: rules 366 2008-12-23 16:19:26Z aurel32 $
4 #
5
6 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
7         CFLAGS = -O0
8 endif
9
10 # Support multiple makes at once
11 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
12 NJOBS := -j $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
13 endif
14
15 # Architecture/system specific configuration
16 DEB_HOST_ARCH_OS = $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
17 DEB_HOST_ARCH_CPU = $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
18
19
20 TARGET_SYSTEM_TCG    = arm-softmmu i386-softmmu
21 TARGET_LINUX_TCG     = arm-linux-user i386-linux-user
22 package_list             = obj-sb2/config-host.mak
23 install_list             = sb2-qemu-install
24 sb1_prefix                       = /scratchbox/devkits/cputransp
25
26 target_system_list = $(TARGET_SYSTEM_TCG)
27
28 ifeq ($(DEB_HOST_ARCH_OS),linux)
29        conf_arch += --audio-drv-list=sdl
30        target_linux_list += $(TARGET_LINUX_TCG)
31 endif
32 ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
33        conf_arch += --audio-drv-list=oss,sdl,esd,pa
34 endif
35
36 ifeq ($(DEB_HOST_ARCH_CPU),i386)
37        conf_arch += --cpu=i386
38        package_list += obj-sb1/config-host.mak
39        install_list += sb1-qemu-install
40 endif
41 ifeq ($(DEB_HOST_ARCH_CPU),sparc)
42        conf_arch += --cpu=sparc
43 endif
44
45 qemu_docs = \
46         qemu-doc.html \
47         qemu-tech.html \
48         qemu.1 \
49         qemu-img.1
50
51 obj-sb2/config-host.mak: configure
52         dh_testdir
53         mkdir obj-sb2
54         ( cd obj-sb2; CFLAGS="$(CFLAGS)" ../configure \
55                 --prefix=/usr \
56                 --interp-prefix=/ \
57                 --disable-blobs \
58                 --target-list="$(target_system_list) $(target_linux_list)" \
59                 $(conf_arch) )
60         ( cd obj-sb2; $(MAKE) $(NJOBS) )
61
62 obj-sb1/config-host.mak: configure
63         dh_testdir
64         mkdir obj-sb1
65         ( cd obj-sb1; CFLAGS="$(CFLAGS) $(SB1_CFLAGS)"  ../configure \
66                 --prefix=$(sb1_prefix) \
67                 --interp-prefix=/ \
68                 --static \
69                 --target-list="arm-linux-user" \
70                 --disable-kqemu --disable-sdl )
71         ( cd obj-sb1; $(MAKE) $(NJOBS) )
72
73 build: $(package_list)
74
75 clean:
76         dh_testdir
77         dh_testroot
78         
79         [ ! -f config-host.mak ] || $(MAKE) distclean
80         
81         rm -rf obj-sb1 obj-sb2
82         rm -f $(qemu_docs)
83         
84         dh_clean
85
86 # cputransp-methods should be generated at postinst
87 sb1-qemu-install:
88         mkdir -p debian/sb1-qemu/$(sb1_prefix)/{bin,etc}
89         cp debian/cputransp-methods debian/sb1-qemu/$(sb1_prefix)/etc
90         cp obj-sb1/*-linux-user/qemu-* debian/sb1-qemu/$(sb1_prefix)/bin
91         ln -sf $(sb1_prefix)/bin/qemu-arm debian/sb1-qemu/$(sb1_prefix)/bin/qemu-arm-cvs-m
92
93 sb2-qemu-install:
94         mkdir -p debian/sb2-qemu-arm/usr/bin
95         cp obj-sb2/arm-linux-user/qemu-arm debian/sb2-qemu-arm/usr/bin/sb2-qemu-arm
96         cp obj-sb2/i386-linux-user/qemu-i386  debian/sb2-qemu-arm/usr/bin/sb2-qemu-i386
97         cp obj-sb2/arm-softmmu/qemu-system-arm  debian/sb2-qemu-arm/usr/bin/sb2-qemu-system-arm
98         cp obj-sb2/i386-softmmu/qemu  debian/sb2-qemu-arm/usr/bin/sb2-qemu-system-i386
99
100 install: build $(install_list)
101         dh_testdir
102         dh_testroot
103 #       dh_clean -k
104         dh_installdirs -a
105
106 binary-indep:
107 # Nothing to do.
108
109 binary-arch: install
110         dh_testdir
111         dh_testroot
112 #       dh_install -a
113 #       dh_installdebconf -a
114         dh_installdocs -s
115         dh_installexamples -s
116 #       dh_installlogrotate -a
117         dh_installman -s
118         dh_installinfo -s
119         dh_installchangelogs -s Changelog
120         dh_link -s
121         dh_strip -s
122         dh_compress -s
123         dh_fixperms -s
124         dh_installdeb -s
125         dh_shlibdeps -s
126         dh_gencontrol -s
127         dh_md5sums -s
128         dh_builddeb -s
129
130 binary: binary-indep binary-arch
131
132 .PHONY: build clean binary-indep binary-arch binary install
133