Makefile revision c30656d8c24eafeb29276fa31503b30608239468
199f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell# src/gallium/targets/libgl-xlib/Makefile
299f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
399f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell# This makefile produces a "stand-alone" libGL.so which is based on
499f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell# Xlib (no DRI HW acceleration)
599f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
699f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
799f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith WhitwellTOP = ../../../..
899f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwellinclude $(TOP)/configs/current
999f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
1099f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
1199f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith WhitwellGL_MAJOR = 1
1299f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith WhitwellGL_MINOR = 5
13988b246c471c9c7ece1082682853e3744b702dd2Brian PaulGL_TINY = 0$(MESA_MAJOR)$(MESA_MINOR)0$(MESA_TINY)
1499f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
1599f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
1699f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith WhitwellINCLUDE_DIRS = \
1799f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	-I$(TOP)/include \
18296adbd545b8efd38c9ed508166b2de2764a444bChia-I Wu	-I$(TOP)/src/mapi \
1999f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	-I$(TOP)/src/mesa \
2099f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	-I$(TOP)/src/mesa/main \
2199f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	-I$(TOP)/src/gallium/include \
2299f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	-I$(TOP)/src/gallium/drivers \
2399f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	-I$(TOP)/src/gallium/state_trackers/glx/xlib \
244f8bf353bd7e896268e0eb445c61270a8823892aDan Nicholson	-I$(TOP)/src/gallium/auxiliary \
254e7a4bed372a6da4dde8926f3bc30c56e3fbe07bDan Nicholson	$(X11_CFLAGS)
2699f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
2799f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith WhitwellDEFINES += \
28f1de38b851d274b16e8b58669a110b0124e0f40bBrian Paul	-DGALLIUM_SOFTPIPE \
29c30656d8c24eafeb29276fa31503b30608239468Jakob Bornecrantz	-DGALLIUM_RBUG \
30c30656d8c24eafeb29276fa31503b30608239468Jakob Bornecrantz	-DGALLIUM_TRACE \
31f1de38b851d274b16e8b58669a110b0124e0f40bBrian Paul	-DGALLIUM_GALAHAD
3299f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell#-DGALLIUM_CELL will be defined by the config */
3399f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
3499f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith WhitwellXLIB_TARGET_SOURCES = \
3599f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	xlib.c
3699f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
3799f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
3899f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith WhitwellXLIB_TARGET_OBJECTS = $(XLIB_TARGET_SOURCES:.c=.o)
3999f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
4099f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
4199f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell# Note: CELL_SPU_LIB is only defined for cell configs
4299f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
4399f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith WhitwellLIBS = \
4499f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	$(GALLIUM_DRIVERS) \
4599f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	$(TOP)/src/gallium/state_trackers/glx/xlib/libxlib.a \
460d0220fedc7a8d490162f7385d19b2d0ab3fb8d9Jakob Bornecrantz	$(TOP)/src/gallium/winsys/sw/xlib/libws_xlib.a \
47999932bf1feed4cbf834b2c81510aab09dda56dcKeith Whitwell	$(TOP)/src/gallium/drivers/trace/libtrace.a \
4853cbb81576671d6d39e6a353e79ebda2c512d735Jakob Bornecrantz	$(TOP)/src/gallium/drivers/rbug/librbug.a \
49c30656d8c24eafeb29276fa31503b30608239468Jakob Bornecrantz	$(TOP)/src/gallium/drivers/galahad/libgalahad.a \
50296adbd545b8efd38c9ed508166b2de2764a444bChia-I Wu	$(TOP)/src/mapi/glapi/libglapi.a \
5199f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	$(TOP)/src/mesa/libmesagallium.a \
5299f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	$(GALLIUM_AUXILIARIES) \
5399f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	$(CELL_SPU_LIB) \
5499f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
5599f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
5628c790ab3118ee4c4171120cba2abf2ae3e84805Chia-I Wu# LLVM
5728c790ab3118ee4c4171120cba2abf2ae3e84805Chia-I Wuifeq ($(MESA_LLVM),1)
5828c790ab3118ee4c4171120cba2abf2ae3e84805Chia-I WuDEFINES += -DGALLIUM_LLVMPIPE
5928c790ab3118ee4c4171120cba2abf2ae3e84805Chia-I WuGL_LIB_DEPS += $(LLVM_LIBS) 
6028c790ab3118ee4c4171120cba2abf2ae3e84805Chia-I WuLDFLAGS += $(LLVM_LDFLAGS)
6128c790ab3118ee4c4171120cba2abf2ae3e84805Chia-I Wuendif
6228c790ab3118ee4c4171120cba2abf2ae3e84805Chia-I Wu
6328c790ab3118ee4c4171120cba2abf2ae3e84805Chia-I Wu
6499f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell.SUFFIXES : .cpp
6599f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
6699f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell.c.o:
6799f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
6899f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
6999f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell.cpp.o:
7099f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	$(CXX) -c $(INCLUDE_DIRS) $(CXXFLAGS) $< -o $@
7199f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
7299f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
7399f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
7499f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwelldefault: $(TOP)/$(LIB_DIR)/gallium $(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME)
7599f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
7699f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell$(TOP)/$(LIB_DIR)/gallium:
7799f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	@ mkdir -p $(TOP)/$(LIB_DIR)/gallium
7899f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
7999f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell# Make the libGL.so library
8099f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell$(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME): $(XLIB_TARGET_OBJECTS) $(LIBS) Makefile
8199f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	$(TOP)/bin/mklib -o $(GL_LIB) \
8228c790ab3118ee4c4171120cba2abf2ae3e84805Chia-I Wu		-linker "$(CXX)" -ldflags '$(LDFLAGS)' \
8399f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell		-major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \
84ad58f0d9e021065d8e6d82e1aa7387dcd206f86eBrian Paul		-cplusplus \
8599f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell		-install $(TOP)/$(LIB_DIR)/gallium \
8699f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell		$(MKLIB_OPTIONS) $(XLIB_TARGET_OBJECTS) \
8799f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell		-Wl,--start-group $(LIBS) -Wl,--end-group $(GL_LIB_DEPS)
8899f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
8999f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
9099f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwelldepend: $(XLIB_TARGET_SOURCES)
9199f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	@ echo "running $(MKDEP)"
9299f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	@ rm -f depend  # workaround oops on gutsy?!?
9399f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	@ touch depend
9499f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	$(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(XLIB_TARGET_SOURCES) \
9599f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell		> /dev/null 2>/dev/null
9699f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
9799f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
9899f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwellinstall: default
9999f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
10099f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	$(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
10199f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	$(INSTALL) -m 644 $(TOP)/include/GL/*.h $(DESTDIR)$(INSTALL_DIR)/include/GL
10299f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	@if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \
10399f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell		$(MINSTALL) $(TOP)/$(LIB_DIR)/libGL* $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR); \
10499f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	fi
10599f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
10699f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
10799f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell# Emacs tags
10899f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwelltags:
10999f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell	etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h
11099f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
11199f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwellclean:
112271af2a8748583794b570630cfd5a4d12d740da6Brian Paul	-rm -f *.o depend
11399f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
11499f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwell
11599f11d0e18e1ff5a433c84d52ffc13b9684c2650Keith Whitwellinclude depend
116