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