fix non-softfp case
[collab-maint/xf86-video-omapfb.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for the Debian xserver-xorg-driver-nv package.
3 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>
4 # Copyright © 2005 Daniel Stone <daniel@fooishbar.org>
5 # Copyright © 2005 David Nusinow <dnusinow@debian.org>
6
7 # Uncomment this to turn on verbose mode.
8 #export DH_VERBOSE=1
9
10 CFLAGS = -Wall -g
11 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
12         CFLAGS += -O0
13 else
14         CFLAGS += -O2
15 endif
16 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
17         NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
18         MAKEFLAGS += -j$(NUMJOBS)
19 endif
20
21 DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
22 DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
23 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
24 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
25         confflags += --build=$(DEB_HOST_GNU_TYPE)
26 else
27         confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
28 endif
29
30 SERVERMINVERS = $(shell cat /usr/share/xserver-xorg/serverminver 2>/dev/null)
31 VIDEOABI = $(shell cat /usr/share/xserver-xorg/videoabiver 2>/dev/null)
32 SERVER_DEPENDS = xserver-xorg-core (>= $(SERVERMINVERS))
33 VIDDRIVER_PROVIDES = xserver-xorg-video-$(VIDEOABI)
34
35 serverabi:
36 ifeq ($(SERVERMINVERS),)
37         @echo warning: xserver-xorg-dev needs to be installed
38 else
39         echo "xserver:Depends=$(SERVER_DEPENDS)" >> debian/xserver-xorg-video-omapfb.substvars
40         echo "xviddriver:Provides=$(VIDDRIVER_PROVIDES)" >> debian/xserver-xorg-video-omapfb.substvars
41         echo "xserver:Depends=$(SERVER_DEPENDS)" >> debian/xserver-xorg-video-omap3.substvars
42         echo "xviddriver:Provides=$(VIDDRIVER_PROVIDES)" >> debian/xserver-xorg-video-omap3.substvars
43 endif
44
45
46 confflags += --disable-static
47
48 confflags_omap3 += $(confflags) --enable-neon
49 CFLAGS_OMAP3 += $(CFLAGS) -mfloat-abi=softfp -mcpu=cortex-a8 -mfpu=neon
50
51 configure:
52         dh_testdir
53         autoreconf -vfi
54
55 obj-$(DEB_BUILD_GNU_TYPE)/config.status: configure
56         dh_testdir
57         mkdir -p obj-$(DEB_BUILD_GNU_TYPE)
58         cd obj-$(DEB_BUILD_GNU_TYPE) && \
59         ../configure --prefix=/usr --mandir=\$${prefix}/share/man \
60                      --infodir=\$${prefix}/share/info $(confflags) \
61                      CFLAGS="$(CFLAGS)"
62
63 obj-omap3/config.status: configure
64         dh_testdir
65         mkdir -p obj-omap3
66         cd obj-omap3 && \
67         ../configure --prefix=/usr --mandir=\$${prefix}/share/man \
68                      --infodir=\$${prefix}/share/info $(confflags_omap3) \
69                      CFLAGS="$(CFLAGS_OMAP3)"
70
71 build: build-stamp
72 build-stamp: obj-$(DEB_BUILD_GNU_TYPE)/config.status obj-omap3/config.status
73         dh_testdir
74         cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
75         cd obj-omap3 && $(MAKE)
76         >$@
77
78 clean: 
79         dh_testdir
80         dh_testroot
81         rm -f build-stamp
82
83         rm -f config.cache config.log config.status
84         rm -f */config.cache */config.log */config.status
85         rm -f conftest* */conftest*
86         rm -rf autom4te.cache */autom4te.cache
87         rm -rf obj-*
88         rm -f $$(find -name Makefile.in)
89         rm -f compile config.guess config.sub configure depcomp install-sh
90         rm -f ltmain.sh missing INSTALL aclocal.m4 config.h.in mkinstalldirs
91
92         dh_clean
93
94 install: build
95         dh_testdir
96         dh_testroot
97         dh_clean -k
98         dh_installdirs
99
100         cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
101         cd obj-omap3 && $(MAKE) DESTDIR=$(CURDIR)/debian/xserver-xorg-video-omap3 install
102         rm -f $(CURDIR)/debian/xserver-xorg-video-omap3/usr/lib/xorg/modules/drivers/omapfb_drv.la
103
104 # Build architecture-dependent files here.
105 binary-arch: build install serverabi
106         dh_testdir
107         dh_testroot
108
109         dh_installdocs
110         dh_installchangelogs
111         dh_install --sourcedir=debian/tmp --list-missing --exclude=.la
112         dh_link
113         dh_strip
114         dh_compress
115         dh_fixperms
116         dh_installdeb
117         dh_shlibdeps -- --warnings=6
118         dh_gencontrol
119         dh_md5sums
120         dh_builddeb
121
122 # Build architecture-independent files here.
123 binary-indep: build install
124 # Nothing to do
125
126 binary: binary-indep binary-arch
127 .PHONY: build clean binary-indep binary-arch binary install