i965: don't emit state when dri_bufmgr_check_aperture_space fails.
[mesa.git] / src / mesa / Makefile
1 # src/mesa/Makefile
2
3 TOP = ../..
4 include $(TOP)/configs/current
5
6 include sources
7
8
9 .SUFFIXES : .cpp
10
11 .c.o:
12 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
13
14 .cpp.o:
15 $(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@
16
17 .S.o:
18 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
19
20
21
22 # Default: build dependencies, then asm_subdirs, then convenience
23 # libs (.a) and finally the device drivers:
24 default: depend asm_subdirs libmesa.a libglapi.a driver_subdirs
25
26
27
28 ######################################################################
29 # Helper libraries used by many drivers:
30
31 # Make archive of core mesa object files
32 libmesa.a: $(MESA_OBJECTS)
33 @ $(MKLIB) -o mesa -static $(MESA_OBJECTS)
34
35 # Make archive of gl* API dispatcher functions only
36 libglapi.a: $(GLAPI_OBJECTS)
37 @ $(MKLIB) -o glapi -static $(GLAPI_OBJECTS)
38
39
40 ######################################################################
41 # Device drivers
42 driver_subdirs: libmesa.a libglapi.a
43 (cd drivers && $(MAKE))
44
45
46 ######################################################################
47 # Assembly subdirs
48 asm_subdirs:
49 @ if echo "$(ASM_FLAGS)" | grep -q USE_X86_ASM ; then \
50 (cd x86 && $(MAKE)) || exit 1 ; \
51 fi
52 @ if echo "$(ASM_FLAGS)" | grep -q USE_X86_64_ASM ; then \
53 (cd x86 && $(MAKE)) || exit 1 ; \
54 (cd x86-64 && $(MAKE)) || exit 1 ; \
55 fi
56
57
58 ######################################################################
59 # Dependency generation
60
61 depend: $(ALL_SOURCES)
62 @ echo "running $(MKDEP)"
63 @ touch depend
64 @$(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(ALL_SOURCES) \
65 > /dev/null 2>/dev/null
66
67
68 ######################################################################
69 # Installation rules
70
71 # this isn't fleshed out yet but is probably the way to go in the future
72 new_install:
73 (cd drivers && $(MAKE) install)
74
75
76 # XXX replace this with new_install above someday
77 install: default
78 @for driver in $(DRIVER_DIRS) ; do \
79 case "$$driver" in \
80 osmesa) if [ "$(DRIVER_DIRS)" = osmesa ]; then \
81 $(MAKE) install-headers install-osmesa || exit 1 ; \
82 else \
83 $(MAKE) install-osmesa || exit 1 ; \
84 fi ;; \
85 dri) $(MAKE) install-libgl install-dri || exit 1 ;; \
86 *) $(MAKE) install-libgl || exit 1 ;; \
87 esac ; \
88 done
89
90
91 pcedit = sed \
92 -e 's,@INSTALL_DIR@,$(INSTALL_DIR),' \
93 -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
94 -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
95 -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),'
96
97 gl.pc: gl.pc.in
98 $(pcedit) $< > $@
99
100 install-headers:
101 $(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL
102 $(INSTALL) -m 644 $(TOP)/include/GL/*.h \
103 $(DESTDIR)$(INSTALL_INC_DIR)/GL
104
105 install-libgl: default gl.pc install-headers
106 $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
107 $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
108 $(INSTALL) $(TOP)/$(LIB_DIR)/$(GL_LIB_GLOB) \
109 $(DESTDIR)$(INSTALL_LIB_DIR)
110 $(INSTALL) -m 644 gl.pc $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
111
112 install-osmesa: default
113 $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
114 $(INSTALL) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_GLOB) \
115 $(DESTDIR)$(INSTALL_LIB_DIR)
116
117 install-dri: default
118 cd drivers/dri && $(MAKE) install
119
120
121
122 # Emacs tags
123 tags:
124 etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h
125
126
127 clean:
128 -rm -f */*.o
129 -rm -f */*/*.o
130 -rm -f depend depend.bak libmesa.a libglapi.a
131 -rm -f drivers/*/*.o
132 -rm -f *.pc
133 -@cd drivers/dri && $(MAKE) clean
134 -@cd drivers/x11 && $(MAKE) clean
135 -@cd drivers/osmesa && $(MAKE) clean
136 -@cd x86 && $(MAKE) clean
137 -@cd x86-64 && $(MAKE) clean
138
139
140 -include depend