Merge branch 'shader-file-reorg'
[profile/ivi/mesa.git] / Makefile
1 # Top-level Mesa makefile
2
3 TOP = .
4
5 SUBDIRS = src
6
7
8 default: $(TOP)/configs/current
9         @for dir in $(SUBDIRS) ; do \
10                 if [ -d $$dir ] ; then \
11                         (cd $$dir && $(MAKE)) || exit 1 ; \
12                 fi \
13         done
14
15 all: default
16
17
18 doxygen:
19         cd doxygen && $(MAKE)
20
21 clean:
22         -@touch $(TOP)/configs/current
23         -@for dir in $(SUBDIRS) ; do \
24                 if [ -d $$dir ] ; then \
25                         (cd $$dir && $(MAKE) clean) ; \
26                 fi \
27         done
28         -@test -s $(TOP)/configs/current || rm -f $(TOP)/configs/current
29
30
31 realclean: clean
32         -rm -rf lib*
33         -rm -f $(TOP)/configs/current
34         -rm -f $(TOP)/configs/autoconf
35         -rm -rf autom4te.cache
36         -find . '(' -name '*.o' -o -name '*.a' -o -name '*.so' -o \
37           -name depend -o -name depend.bak ')' -exec rm -f '{}' ';'
38
39
40 distclean: realclean
41
42
43 install:
44         @for dir in $(SUBDIRS) ; do \
45                 if [ -d $$dir ] ; then \
46                         (cd $$dir && $(MAKE) install) || exit 1 ; \
47                 fi \
48         done
49
50
51 .PHONY: default doxygen clean realclean distclean install
52
53 # If there's no current configuration file
54 $(TOP)/configs/current:
55         @echo
56         @echo
57         @echo "Please choose a configuration from the following list:"
58         @ls -1 $(TOP)/configs | grep -v "current\|default\|CVS\|autoconf.*"
59         @echo
60         @echo "Then type 'make <config>' (ex: 'make linux-x86')"
61         @echo
62         @echo "Or, run './configure' then 'make'"
63         @echo "See './configure --help' for details"
64         @echo
65         @echo "(ignore the following error message)"
66         @exit 1
67
68
69 # Rules to set/install a specific build configuration
70 aix \
71 aix-64 \
72 aix-64-static \
73 aix-gcc \
74 aix-static \
75 autoconf \
76 bluegene-osmesa \
77 bluegene-xlc-osmesa \
78 beos \
79 catamount-osmesa-pgi \
80 darwin \
81 darwin-fat-32bit \
82 darwin-fat-all \
83 freebsd \
84 freebsd-dri \
85 freebsd-dri-amd64 \
86 freebsd-dri-x86 \
87 hpux10 \
88 hpux10-gcc \
89 hpux10-static \
90 hpux11-32 \
91 hpux11-32-static \
92 hpux11-32-static-nothreads \
93 hpux11-64 \
94 hpux11-64-static \
95 hpux11-ia64 \
96 hpux11-ia64-static \
97 hpux9 \
98 hpux9-gcc \
99 irix6-64 \
100 irix6-64-static \
101 irix6-n32 \
102 irix6-n32-static \
103 irix6-o32 \
104 irix6-o32-static \
105 linux \
106 linux-i965 \
107 linux-alpha \
108 linux-alpha-static \
109 linux-cell \
110 linux-cell-debug \
111 linux-debug \
112 linux-dri \
113 linux-dri-debug \
114 linux-dri-x86 \
115 linux-dri-x86-64 \
116 linux-dri-ppc \
117 linux-dri-xcb \
118 linux-egl \
119 linux-indirect \
120 linux-fbdev \
121 linux-ia64-icc \
122 linux-ia64-icc-static \
123 linux-icc \
124 linux-icc-static \
125 linux-llvm \
126 linux-llvm-debug \
127 linux-opengl-es \
128 linux-osmesa \
129 linux-osmesa-static \
130 linux-osmesa16 \
131 linux-osmesa16-static \
132 linux-osmesa32 \
133 linux-ppc \
134 linux-ppc-static \
135 linux-profile \
136 linux-sparc \
137 linux-sparc5 \
138 linux-static \
139 linux-ultrasparc \
140 linux-tcc \
141 linux-x86 \
142 linux-x86-debug \
143 linux-x86-32 \
144 linux-x86-64 \
145 linux-x86-64-debug \
146 linux-x86-64-profile \
147 linux-x86-64-static \
148 linux-x86-profile \
149 linux-x86-static \
150 netbsd \
151 openbsd \
152 osf1 \
153 osf1-static \
154 solaris-x86 \
155 solaris-x86-gcc \
156 solaris-x86-gcc-static \
157 sunos4 \
158 sunos4-gcc \
159 sunos4-static \
160 sunos5 \
161 sunos5-gcc \
162 sunos5-64-gcc \
163 sunos5-smp \
164 sunos5-v8 \
165 sunos5-v8-static \
166 sunos5-v9 \
167 sunos5-v9-static \
168 sunos5-v9-cc-g++ \
169 ultrix-gcc:
170         @ if test -f configs/current -o -L configs/current; then \
171                 if ! cmp configs/$@ configs/current > /dev/null; then \
172                         echo "Please run 'make realclean' before changing configs" ; \
173                         exit 1 ; \
174                 fi ; \
175         else \
176                 cd configs && rm -f current && ln -s $@ current ; \
177         fi
178         $(MAKE) default
179
180
181 # Rules for making release tarballs
182
183 VERSION=7.9-devel
184 DIRECTORY = Mesa-$(VERSION)
185 LIB_NAME = MesaLib-$(VERSION)
186 GLUT_NAME = MesaGLUT-$(VERSION)
187
188 # This is part of MAIN_FILES
189 MAIN_ES_FILES = \
190         $(DIRECTORY)/src/mesa/es/Makefile                               \
191         $(DIRECTORY)/src/mesa/es/sources.mak                            \
192         $(DIRECTORY)/src/mesa/main/*.xml                                \
193         $(DIRECTORY)/src/mesa/main/*.py                                 \
194         $(DIRECTORY)/src/mesa/main/*.dtd
195
196 MAIN_FILES = \
197         $(DIRECTORY)/Makefile*                                          \
198         $(DIRECTORY)/configure                                          \
199         $(DIRECTORY)/configure.ac                                       \
200         $(DIRECTORY)/acinclude.m4                                       \
201         $(DIRECTORY)/aclocal.m4                                         \
202         $(DIRECTORY)/bin/config.guess                                   \
203         $(DIRECTORY)/bin/config.sub                                     \
204         $(DIRECTORY)/bin/install-sh                                     \
205         $(DIRECTORY)/bin/mklib                                          \
206         $(DIRECTORY)/bin/minstall                                       \
207         $(DIRECTORY)/bin/version.mk                                     \
208         $(DIRECTORY)/configs/[a-z]*                                     \
209         $(DIRECTORY)/docs/*.html                                        \
210         $(DIRECTORY)/docs/COPYING                                       \
211         $(DIRECTORY)/docs/README.*                                      \
212         $(DIRECTORY)/docs/RELNOTES*                                     \
213         $(DIRECTORY)/docs/*.spec                                        \
214         $(DIRECTORY)/include/GL/internal/glcore.h                       \
215         $(DIRECTORY)/include/GL/gl.h                                    \
216         $(DIRECTORY)/include/GL/glext.h                                 \
217         $(DIRECTORY)/include/GL/gl_mangle.h                             \
218         $(DIRECTORY)/include/GL/glu.h                                   \
219         $(DIRECTORY)/include/GL/glu_mangle.h                            \
220         $(DIRECTORY)/include/GL/glx.h                                   \
221         $(DIRECTORY)/include/GL/glxext.h                                \
222         $(DIRECTORY)/include/GL/glx_mangle.h                            \
223         $(DIRECTORY)/include/GL/glfbdev.h                               \
224         $(DIRECTORY)/include/GL/mesa_wgl.h                              \
225         $(DIRECTORY)/include/GL/osmesa.h                                \
226         $(DIRECTORY)/include/GL/vms_x_fix.h                             \
227         $(DIRECTORY)/include/GL/wglext.h                                \
228         $(DIRECTORY)/include/GL/wmesa.h                                 \
229         $(DIRECTORY)/src/glsl/Makefile                                  \
230         $(DIRECTORY)/src/glsl/Makefile.template                         \
231         $(DIRECTORY)/src/glsl/SConscript                                \
232         $(DIRECTORY)/src/glsl/*/Makefile                                \
233         $(DIRECTORY)/src/glsl/*/*.[ch]                                  \
234         $(DIRECTORY)/src/Makefile                                       \
235         $(DIRECTORY)/src/mesa/Makefile*                                 \
236         $(DIRECTORY)/src/mesa/sources.mak                               \
237         $(DIRECTORY)/src/mesa/descrip.mms                               \
238         $(DIRECTORY)/src/mesa/gl.pc.in                                  \
239         $(DIRECTORY)/src/mesa/osmesa.pc.in                              \
240         $(DIRECTORY)/src/mesa/depend                                    \
241         $(MAIN_ES_FILES)                                                \
242         $(DIRECTORY)/src/mesa/main/*.[chS]                              \
243         $(DIRECTORY)/src/mesa/main/descrip.mms                          \
244         $(DIRECTORY)/src/mesa/math/*.[ch]                               \
245         $(DIRECTORY)/src/mesa/math/descrip.mms                          \
246         $(DIRECTORY)/src/mesa/program/*.[chly]                          \
247         $(DIRECTORY)/src/mesa/program/Makefile                          \
248         $(DIRECTORY)/src/mesa/program/descrip.mms                       \
249         $(DIRECTORY)/src/mesa/slang/*.[ch]                              \
250         $(DIRECTORY)/src/mesa/slang/descrip.mms                         \
251         $(DIRECTORY)/src/mesa/slang/library/*.gc                        \
252         $(DIRECTORY)/src/mesa/slang/library/Makefile                    \
253         $(DIRECTORY)/src/mesa/swrast/*.[ch]                             \
254         $(DIRECTORY)/src/mesa/swrast/descrip.mms                        \
255         $(DIRECTORY)/src/mesa/swrast_setup/*.[ch]                       \
256         $(DIRECTORY)/src/mesa/swrast_setup/descrip.mms                  \
257         $(DIRECTORY)/src/mesa/vbo/*.[chS]                               \
258         $(DIRECTORY)/src/mesa/vbo/descrip.mms                           \
259         $(DIRECTORY)/src/mesa/tnl/*.[chS]                               \
260         $(DIRECTORY)/src/mesa/tnl/descrip.mms                           \
261         $(DIRECTORY)/src/mesa/tnl_dd/*.[ch]                             \
262         $(DIRECTORY)/src/mesa/tnl_dd/imm/*.[ch]                         \
263         $(DIRECTORY)/src/mesa/tnl_dd/imm/NOTES.imm                      \
264         $(DIRECTORY)/src/mesa/drivers/Makefile                          \
265         $(DIRECTORY)/src/mesa/drivers/beos/*.cpp                        \
266         $(DIRECTORY)/src/mesa/drivers/beos/Makefile                     \
267         $(DIRECTORY)/src/mesa/drivers/common/*.[ch]                     \
268         $(DIRECTORY)/src/mesa/drivers/common/descrip.mms                \
269         $(DIRECTORY)/src/mesa/drivers/fbdev/Makefile                    \
270         $(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c                   \
271         $(DIRECTORY)/src/mesa/drivers/osmesa/Makefile                   \
272         $(DIRECTORY)/src/mesa/drivers/osmesa/Makefile.win               \
273         $(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms                \
274         $(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.def                 \
275         $(DIRECTORY)/src/mesa/drivers/osmesa/*.[ch]                     \
276         $(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch]                  \
277         $(DIRECTORY)/src/mesa/drivers/windows/*/*.def                   \
278         $(DIRECTORY)/src/mesa/drivers/x11/Makefile                      \
279         $(DIRECTORY)/src/mesa/drivers/x11/descrip.mms                   \
280         $(DIRECTORY)/src/mesa/drivers/x11/*.[ch]                        \
281         $(DIRECTORY)/src/mesa/drivers/glslcompiler/Makefile             \
282         $(DIRECTORY)/src/mesa/drivers/glslcompiler/glslcompiler.c       \
283         $(DIRECTORY)/src/mesa/ppc/*.[ch]                                \
284         $(DIRECTORY)/src/mesa/sparc/*.[chS]                             \
285         $(DIRECTORY)/src/mesa/x86/Makefile                              \
286         $(DIRECTORY)/src/mesa/x86/*.[ch]                                \
287         $(DIRECTORY)/src/mesa/x86/*.S                                   \
288         $(DIRECTORY)/src/mesa/x86/rtasm/*.[ch]                          \
289         $(DIRECTORY)/src/mesa/x86-64/*.[chS]                            \
290         $(DIRECTORY)/src/mesa/x86-64/Makefile                           \
291         $(DIRECTORY)/windows/VC8/
292
293 MAPI_FILES = \
294         $(DIRECTORY)/include/GLES/*.h                                   \
295         $(DIRECTORY)/include/GLES2/*.h                                  \
296         $(DIRECTORY)/include/VG/*.h                                     \
297         $(DIRECTORY)/src/mapi/es?api/Makefile                           \
298         $(DIRECTORY)/src/mapi/es?api/*.pc.in                            \
299         $(DIRECTORY)/src/mapi/glapi/gen/Makefile                        \
300         $(DIRECTORY)/src/mapi/glapi/gen/*.xml                           \
301         $(DIRECTORY)/src/mapi/glapi/gen/*.py                            \
302         $(DIRECTORY)/src/mapi/glapi/gen/*.dtd                           \
303         $(DIRECTORY)/src/mapi/glapi/gen-es/Makefile                     \
304         $(DIRECTORY)/src/mapi/glapi/gen-es/*.xml                        \
305         $(DIRECTORY)/src/mapi/glapi/gen-es/*.py                         \
306         $(DIRECTORY)/src/mapi/glapi/Makefile                            \
307         $(DIRECTORY)/src/mapi/glapi/SConscript                          \
308         $(DIRECTORY)/src/mapi/glapi/sources.mak                         \
309         $(DIRECTORY)/src/mapi/glapi/*.[chS]                             \
310         $(DIRECTORY)/src/mapi/mapi/mapi_abi.py                          \
311         $(DIRECTORY)/src/mapi/mapi/sources.mak                          \
312         $(DIRECTORY)/src/mapi/mapi/*.[ch]                               \
313         $(DIRECTORY)/src/mapi/vgapi/Makefile                            \
314         $(DIRECTORY)/src/mapi/vgapi/vgapi.csv                           \
315         $(DIRECTORY)/src/mapi/vgapi/vg.pc.in                            \
316         $(DIRECTORY)/src/mapi/vgapi/*.h
317
318 EGL_FILES = \
319         $(DIRECTORY)/include/KHR/*.h                                    \
320         $(DIRECTORY)/include/EGL/*.h                                    \
321         $(DIRECTORY)/src/egl/Makefile                                   \
322         $(DIRECTORY)/src/egl/*/Makefile                                 \
323         $(DIRECTORY)/src/egl/*/Makefile.template                        \
324         $(DIRECTORY)/src/egl/*/*.[ch]                                   \
325         $(DIRECTORY)/src/egl/*/*/Makefile                               \
326         $(DIRECTORY)/src/egl/*/*/*.[ch]
327
328 GALLIUM_FILES = \
329         $(DIRECTORY)/src/mesa/state_tracker/*[ch]                       \
330         $(DIRECTORY)/src/gallium/Makefile                               \
331         $(DIRECTORY)/src/gallium/Makefile.template                      \
332         $(DIRECTORY)/src/gallium/SConscript                             \
333         $(DIRECTORY)/src/gallium/targets/Makefile.dri                   \
334         $(DIRECTORY)/src/gallium/targets/Makefile.egl                   \
335         $(DIRECTORY)/src/gallium/*/Makefile                             \
336         $(DIRECTORY)/src/gallium/*/SConscript                           \
337         $(DIRECTORY)/src/gallium/*/*/Makefile                           \
338         $(DIRECTORY)/src/gallium/*/*/SConscript                         \
339         $(DIRECTORY)/src/gallium/*/*/*.[ch]                             \
340         $(DIRECTORY)/src/gallium/*/*/*.py                               \
341         $(DIRECTORY)/src/gallium/*/*/*.csv                              \
342         $(DIRECTORY)/src/gallium/*/*/*/Makefile                         \
343         $(DIRECTORY)/src/gallium/*/*/*/SConscript                       \
344         $(DIRECTORY)/src/gallium/*/*/*/*.[ch]                           \
345         $(DIRECTORY)/src/gallium/*/*/*/*.py
346
347
348 DRI_FILES = \
349         $(DIRECTORY)/include/GL/internal/dri_interface.h                \
350         $(DIRECTORY)/include/GL/internal/glcore.h                       \
351         $(DIRECTORY)/include/GL/internal/sarea.h                        \
352         $(DIRECTORY)/src/glx/Makefile                                   \
353         $(DIRECTORY)/src/glx/Makefile                                   \
354         $(DIRECTORY)/src/glx/*.[ch]                                     \
355         $(DIRECTORY)/src/mesa/drivers/dri/Makefile                      \
356         $(DIRECTORY)/src/mesa/drivers/dri/Makefile.template             \
357         $(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in                     \
358         $(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.[ch]         \
359         $(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po           \
360         $(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS]                     \
361         $(DIRECTORY)/src/mesa/drivers/dri/*/*/*.[chS]                   \
362         $(DIRECTORY)/src/mesa/drivers/dri/*/Makefile                    \
363         $(DIRECTORY)/src/mesa/drivers/dri/*/*/Makefile                  \
364         $(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile                    \
365         $(DIRECTORY)/src/mesa/drivers/dri/*/server/*.[ch]
366
367 SGI_GLU_FILES = \
368         $(DIRECTORY)/src/glu/Makefile                                   \
369         $(DIRECTORY)/src/glu/glu.pc.in                                  \
370         $(DIRECTORY)/src/glu/sgi/Makefile                               \
371         $(DIRECTORY)/src/glu/sgi/Makefile.mgw                           \
372         $(DIRECTORY)/src/glu/sgi/Makefile.win                           \
373         $(DIRECTORY)/src/glu/sgi/glu.def                                \
374         $(DIRECTORY)/src/glu/sgi/dummy.cc                               \
375         $(DIRECTORY)/src/glu/sgi/glu.exports                            \
376         $(DIRECTORY)/src/glu/sgi/glu.exports.darwin                     \
377         $(DIRECTORY)/src/glu/sgi/mesaglu.opt                            \
378         $(DIRECTORY)/src/glu/sgi/include/gluos.h                        \
379         $(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.h                 \
380         $(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.cc                \
381         $(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.h                 \
382         $(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.cc                \
383         $(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.h                  \
384         $(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.cc                 \
385         $(DIRECTORY)/src/glu/sgi/libtess/README                         \
386         $(DIRECTORY)/src/glu/sgi/libtess/alg-outline                    \
387         $(DIRECTORY)/src/glu/sgi/libtess/*.[ch]                         \
388         $(DIRECTORY)/src/glu/sgi/libutil/*.[ch]
389
390 GLW_FILES = \
391         $(DIRECTORY)/src/glw/*.[ch]                     \
392         $(DIRECTORY)/src/glw/Makefile*                  \
393         $(DIRECTORY)/src/glw/README                     \
394         $(DIRECTORY)/src/glw/glw.pc.in                  \
395         $(DIRECTORY)/src/glw/depend
396
397 GLUT_FILES = \
398         $(DIRECTORY)/include/GL/glut.h                  \
399         $(DIRECTORY)/include/GL/glutf90.h               \
400         $(DIRECTORY)/src/glut/glx/Makefile*             \
401         $(DIRECTORY)/src/glut/glx/depend                \
402         $(DIRECTORY)/src/glut/glx/glut.pc.in            \
403         $(DIRECTORY)/src/glut/glx/*def                  \
404         $(DIRECTORY)/src/glut/glx/*.[ch]                \
405         $(DIRECTORY)/src/glut/beos/*.[ch]               \
406         $(DIRECTORY)/src/glut/beos/*.cpp                \
407         $(DIRECTORY)/src/glut/beos/Makefile
408
409 DEPEND_FILES = \
410         $(TOP)/src/mesa/depend          \
411         $(TOP)/src/glx/depend           \
412         $(TOP)/src/glw/depend           \
413         $(TOP)/src/glut/glx/depend      \
414         $(TOP)/src/glu/sgi/depend
415
416
417 LIB_FILES = \
418         $(MAIN_FILES)           \
419         $(MAPI_FILES)           \
420         $(ES_FILES)             \
421         $(EGL_FILES)            \
422         $(GALLIUM_FILES)        \
423         $(DRI_FILES)            \
424         $(SGI_GLU_FILES)        \
425         $(GLW_FILES)
426
427
428 # Everything for new a Mesa release:
429 tarballs: rm_depend configure aclocal.m4 lib_gz glut_gz \
430         lib_bz2 glut_bz2 lib_zip glut_zip md5
431
432
433 # Helper for autoconf builds
434 ACLOCAL = aclocal
435 ACLOCAL_FLAGS =
436 AUTOCONF = autoconf
437 AC_FLAGS =
438 aclocal.m4: configure.ac acinclude.m4
439         $(ACLOCAL) $(ACLOCAL_FLAGS)
440 configure: configure.ac aclocal.m4 acinclude.m4
441         $(AUTOCONF) $(AC_FLAGS)
442
443 rm_depend:
444         @for dep in $(DEPEND_FILES) ; do \
445                 rm -f $$dep ; \
446                 touch $$dep ; \
447         done
448
449 rm_config:
450         rm -f configs/current
451         rm -f configs/autoconf
452
453 lib_gz: rm_config
454         cd .. ; \
455         tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
456         gzip $(LIB_NAME).tar ; \
457         mv $(LIB_NAME).tar.gz $(DIRECTORY)
458
459 glut_gz:
460         cd .. ; \
461         tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
462         gzip $(GLUT_NAME).tar ; \
463         mv $(GLUT_NAME).tar.gz $(DIRECTORY)
464
465 lib_bz2: rm_config
466         cd .. ; \
467         tar -cf $(LIB_NAME).tar $(LIB_FILES) ; \
468         bzip2 $(LIB_NAME).tar ; \
469         mv $(LIB_NAME).tar.bz2 $(DIRECTORY)
470
471 glut_bz2:
472         cd .. ; \
473         tar -cf $(GLUT_NAME).tar $(GLUT_FILES) ; \
474         bzip2 $(GLUT_NAME).tar ; \
475         mv $(GLUT_NAME).tar.bz2 $(DIRECTORY)
476
477 lib_zip: rm_config
478         rm -f $(LIB_NAME).zip ; \
479         cd .. ; \
480         zip -qr $(LIB_NAME).zip $(LIB_FILES) ; \
481         mv $(LIB_NAME).zip $(DIRECTORY)
482
483 glut_zip:
484         rm -f $(GLUT_NAME).zip ; \
485         cd .. ; \
486         zip -qr $(GLUT_NAME).zip $(GLUT_FILES) ; \
487         mv $(GLUT_NAME).zip $(DIRECTORY)
488
489 md5:
490         @-md5sum $(LIB_NAME).tar.gz
491         @-md5sum $(LIB_NAME).tar.bz2
492         @-md5sum $(LIB_NAME).zip
493         @-md5sum $(GLUT_NAME).tar.gz
494         @-md5sum $(GLUT_NAME).tar.bz2
495         @-md5sum $(GLUT_NAME).zip
496
497 .PHONY: tarballs rm_depend rm_config md5 \
498         lib_gz glut_gz \
499         lib_bz2 glut_bz2 \
500         lib_zip glut_zip