mesa: added comments for signed 16-bit formats
[mesa.git] / src / mesa / Makefile
1 # src/mesa/Makefile
2
3 TOP = ../..
4 include $(TOP)/configs/current
5
6 include sources.mak
7
8 .SUFFIXES : .cpp
9
10 .c.o:
11 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
12
13 .cpp.o:
14 $(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@
15
16 .S.o:
17 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
18
19 CFLAGS += $(API_DEFINES)
20
21
22 # Default: build dependencies, then asm_subdirs, GLSL built-in lib,
23 # then convenience libs (.a) and finally the device drivers:
24 default: depend asm_subdirs glsl_builtin libmesa.a libmesagallium.a \
25 driver_subdirs
26
27 main/api_exec_es1.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py
28 $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES1.1 > $@
29
30 main/api_exec_es2.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py
31 $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.xml -V GLES2.0 > $@
32
33 main/get_es1.c: main/get_gen_es.py
34 $(PYTHON2) $(PYTHON_FLAGS) $< 1 > $@
35
36 main/get_es2.c: main/get_gen_es.py
37 $(PYTHON2) $(PYTHON_FLAGS) $< 2 > $@
38
39 ######################################################################
40 # Helper libraries used by many drivers:
41
42 # Make archive of core mesa object files
43 libmesa.a: $(MESA_OBJECTS) $(GLSL_LIBS)
44 @ $(MKLIB) -o mesa -static $(MESA_OBJECTS) $(GLSL_LIBS)
45
46 # Make archive of subset of core mesa object files for gallium
47 libmesagallium.a: $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS)
48 @ $(MKLIB) -o mesagallium -static $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS)
49
50 ######################################################################
51 # Device drivers
52 driver_subdirs: libmesa.a libmesagallium.a
53 @ (cd drivers && $(MAKE))
54
55
56 ######################################################################
57 # Assembly subdirs
58 asm_subdirs:
59 @ if echo "$(ASM_FLAGS)" | grep -q USE_X86_ASM ; then \
60 (cd x86 && $(MAKE)) || exit 1 ; \
61 fi
62 @ if echo "$(ASM_FLAGS)" | grep -q USE_X86_64_ASM ; then \
63 (cd x86 && $(MAKE)) || exit 1 ; \
64 (cd x86-64 && $(MAKE)) || exit 1 ; \
65 fi
66
67
68 ######################################################################
69 # GLSL built-in library
70 glsl_builtin:
71 (cd shader/slang/library && $(MAKE)) || exit 1 ;
72
73
74 ######################################################################
75 # Dependency generation
76
77 depend: $(ALL_SOURCES)
78 @ echo "running $(MKDEP)"
79 @ touch depend
80 @$(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(ALL_SOURCES) \
81 > /dev/null 2>/dev/null
82
83
84 ######################################################################
85 # Installation rules
86
87 # this isn't fleshed out yet but is probably the way to go in the future
88 new_install:
89 (cd drivers && $(MAKE) install)
90
91
92 # XXX replace this with new_install above someday
93 install: default
94 @for driver in $(DRIVER_DIRS) ; do \
95 case "$$driver" in \
96 osmesa) if [ "$(DRIVER_DIRS)" = osmesa ]; then \
97 $(MAKE) install-headers install-osmesa || exit 1 ; \
98 else \
99 $(MAKE) install-osmesa || exit 1 ; \
100 fi ;; \
101 dri) $(MAKE) install-libgl install-dri || exit 1 ;; \
102 *) $(MAKE) install-libgl || exit 1 ;; \
103 esac ; \
104 done
105
106 pcedit = \
107 -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
108 -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
109 -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
110 -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
111
112
113 gl_pcedit = sed \
114 $(pcedit) \
115 -e 's,@GL_PC_REQ_PRIV@,$(GL_PC_REQ_PRIV),' \
116 -e 's,@GL_PC_LIB_PRIV@,$(GL_PC_LIB_PRIV),' \
117 -e 's,@GL_PC_CFLAGS@,$(GL_PC_CFLAGS),' \
118 -e 's,@GL_LIB@,$(GL_LIB),'
119
120 gl.pc: gl.pc.in
121 $(gl_pcedit) $< > $@
122
123 osmesa_pcedit = sed \
124 $(pcedit) \
125 -e 's,@OSMESA_LIB@,$(OSMESA_LIB),' \
126 -e 's,@OSMESA_PC_REQ@,$(OSMESA_PC_REQ),' \
127 -e 's,@OSMESA_PC_LIB_PRIV@,$(OSMESA_PC_LIB_PRIV),'
128
129 osmesa.pc: osmesa.pc.in
130 $(osmesa_pcedit) $< > $@
131
132 install-headers:
133 $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL
134 $(INSTALL) -m 644 $(TOP)/include/GL/*.h \
135 $(DESTDIR)$(INSTALL_INC_DIR)/GL
136
137 install-libgl: default gl.pc install-headers
138 $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
139 $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
140 $(MINSTALL) $(TOP)/$(LIB_DIR)/$(GL_LIB_GLOB) \
141 $(DESTDIR)$(INSTALL_LIB_DIR)
142 $(INSTALL) -m 644 gl.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
143
144 install-osmesa: default osmesa.pc
145 $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
146 $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
147 $(MINSTALL) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_GLOB) \
148 $(DESTDIR)$(INSTALL_LIB_DIR)
149 $(INSTALL) -m 644 osmesa.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
150
151 install-dri: default
152 cd drivers/dri && $(MAKE) install
153
154
155
156 # Emacs tags
157 tags:
158 etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h
159
160
161 clean:
162 -rm -f */*.o
163 -rm -f */*/*.o
164 -rm -f depend depend.bak libmesa.a libmesagallium.a
165 -rm -f drivers/*/*.o
166 -rm -f *.pc
167 -rm -f shader/slang/library/*_gc.h
168 -@cd drivers/dri && $(MAKE) clean
169 -@cd drivers/x11 && $(MAKE) clean
170 -@cd drivers/osmesa && $(MAKE) clean
171 -@cd x86 && $(MAKE) clean
172 -@cd x86-64 && $(MAKE) clean
173
174
175 -include depend