Makefile.am revision 90b17f1b
1#  Copyright 2005 Adam Jackson.
2#
3#  Permission is hereby granted, free of charge, to any person obtaining a
4#  copy of this software and associated documentation files (the "Software"),
5#  to deal in the Software without restriction, including without limitation
6#  on the rights to use, copy, modify, merge, publish, distribute, sub
7#  license, and/or sell copies of the Software, and to permit persons to whom
8#  the Software is furnished to do so, subject to the following conditions:
9#
10#  The above copyright notice and this permission notice (including the next
11#  paragraph) shall be included in all copies or substantial portions of the
12#  Software.
13#
14#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
17#  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
21# this is obnoxious:
22# -module lets us name the module exactly how we want
23# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
24# _ladir passes a dummy rpath to libtool so the thing will actually link
25# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
26
27SUBDIRS = xvmc
28
29BUILT_SOURCES = version.h
30EXTRA_DIST = version.h
31CONFIG_CLEAN_FILES= version.h
32AM_CFLAGS = @XORG_CFLAGS@ @LIBUDEV_CFLAGS@ @DRI_CFLAGS@
33openchrome_drv_la_LTLIBRARIES = openchrome_drv.la
34openchrome_drv_la_LDFLAGS = -module -avoid-version @LIBUDEV_LIBS@
35openchrome_drv_ladir = @moduledir@/drivers
36
37openchrome_drv_la_SOURCES = \
38         compat-api.h \
39         via_eng_regs.h \
40         via_3d.c \
41         via_3d.h \
42         via_3d_reg.h \
43         via_rop.h \
44         via_exa.c \
45         via_exa_h2.c \
46         via_exa_h6.c \
47         via_bandwidth.c \
48         via_ums.h \
49         via_ch7xxx.c \
50         via_ch7xxx.h \
51         via_display.c \
52         via_dmabuffer.h \
53         via_driver.c \
54         via_driver.h \
55         via_i2c.c \
56         via_id.c \
57         via_lvds.c \
58         via_memcpy.c \
59         via_memmgr.h \
60         via_memmgr.c \
61         via_outputs.c \
62         via_mode.h \
63         via_priv.h \
64         via_regs.h \
65         via_xv_overlay.c \
66         via_xv_overlay.h \
67         via_ums.c \
68         via_vbe.c \
69         via_vgahw.c \
70         via_vgahw.h \
71         via_xv.c \
72         via_xv.h \
73         via_vt162x.c \
74         via_vt162x.h \
75         via_xvpriv.h
76
77if DRI
78openchrome_drv_la_SOURCES += \
79         via_dri.c \
80         via_dri.h \
81         via_drm.h \
82         via_drmclient.h \
83         via_kms.h \
84         via_kms.c \
85         via_xvmc.c \
86         via_xvmc.h \
87         drm_fourcc.h
88else
89EXTRA_DIST += \
90         via_dri.c \
91         via_dri.h \
92         via_drm.h \
93         via_drmclient.h \
94         via_kms.h \
95         via_kms.c \
96         via_xvmc.c \
97         via_xvmc.h \
98         drm_fourcc.h
99endif
100
101via_driver.lo: version.h
102version.h: $(openchrome_drv_la_SOURCES)
103	@if [ -d ../.git ]; then \
104        echo '#define BUILDCOMMENT "(development build, branch' \
105                     "`git branch -v | sed 's/no branch/no_branch/' | \
106                      awk '/^\*/ { print $$2 }'`" \
107                     'at revision' \
108                     "`git log -1 --pretty=format:%h | head -1`"')"' \
109                    > $@.tmp; \
110    else \
111        if [ -d .svn ]; then \
112	        echo '#define BUILDCOMMENT "(development build, at revision '\
113	                "`svnversion -nc .. | sed -e s/^[^:]*://`"')"' > $@.tmp; \
114        else \
115	        date +'#define BUILDCOMMENT "(development build, compiled on %c)"' \
116        	> $@.tmp; \
117	    fi; \
118    fi
119
120	@chmod 666 $@.tmp
121	@mv $@.tmp $@
122	@echo "created $@"
123
124dist-hook:
125	@[ -e version.h ] && rm version.h; \
126	echo '#define BUILDCOMMENT "(openchrome '$(VERSION)' release)"' \
127	> version.h
128