Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 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 | |
Brian | fb20680 | 2007-08-01 12:58:38 -0600 | [diff] [blame] | 14 | SOFTPIPE_LIB = $(TOP)/src/mesa/pipe/softpipe/libsoftpipe.a |
| 15 | |
Michal Krol | a885c7a | 2005-01-18 14:16:51 +0000 | [diff] [blame] | 16 | .SUFFIXES : .cpp |
Brian Paul | 7443c2c | 2005-01-17 22:33:50 +0000 | [diff] [blame] | 17 | |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 18 | .c.o: |
| 19 | $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@ |
| 20 | |
Michal Krol | a885c7a | 2005-01-18 14:16:51 +0000 | [diff] [blame] | 21 | .cpp.o: |
Brian Paul | 7443c2c | 2005-01-17 22:33:50 +0000 | [diff] [blame] | 22 | $(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@ |
| 23 | |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 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 \ |
Eric Anholt | 2fb5d15 | 2004-06-01 00:06:14 +0000 | [diff] [blame] | 31 | $(MAKE) linux-solo ; \ |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 32 | elif [ "${DRIVER_DIRS}" = "osmesa" ] ; then \ |
Eric Anholt | 2fb5d15 | 2004-06-01 00:06:14 +0000 | [diff] [blame] | 33 | $(MAKE) osmesa-only ; \ |
Philippe Houdoin | 3184830 | 2004-08-14 09:23:09 +0000 | [diff] [blame] | 34 | elif [ "$(DRIVER_DIRS)" = "beos" ]; then \ |
| 35 | $(MAKE) beos ; \ |
Brian Paul | bdbdab8 | 2005-01-04 14:19:25 +0000 | [diff] [blame] | 36 | elif [ "$(DRIVER_DIRS)" = "directfb" ]; then \ |
Brian Paul | 92c43b1 | 2006-08-18 20:20:28 +0000 | [diff] [blame] | 37 | $(MAKE) directfb ; \ |
Sean D'Epagnier | 10cbd08 | 2006-11-30 03:25:28 +0000 | [diff] [blame] | 38 | elif [ "$(DRIVER_DIRS)" = "fbdev osmesa" ]; then \ |
| 39 | $(MAKE) fbdev ; $(MAKE) osmesa-only ; \ |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 40 | else \ |
Eric Anholt | 2fb5d15 | 2004-06-01 00:06:14 +0000 | [diff] [blame] | 41 | $(MAKE) stand-alone ; \ |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 42 | fi |
| 43 | |
Brian Paul | 26c7e65 | 2005-09-10 16:41:17 +0000 | [diff] [blame] | 44 | |
Brian Paul | 26c7e65 | 2005-09-10 16:41:17 +0000 | [diff] [blame] | 45 | ###################################################################### |
Philippe Houdoin | 3184830 | 2004-08-14 09:23:09 +0000 | [diff] [blame] | 46 | # BeOS driver target |
Brian Paul | 26c7e65 | 2005-09-10 16:41:17 +0000 | [diff] [blame] | 47 | |
Brian Paul | 158a2aa | 2005-09-06 03:02:01 +0000 | [diff] [blame] | 48 | beos: depend subdirs libmesa.a |
Philippe Houdoin | 3184830 | 2004-08-14 09:23:09 +0000 | [diff] [blame] | 49 | cd drivers/beos; $(MAKE) |
Brian Paul | 7e27ab4 | 2004-08-16 17:11:10 +0000 | [diff] [blame] | 50 | |
| 51 | |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 52 | ###################################################################### |
Brian Paul | 26c7e65 | 2005-09-10 16:41:17 +0000 | [diff] [blame] | 53 | # Linux DRI drivers |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 54 | |
| 55 | # Make archive of core object files |
Brian Paul | 158a2aa | 2005-09-06 03:02:01 +0000 | [diff] [blame] | 56 | libmesa.a: $(SOLO_OBJECTS) |
Brian Paul | 158a2aa | 2005-09-06 03:02:01 +0000 | [diff] [blame] | 57 | @ $(TOP)/bin/mklib -o mesa -static $(SOLO_OBJECTS); |
Philippe Houdoin | 3184830 | 2004-08-14 09:23:09 +0000 | [diff] [blame] | 58 | @if [ "${CONFIG_NAME}" = "beos" ] ; then \ |
| 59 | mimeset -f "$@" ; \ |
| 60 | fi |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 61 | |
Dave Airlie | 654286e | 2005-09-11 03:58:29 +0000 | [diff] [blame] | 62 | linux-solo: depend subdirs libmesa.a |
Eric Anholt | 2fb5d15 | 2004-06-01 00:06:14 +0000 | [diff] [blame] | 63 | cd drivers/dri ; $(MAKE) |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 64 | |
| 65 | |
Brian Paul | bdbdab8 | 2005-01-04 14:19:25 +0000 | [diff] [blame] | 66 | ##################################################################### |
| 67 | # Stand-alone Mesa libGL, no built-in drivers (DirectFB) |
| 68 | |
Brian Paul | 26c7e65 | 2005-09-10 16:41:17 +0000 | [diff] [blame] | 69 | libgl-core: $(CORE_OBJECTS) |
Ian Romanick | a08d8a0 | 2005-07-26 05:55:56 +0000 | [diff] [blame] | 70 | @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \ |
Brian Paul | bdbdab8 | 2005-01-04 14:19:25 +0000 | [diff] [blame] | 71 | -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ |
Brian Paul | 92c43b1 | 2006-08-18 20:20:28 +0000 | [diff] [blame] | 72 | -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(CORE_OBJECTS) \ |
| 73 | $(GL_LIB_DEPS) |
Brian Paul | bdbdab8 | 2005-01-04 14:19:25 +0000 | [diff] [blame] | 74 | |
Brian Paul | bdbdab8 | 2005-01-04 14:19:25 +0000 | [diff] [blame] | 75 | directfb: depend subdirs libgl-core |
Brian Paul | 92c43b1 | 2006-08-18 20:20:28 +0000 | [diff] [blame] | 76 | cd drivers/directfb ; $(MAKE) |
| 77 | |
| 78 | |
| 79 | ##################################################################### |
| 80 | # fbdev Mesa driver (libGL.so) |
| 81 | |
Brian Paul | b20814f | 2006-08-21 15:50:41 +0000 | [diff] [blame] | 82 | fbdev: $(CORE_OBJECTS) $(FBDEV_DRIVER_OBJECTS) $(COMMON_DRIVER_OBJECTS) |
Brian Paul | 92c43b1 | 2006-08-18 20:20:28 +0000 | [diff] [blame] | 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) \ |
Brian Paul | b20814f | 2006-08-21 15:50:41 +0000 | [diff] [blame] | 86 | $(CORE_OBJECTS) $(FBDEV_DRIVER_OBJECTS) \ |
| 87 | $(COMMON_DRIVER_OBJECTS) $(GL_LIB_DEPS) |
Brian Paul | bdbdab8 | 2005-01-04 14:19:25 +0000 | [diff] [blame] | 88 | |
Brian Paul | 6423ec9 | 2006-08-21 16:05:30 +0000 | [diff] [blame] | 89 | |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 90 | ###################################################################### |
| 91 | # Stand-alone Mesa libGL and libOSMesa |
Sean D'Epagnier | c6fc823 | 2006-08-19 00:28:36 +0000 | [diff] [blame] | 92 | STAND_ALONE_DRIVER_SOURCES = \ |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 93 | $(COMMON_DRIVER_SOURCES) \ |
Brian | a4b2b88 | 2007-04-17 16:00:17 -0600 | [diff] [blame] | 94 | $(X11_DRIVER_SOURCES) |
Sean D'Epagnier | 7e4152f | 2006-08-18 10:38:15 +0000 | [diff] [blame] | 95 | |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 96 | STAND_ALONE_DRIVER_OBJECTS = $(STAND_ALONE_DRIVER_SOURCES:.c=.o) |
| 97 | |
| 98 | STAND_ALONE_OBJECTS = \ |
| 99 | $(CORE_OBJECTS) \ |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 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) \ |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 106 | $(COMMON_DRIVER_OBJECTS) \ |
| 107 | $(OSMESA_DRIVER_OBJECTS) |
| 108 | |
| 109 | |
Brian Paul | 883f989 | 2006-07-13 02:50:27 +0000 | [diff] [blame] | 110 | stand-alone: depend subdirs $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 111 | |
Brian Paul | 883f989 | 2006-07-13 02:50:27 +0000 | [diff] [blame] | 112 | osmesa-only: depend subdirs $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 113 | |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 114 | # Make the GL library |
Brian | fb20680 | 2007-08-01 12:58:38 -0600 | [diff] [blame] | 115 | $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(STAND_ALONE_OBJECTS) $(SOFTPIPE_LIB) |
Ian Romanick | a08d8a0 | 2005-07-26 05:55:56 +0000 | [diff] [blame] | 116 | @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \ |
Brian Paul | 11a0a99 | 2004-11-27 04:37:25 +0000 | [diff] [blame] | 117 | -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \ |
Brian Paul | 883f989 | 2006-07-13 02:50:27 +0000 | [diff] [blame] | 118 | -install $(TOP)/$(LIB_DIR) \ |
Brian | fb20680 | 2007-08-01 12:58:38 -0600 | [diff] [blame] | 119 | $(MKLIB_OPTIONS) $(GL_LIB_DEPS) $(STAND_ALONE_OBJECTS) \ |
| 120 | $(SOFTPIPE_LIB) |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 121 | |
| 122 | # Make the OSMesa library |
Brian Paul | 883f989 | 2006-07-13 02:50:27 +0000 | [diff] [blame] | 123 | $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OSMESA_DRIVER_OBJECTS) $(OSMESA16_OBJECTS) |
Brian Paul | 11a0a99 | 2004-11-27 04:37:25 +0000 | [diff] [blame] | 124 | @ if [ "${DRIVER_DIRS}" = "osmesa" ] ; then \ |
Ian Romanick | a08d8a0 | 2005-07-26 05:55:56 +0000 | [diff] [blame] | 125 | $(TOP)/bin/mklib -o $(OSMESA_LIB) -linker '$(CC)' \ |
Brian Paul | 11a0a99 | 2004-11-27 04:37:25 +0000 | [diff] [blame] | 126 | -major $(MESA_MAJOR) \ |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 127 | -minor $(MESA_MINOR) -patch $(MESA_TINY) \ |
Brian Paul | 883f989 | 2006-07-13 02:50:27 +0000 | [diff] [blame] | 128 | -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 129 | $(OSMESA_LIB_DEPS) $(OSMESA16_OBJECTS) ; \ |
| 130 | else \ |
Ian Romanick | a08d8a0 | 2005-07-26 05:55:56 +0000 | [diff] [blame] | 131 | $(TOP)/bin/mklib -o $(OSMESA_LIB) -linker '$(CC)' \ |
Brian Paul | 11a0a99 | 2004-11-27 04:37:25 +0000 | [diff] [blame] | 132 | -major $(MESA_MAJOR) \ |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 133 | -minor $(MESA_MINOR) -patch $(GL_TINY) \ |
Brian Paul | 883f989 | 2006-07-13 02:50:27 +0000 | [diff] [blame] | 134 | -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 135 | $(OSMESA_LIB_DEPS) $(OSMESA_DRIVER_OBJECTS) ; \ |
| 136 | fi |
| 137 | |
| 138 | |
| 139 | ###################################################################### |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 140 | # Generic stuff |
| 141 | |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 142 | depend: $(ALL_SOURCES) |
Brian Paul | 11a0a99 | 2004-11-27 04:37:25 +0000 | [diff] [blame] | 143 | @ echo "running $(MKDEP)" |
Keith Whitwell | 389b1d1 | 2007-08-03 12:28:03 +0100 | [diff] [blame^] | 144 | @ rm -f depend # workaround oops on gutsy?!? |
Brian Paul | 11a0a99 | 2004-11-27 04:37:25 +0000 | [diff] [blame] | 145 | @ touch depend |
Keith Whitwell | 389b1d1 | 2007-08-03 12:28:03 +0100 | [diff] [blame^] | 146 | @ $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(ALL_SOURCES) \ |
Keith Whitwell | 99efde4 | 2006-10-30 16:44:13 +0000 | [diff] [blame] | 147 | > /dev/null 2>/dev/null |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 148 | |
| 149 | |
Brian Paul | 26c7e65 | 2005-09-10 16:41:17 +0000 | [diff] [blame] | 150 | subdirs: |
| 151 | @ (cd x86 ; $(MAKE)) |
| 152 | @ (cd x86-64 ; $(MAKE)) |
Keith Whitwell | d878bdc | 2007-08-02 20:33:58 +0100 | [diff] [blame] | 153 | (cd pipe/softpipe ; $(MAKE)) |
Brian Paul | 26c7e65 | 2005-09-10 16:41:17 +0000 | [diff] [blame] | 154 | |
| 155 | install: default |
Brian Paul | 0e794a1 | 2006-06-22 22:50:48 +0000 | [diff] [blame] | 156 | $(INSTALL) -d $(INSTALL_DIR)/include/GL |
Brian Paul | 883f989 | 2006-07-13 02:50:27 +0000 | [diff] [blame] | 157 | $(INSTALL) -d $(INSTALL_DIR)/$(LIB_DIR) |
Brian Paul | 0e794a1 | 2006-06-22 22:50:48 +0000 | [diff] [blame] | 158 | $(INSTALL) -m 644 $(TOP)/include/GL/*.h $(INSTALL_DIR)/include/GL |
Brian Paul | a20c0f2 | 2006-10-15 16:38:09 +0000 | [diff] [blame] | 159 | @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \ |
Brian Paul | 464fcd0 | 2006-10-19 20:09:05 +0000 | [diff] [blame] | 160 | $(INSTALL) $(TOP)/$(LIB_DIR)/libGL* $(INSTALL_DIR)/$(LIB_DIR); \ |
Brian Paul | a20c0f2 | 2006-10-15 16:38:09 +0000 | [diff] [blame] | 161 | fi |
| 162 | @if [ -e $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) ]; then \ |
Brian Paul | 464fcd0 | 2006-10-19 20:09:05 +0000 | [diff] [blame] | 163 | $(INSTALL) $(TOP)/$(LIB_DIR)/libOSMesa* $(INSTALL_DIR)/$(LIB_DIR); \ |
Brian Paul | a20c0f2 | 2006-10-15 16:38:09 +0000 | [diff] [blame] | 164 | fi |
Brian Paul | 26c7e65 | 2005-09-10 16:41:17 +0000 | [diff] [blame] | 165 | @if [ "${DRIVER_DIRS}" = "dri" ] ; then \ |
| 166 | cd drivers/dri ; $(MAKE) install ; \ |
| 167 | fi |
| 168 | |
Brian Paul | fee0857 | 2006-10-18 22:05:13 +0000 | [diff] [blame] | 169 | ## NOT INSTALLED YET: |
| 170 | ## $(INSTALL) -d $(INSTALL_DIR)/include/GLES |
| 171 | ## $(INSTALL) -m 644 include/GLES/*.h $(INSTALL_DIR)/include/GLES |
Brian Paul | 0e794a1 | 2006-06-22 22:50:48 +0000 | [diff] [blame] | 172 | |
| 173 | |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 174 | # Emacs tags |
| 175 | tags: |
Brian Paul | d2c1027 | 2004-11-26 16:23:22 +0000 | [diff] [blame] | 176 | etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 177 | |
| 178 | clean: |
| 179 | -rm -f */*.o |
Keith Whitwell | 8103203 | 2005-06-09 14:55:34 +0000 | [diff] [blame] | 180 | -rm -f */*/*.o |
Brian Paul | 158a2aa | 2005-09-06 03:02:01 +0000 | [diff] [blame] | 181 | -rm -f depend depend.bak libmesa.a |
Brian Paul | 7e27ab4 | 2004-08-16 17:11:10 +0000 | [diff] [blame] | 182 | -rm -f drivers/*/*.o |
Brian | 261ed74 | 2007-06-12 17:06:27 -0600 | [diff] [blame] | 183 | (cd drivers/dri && $(MAKE) clean) |
| 184 | (cd x86 && $(MAKE) clean) |
| 185 | (cd x86-64 && $(MAKE) clean) |
Keith Whitwell | d878bdc | 2007-08-02 20:33:58 +0100 | [diff] [blame] | 186 | (cd pipe/softpipe ; $(MAKE) clean ) |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 187 | |
Brian Paul | 6423ec9 | 2006-08-21 16:05:30 +0000 | [diff] [blame] | 188 | |
Brian Paul | de0ee31 | 2004-03-26 15:19:11 +0000 | [diff] [blame] | 189 | include depend |