1 # src/gallium/targets/libgl-xlib/Makefile 2 3 # This makefile produces a "stand-alone" libGL.so which is based on 4 # Xlib (no DRI HW acceleration) 5 6 7 TOP = ../../../.. 8 include $(TOP)/configs/current 9 10 11 GL_MAJOR = 1 12 GL_MINOR = 5 13 GL_TINY = 0$(MESA_MAJOR)$(MESA_MINOR)0$(MESA_TINY) 14 15 16 INCLUDE_DIRS = \ 17 -I$(TOP)/include \ 18 -I$(TOP)/src/mapi \ 19 -I$(TOP)/src/mesa \ 20 -I$(TOP)/src/mesa/main \ 21 -I$(TOP)/src/gallium/include \ 22 -I$(TOP)/src/gallium/drivers \ 23 -I$(TOP)/src/gallium/state_trackers/glx/xlib \ 24 -I$(TOP)/src/gallium/auxiliary \ 25 $(X11_CFLAGS) 26 27 DEFINES += \ 28 -DGALLIUM_SOFTPIPE \ 29 -DGALLIUM_RBUG \ 30 -DGALLIUM_TRACE \ 31 -DGALLIUM_GALAHAD 32 33 XLIB_TARGET_SOURCES = \ 34 xlib.c 35 36 37 XLIB_TARGET_OBJECTS = $(XLIB_TARGET_SOURCES:.c=.o) 38 39 40 41 LIBS = \ 42 $(GALLIUM_DRIVERS) \ 43 $(TOP)/src/gallium/state_trackers/glx/xlib/libxlib.a \ 44 $(TOP)/src/gallium/winsys/sw/xlib/libws_xlib.a \ 45 $(TOP)/src/gallium/drivers/trace/libtrace.a \ 46 $(TOP)/src/gallium/drivers/rbug/librbug.a \ 47 $(TOP)/src/gallium/drivers/galahad/libgalahad.a \ 48 $(TOP)/src/mapi/glapi/libglapi.a \ 49 $(TOP)/src/mesa/libmesagallium.a \ 50 $(GALLIUM_AUXILIARIES) \ 51 52 53 # LLVM 54 ifeq ($(MESA_LLVM),1) 55 PIPE_DRIVERS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a 56 DEFINES += -DGALLIUM_LLVMPIPE 57 GL_LIB_DEPS += $(LLVM_LIBS) 58 LDFLAGS += $(LLVM_LDFLAGS) 59 endif 60 61 ifeq ($(SHARED_GLAPI),1) 62 GL_LIB_DEPS := -L$(TOP)/$(LIB_DIR) -l$(GLAPI_LIB) $(GL_LIB_DEPS) 63 endif 64 65 66 .SUFFIXES : .cpp 67 68 .c.o: 69 $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@ 70 71 .cpp.o: 72 $(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@ 73 74 75 76 default: $(TOP)/$(LIB_DIR)/gallium $(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME) 77 78 $(TOP)/$(LIB_DIR)/gallium: 79 @ mkdir -p $(TOP)/$(LIB_DIR)/gallium 80 81 # Make the libGL.so library 82 $(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME): $(XLIB_TARGET_OBJECTS) $(LIBS) Makefile 83 $(TOP)/bin/mklib -o $(GL_LIB) \ 84 -linker "$(CXX)" -ldflags '$(LDFLAGS)' \ 85 -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \ 86 -cplusplus \ 87 -install $(TOP)/$(LIB_DIR)/gallium \ 88 $(MKLIB_OPTIONS) $(XLIB_TARGET_OBJECTS) \ 89 -Wl,--start-group $(LIBS) -Wl,--end-group $(GL_LIB_DEPS) 90 91 92 depend: $(XLIB_TARGET_SOURCES) 93 @ echo "running $(MKDEP)" 94 @ rm -f depend # workaround oops on gutsy?!? 95 @ touch depend 96 $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(XLIB_TARGET_SOURCES) \ 97 > /dev/null 2>/dev/null 98 99 100 install: default 101 $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL 102 $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR) 103 $(INSTALL) -m 644 $(TOP)/include/GL/*.h $(DESTDIR)$(INSTALL_DIR)/include/GL 104 @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \ 105 $(MINSTALL) $(TOP)/$(LIB_DIR)/libGL* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR); \ 106 fi 107 108 109 # Emacs tags 110 tags: 111 etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h 112 113 clean: 114 -rm -f *.o depend 115 116 117 include depend 118