blob: 9dde96ee21f3520b9b8cbd554e15431c8a78818e [file] [log] [blame]
Brian Paulde0ee312004-03-26 15:19:11 +00001# src/mesa/Makefile
2
3TOP = ../..
4include $(TOP)/configs/current
5
6include sources
7
8
9GL_MAJOR = 1
10GL_MINOR = 5
11GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY)
12
13
Brianfb206802007-08-01 12:58:38 -060014SOFTPIPE_LIB = $(TOP)/src/mesa/pipe/softpipe/libsoftpipe.a
15
Michal Krola885c7a2005-01-18 14:16:51 +000016.SUFFIXES : .cpp
Brian Paul7443c2c2005-01-17 22:33:50 +000017
Brian Paulde0ee312004-03-26 15:19:11 +000018.c.o:
19 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
20
Michal Krola885c7a2005-01-18 14:16:51 +000021.cpp.o:
Brian Paul7443c2c2005-01-17 22:33:50 +000022 $(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@
23
Brian Paulde0ee312004-03-26 15:19:11 +000024.S.o:
25 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
26
27
28# Figure out what to make here
29default:
30 @if [ "${DRIVER_DIRS}" = "dri" ] ; then \
Eric Anholt2fb5d152004-06-01 00:06:14 +000031 $(MAKE) linux-solo ; \
Brian Paulde0ee312004-03-26 15:19:11 +000032 elif [ "${DRIVER_DIRS}" = "osmesa" ] ; then \
Eric Anholt2fb5d152004-06-01 00:06:14 +000033 $(MAKE) osmesa-only ; \
Philippe Houdoin31848302004-08-14 09:23:09 +000034 elif [ "$(DRIVER_DIRS)" = "beos" ]; then \
35 $(MAKE) beos ; \
Brian Paulbdbdab82005-01-04 14:19:25 +000036 elif [ "$(DRIVER_DIRS)" = "directfb" ]; then \
Brian Paul92c43b12006-08-18 20:20:28 +000037 $(MAKE) directfb ; \
Sean D'Epagnier10cbd082006-11-30 03:25:28 +000038 elif [ "$(DRIVER_DIRS)" = "fbdev osmesa" ]; then \
39 $(MAKE) fbdev ; $(MAKE) osmesa-only ; \
Brian Paulde0ee312004-03-26 15:19:11 +000040 else \
Eric Anholt2fb5d152004-06-01 00:06:14 +000041 $(MAKE) stand-alone ; \
Brian Paulde0ee312004-03-26 15:19:11 +000042 fi
43
Brian Paul26c7e652005-09-10 16:41:17 +000044
Brian Paul26c7e652005-09-10 16:41:17 +000045######################################################################
Philippe Houdoin31848302004-08-14 09:23:09 +000046# BeOS driver target
Brian Paul26c7e652005-09-10 16:41:17 +000047
Brian Paul158a2aa2005-09-06 03:02:01 +000048beos: depend subdirs libmesa.a
Philippe Houdoin31848302004-08-14 09:23:09 +000049 cd drivers/beos; $(MAKE)
Brian Paul7e27ab42004-08-16 17:11:10 +000050
51
Brian Paulde0ee312004-03-26 15:19:11 +000052######################################################################
Brian Paul26c7e652005-09-10 16:41:17 +000053# Linux DRI drivers
Brian Paulde0ee312004-03-26 15:19:11 +000054
55# Make archive of core object files
Brian Paul158a2aa2005-09-06 03:02:01 +000056libmesa.a: $(SOLO_OBJECTS)
Brian Paul158a2aa2005-09-06 03:02:01 +000057 @ $(TOP)/bin/mklib -o mesa -static $(SOLO_OBJECTS);
Philippe Houdoin31848302004-08-14 09:23:09 +000058 @if [ "${CONFIG_NAME}" = "beos" ] ; then \
59 mimeset -f "$@" ; \
60 fi
Brian Paulde0ee312004-03-26 15:19:11 +000061
Dave Airlie654286e2005-09-11 03:58:29 +000062linux-solo: depend subdirs libmesa.a
Eric Anholt2fb5d152004-06-01 00:06:14 +000063 cd drivers/dri ; $(MAKE)
Brian Paulde0ee312004-03-26 15:19:11 +000064
65
Brian Paulbdbdab82005-01-04 14:19:25 +000066#####################################################################
67# Stand-alone Mesa libGL, no built-in drivers (DirectFB)
68
Brian Paul26c7e652005-09-10 16:41:17 +000069libgl-core: $(CORE_OBJECTS)
Ian Romanicka08d8a02005-07-26 05:55:56 +000070 @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
Brian Paulbdbdab82005-01-04 14:19:25 +000071 -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
Brian Paul92c43b12006-08-18 20:20:28 +000072 -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(CORE_OBJECTS) \
73 $(GL_LIB_DEPS)
Brian Paulbdbdab82005-01-04 14:19:25 +000074
Brian Paulbdbdab82005-01-04 14:19:25 +000075directfb: depend subdirs libgl-core
Brian Paul92c43b12006-08-18 20:20:28 +000076 cd drivers/directfb ; $(MAKE)
77
78
79#####################################################################
80# fbdev Mesa driver (libGL.so)
81
Brian Paulb20814f2006-08-21 15:50:41 +000082fbdev: $(CORE_OBJECTS) $(FBDEV_DRIVER_OBJECTS) $(COMMON_DRIVER_OBJECTS)
Brian Paul92c43b12006-08-18 20:20:28 +000083 @ $(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) \
Brian Paulb20814f2006-08-21 15:50:41 +000086 $(CORE_OBJECTS) $(FBDEV_DRIVER_OBJECTS) \
87 $(COMMON_DRIVER_OBJECTS) $(GL_LIB_DEPS)
Brian Paulbdbdab82005-01-04 14:19:25 +000088
Brian Paul6423ec92006-08-21 16:05:30 +000089
Brian Paulde0ee312004-03-26 15:19:11 +000090######################################################################
91# Stand-alone Mesa libGL and libOSMesa
Sean D'Epagnierc6fc8232006-08-19 00:28:36 +000092STAND_ALONE_DRIVER_SOURCES = \
Brian Paulde0ee312004-03-26 15:19:11 +000093 $(COMMON_DRIVER_SOURCES) \
Briana4b2b882007-04-17 16:00:17 -060094 $(X11_DRIVER_SOURCES)
Sean D'Epagnier7e4152f2006-08-18 10:38:15 +000095
Brian Paulde0ee312004-03-26 15:19:11 +000096STAND_ALONE_DRIVER_OBJECTS = $(STAND_ALONE_DRIVER_SOURCES:.c=.o)
97
98STAND_ALONE_OBJECTS = \
99 $(CORE_OBJECTS) \
Brian Paulde0ee312004-03-26 15:19:11 +0000100 $(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).
104OSMESA16_OBJECTS = \
105 $(CORE_OBJECTS) \
Brian Paulde0ee312004-03-26 15:19:11 +0000106 $(COMMON_DRIVER_OBJECTS) \
107 $(OSMESA_DRIVER_OBJECTS)
108
109
Brian Paul883f9892006-07-13 02:50:27 +0000110stand-alone: depend subdirs $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)
Brian Paulde0ee312004-03-26 15:19:11 +0000111
Brian Paul883f9892006-07-13 02:50:27 +0000112osmesa-only: depend subdirs $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)
Brian Paulde0ee312004-03-26 15:19:11 +0000113
Brian Paulde0ee312004-03-26 15:19:11 +0000114# Make the GL library
Brianfb206802007-08-01 12:58:38 -0600115$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(STAND_ALONE_OBJECTS) $(SOFTPIPE_LIB)
Ian Romanicka08d8a02005-07-26 05:55:56 +0000116 @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \
Brian Paul11a0a992004-11-27 04:37:25 +0000117 -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \
Brian Paul883f9892006-07-13 02:50:27 +0000118 -install $(TOP)/$(LIB_DIR) \
Brianfb206802007-08-01 12:58:38 -0600119 $(MKLIB_OPTIONS) $(GL_LIB_DEPS) $(STAND_ALONE_OBJECTS) \
120 $(SOFTPIPE_LIB)
Brian Paulde0ee312004-03-26 15:19:11 +0000121
122# Make the OSMesa library
Brian Paul883f9892006-07-13 02:50:27 +0000123$(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OSMESA_DRIVER_OBJECTS) $(OSMESA16_OBJECTS)
Brian Paul11a0a992004-11-27 04:37:25 +0000124 @ if [ "${DRIVER_DIRS}" = "osmesa" ] ; then \
Ian Romanicka08d8a02005-07-26 05:55:56 +0000125 $(TOP)/bin/mklib -o $(OSMESA_LIB) -linker '$(CC)' \
Brian Paul11a0a992004-11-27 04:37:25 +0000126 -major $(MESA_MAJOR) \
Brian Paulde0ee312004-03-26 15:19:11 +0000127 -minor $(MESA_MINOR) -patch $(MESA_TINY) \
Brian Paul883f9892006-07-13 02:50:27 +0000128 -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
Brian Paulde0ee312004-03-26 15:19:11 +0000129 $(OSMESA_LIB_DEPS) $(OSMESA16_OBJECTS) ; \
130 else \
Ian Romanicka08d8a02005-07-26 05:55:56 +0000131 $(TOP)/bin/mklib -o $(OSMESA_LIB) -linker '$(CC)' \
Brian Paul11a0a992004-11-27 04:37:25 +0000132 -major $(MESA_MAJOR) \
Brian Paulde0ee312004-03-26 15:19:11 +0000133 -minor $(MESA_MINOR) -patch $(GL_TINY) \
Brian Paul883f9892006-07-13 02:50:27 +0000134 -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
Brian Paulde0ee312004-03-26 15:19:11 +0000135 $(OSMESA_LIB_DEPS) $(OSMESA_DRIVER_OBJECTS) ; \
136 fi
137
138
139######################################################################
Brian Paulde0ee312004-03-26 15:19:11 +0000140# Generic stuff
141
Brian Paulde0ee312004-03-26 15:19:11 +0000142depend: $(ALL_SOURCES)
Brian Paul11a0a992004-11-27 04:37:25 +0000143 @ echo "running $(MKDEP)"
Keith Whitwell389b1d12007-08-03 12:28:03 +0100144 @ rm -f depend # workaround oops on gutsy?!?
Brian Paul11a0a992004-11-27 04:37:25 +0000145 @ touch depend
Keith Whitwell389b1d12007-08-03 12:28:03 +0100146 @ $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(ALL_SOURCES) \
Keith Whitwell99efde42006-10-30 16:44:13 +0000147 > /dev/null 2>/dev/null
Brian Paulde0ee312004-03-26 15:19:11 +0000148
149
Brian Paul26c7e652005-09-10 16:41:17 +0000150subdirs:
151 @ (cd x86 ; $(MAKE))
152 @ (cd x86-64 ; $(MAKE))
Keith Whitwelldbb297f2007-08-08 11:10:37 +0100153 (cd pipe ; $(MAKE))
Brian Paul26c7e652005-09-10 16:41:17 +0000154
155install: default
Brian Paul0e794a12006-06-22 22:50:48 +0000156 $(INSTALL) -d $(INSTALL_DIR)/include/GL
Brian Paul883f9892006-07-13 02:50:27 +0000157 $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR)
Brian Paul0e794a12006-06-22 22:50:48 +0000158 $(INSTALL) -m 644 $(TOP)/include/GL/*.h $(INSTALL_DIR)/include/GL
Brian Paula20c0f22006-10-15 16:38:09 +0000159 @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \
Brian Paul464fcd02006-10-19 20:09:05 +0000160 $(INSTALL) $(TOP)/$(LIB_DIR)/libGL* $(INSTALL_DIR)/$(LIB_DIR); \
Brian Paula20c0f22006-10-15 16:38:09 +0000161 fi
162 @if [ -e $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) ]; then \
Brian Paul464fcd02006-10-19 20:09:05 +0000163 $(INSTALL) $(TOP)/$(LIB_DIR)/libOSMesa* $(INSTALL_DIR)/$(LIB_DIR); \
Brian Paula20c0f22006-10-15 16:38:09 +0000164 fi
Brian Paul26c7e652005-09-10 16:41:17 +0000165 @if [ "${DRIVER_DIRS}" = "dri" ] ; then \
166 cd drivers/dri ; $(MAKE) install ; \
167 fi
168
Brian Paulfee08572006-10-18 22:05:13 +0000169## NOT INSTALLED YET:
170## $(INSTALL) -d $(INSTALL_DIR)/include/GLES
171## $(INSTALL) -m 644 include/GLES/*.h $(INSTALL_DIR)/include/GLES
Brian Paul0e794a12006-06-22 22:50:48 +0000172
173
Brian Paulde0ee312004-03-26 15:19:11 +0000174# Emacs tags
175tags:
Brian Pauld2c10272004-11-26 16:23:22 +0000176 etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h
Brian Paulde0ee312004-03-26 15:19:11 +0000177
178clean:
179 -rm -f */*.o
Keith Whitwell81032032005-06-09 14:55:34 +0000180 -rm -f */*/*.o
Brian Paul158a2aa2005-09-06 03:02:01 +0000181 -rm -f depend depend.bak libmesa.a
Brian Paul7e27ab42004-08-16 17:11:10 +0000182 -rm -f drivers/*/*.o
Brian261ed742007-06-12 17:06:27 -0600183 (cd drivers/dri && $(MAKE) clean)
184 (cd x86 && $(MAKE) clean)
185 (cd x86-64 && $(MAKE) clean)
Keith Whitwelldbb297f2007-08-08 11:10:37 +0100186 (cd pipe ; $(MAKE) clean )
Brian Paulde0ee312004-03-26 15:19:11 +0000187
Brian Paul6423ec92006-08-21 16:05:30 +0000188
Brian Paulde0ee312004-03-26 15:19:11 +0000189include depend