~ubuntu-branches/ubuntu/quantal/mesa-glw/quantal

« back to all changes in this revision

Viewing changes to src/mesa/Makefile.orig

  • Committer: Bazaar Package Importer
  • Author(s): Morten Kjeldgaard
  • Date: 2008-05-06 16:19:15 UTC
  • Revision ID: james.westby@ubuntu.com-20080506161915-uynz7nftmfixu6bq
Tags: upstream-7.0.3
ImportĀ upstreamĀ versionĀ 7.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# src/mesa/Makefile
 
2
 
 
3
TOP = ../..
 
4
include $(TOP)/configs/current
 
5
 
 
6
include sources
 
7
 
 
8
 
 
9
GL_MAJOR = 1
 
10
GL_MINOR = 5
 
11
GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
 
12
 
 
13
 
 
14
.SUFFIXES : .cpp
 
15
 
 
16
.c.o:
 
17
        $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
 
18
 
 
19
.cpp.o:
 
20
        $(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@
 
21
 
 
22
.S.o:
 
23
        $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
 
24
 
 
25
 
 
26
# Figure out what to make here
 
27
default:
 
28
        @if [ "${DRIVER_DIRS}" = "dri" ] ; then \
 
29
                $(MAKE) linux-solo ; \
 
30
        elif [ "${DRIVER_DIRS}" = "osmesa" ] ; then \
 
31
                $(MAKE) osmesa-only ; \
 
32
        elif [ "$(DRIVER_DIRS)" = "beos" ]; then \
 
33
                $(MAKE) beos ; \
 
34
        elif [ "$(DRIVER_DIRS)" = "directfb" ]; then \
 
35
                $(MAKE) directfb ; \
 
36
        elif [ "$(DRIVER_DIRS)" = "fbdev osmesa" ]; then \
 
37
                $(MAKE) fbdev ; $(MAKE) osmesa-only ; \
 
38
        else \
 
39
                $(MAKE) stand-alone ; \
 
40
        fi
 
41
 
 
42
 
 
43
######################################################################
 
44
# BeOS driver target
 
45
 
 
46
beos: depend subdirs libmesa.a
 
47
        cd drivers/beos; $(MAKE)
 
48
 
 
49
 
 
50
######################################################################
 
51
# Linux DRI drivers
 
52
 
 
53
# Make archive of core object files
 
54
libmesa.a: $(SOLO_OBJECTS)
 
55
        @ $(TOP)/bin/mklib -o mesa -static $(SOLO_OBJECTS);
 
56
        @if [ "${CONFIG_NAME}" = "beos" ] ; then \
 
57
                mimeset -f "$@" ; \
 
58
        fi
 
59
 
 
60
linux-solo: depend subdirs libmesa.a
 
61
        cd drivers/dri ; $(MAKE)
 
62
 
 
63
 
 
64
#####################################################################
 
65
# Stand-alone Mesa libGL, no built-in drivers (DirectFB)
 
66
 
 
67
libgl-core: $(CORE_OBJECTS)
 
68
        @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
 
69
                -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
 
70
                -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(CORE_OBJECTS) \
 
71
                $(GL_LIB_DEPS)
 
72
 
 
73
directfb: depend subdirs libgl-core
 
74
        cd drivers/directfb ; $(MAKE)
 
75
 
 
76
 
 
77
#####################################################################
 
78
# fbdev Mesa driver (libGL.so)
 
79
 
 
80
fbdev: $(CORE_OBJECTS) $(FBDEV_DRIVER_OBJECTS) $(COMMON_DRIVER_OBJECTS)
 
81
        @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
 
82
                -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
 
83
                -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
 
84
                $(CORE_OBJECTS) $(FBDEV_DRIVER_OBJECTS) \
 
85
                $(COMMON_DRIVER_OBJECTS) $(GL_LIB_DEPS)
 
86
 
 
87
 
 
88
######################################################################
 
89
# Stand-alone Mesa libGL and libOSMesa
 
90
STAND_ALONE_DRIVER_SOURCES = \
 
91
        $(COMMON_DRIVER_SOURCES) \
 
92
        $(X11_DRIVER_SOURCES)
 
93
 
 
94
STAND_ALONE_DRIVER_OBJECTS = $(STAND_ALONE_DRIVER_SOURCES:.c=.o)
 
95
 
 
96
STAND_ALONE_OBJECTS = \
 
97
        $(CORE_OBJECTS) \
 
98
        $(STAND_ALONE_DRIVER_OBJECTS)
 
99
 
 
100
# For libOSMesa16 or libOSMesa32 we link _all_ the objects into the library,
 
101
# not just the osmesa.o object (i.e. we don't have a libGL).
 
102
OSMESA16_OBJECTS = \
 
103
        $(CORE_OBJECTS) \
 
104
        $(COMMON_DRIVER_OBJECTS) \
 
105
        $(OSMESA_DRIVER_OBJECTS)
 
106
 
 
107
 
 
108
stand-alone: depend subdirs $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)
 
109
 
 
110
osmesa-only: depend subdirs $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)
 
111
 
 
112
# Make the GL library
 
113
$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(STAND_ALONE_OBJECTS)
 
114
        @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
 
115
                -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \
 
116
                -install $(TOP)/$(LIB_DIR) \
 
117
                $(MKLIB_OPTIONS) $(GL_LIB_DEPS) $(STAND_ALONE_OBJECTS)
 
118
 
 
119
# Make the OSMesa library
 
120
# Note: version is kept at 6.5.3 to simplify app/linking issues
 
121
$(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OSMESA_DRIVER_OBJECTS) $(OSMESA16_OBJECTS)
 
122
        @ if [ "${DRIVER_DIRS}" = "osmesa" ] ; then \
 
123
                $(TOP)/bin/mklib -o $(OSMESA_LIB) -linker '$(CC)' \
 
124
                        -major 6 -minor 5 -patch 3 \
 
125
                        -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
 
126
                        $(OSMESA_LIB_DEPS) $(OSMESA16_OBJECTS) ; \
 
127
        else \
 
128
                $(TOP)/bin/mklib -o $(OSMESA_LIB) -linker '$(CC)' \
 
129
                        -major 6 -minor 5 -patch 3 \
 
130
                        -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
 
131
                        $(OSMESA_LIB_DEPS) $(OSMESA_DRIVER_OBJECTS) ; \
 
132
        fi
 
133
 
 
134
 
 
135
######################################################################
 
136
# libGL pkg-config file
 
137
pcedit = sed \
 
138
        -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
 
139
        -e 's,@LIB_DIR@,$(LIB_DIR),' \
 
140
        -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),'
 
141
gl.pc: gl.pc.in
 
142
        $(pcedit) $< > $@
 
143
 
 
144
######################################################################
 
145
# Generic stuff
 
146
 
 
147
depend: $(ALL_SOURCES)
 
148
        @ echo "running $(MKDEP)"
 
149
        @ touch depend
 
150
        @$(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(ALL_SOURCES) \
 
151
                > /dev/null 2>/dev/null
 
152
 
 
153
 
 
154
subdirs:
 
155
        @ (cd x86 ; $(MAKE))
 
156
        @ (cd x86-64 ; $(MAKE))
 
157
 
 
158
 
 
159
install: default gl.pc
 
160
        $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
 
161
        $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
 
162
        $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
 
163
        $(INSTALL) -m 644 $(TOP)/include/GL/*.h $(DESTDIR)$(INSTALL_DIR)/include/GL
 
164
        @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \
 
165
                $(INSTALL) $(TOP)/$(LIB_DIR)/libGL* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR); \
 
166
        fi
 
167
        $(INSTALL) -m 644 gl.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
 
168
        @if [ -e $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) ]; then \
 
169
                $(INSTALL) $(TOP)/$(LIB_DIR)/libOSMesa* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR); \
 
170
        fi
 
171
        @if [ "${DRIVER_DIRS}" = "dri" ] ; then \
 
172
                cd drivers/dri ; $(MAKE) install ; \
 
173
        fi
 
174
 
 
175
## NOT INSTALLED YET:
 
176
## $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GLES
 
177
## $(INSTALL) -m 644 include/GLES/*.h $(DESTDIR)$(INSTALL_DIR)/include/GLES
 
178
 
 
179
 
 
180
# Emacs tags
 
181
tags:
 
182
        etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h
 
183
 
 
184
clean:
 
185
        -rm -f */*.o
 
186
        -rm -f */*/*.o
 
187
        -rm -f depend depend.bak libmesa.a
 
188
        -rm -f drivers/*/*.o
 
189
        (cd drivers/dri ; $(MAKE) clean)
 
190
        (cd x86 ; $(MAKE) clean)
 
191
        (cd x86-64 ; $(MAKE) clean)
 
192
 
 
193
 
 
194
include depend