gallium: Improve makefiles for libraries

The template makefile that most libraries in
	gallium included was based on dri and had a bunch
	unrelevant junk in it.

	Update it and improve the depending makefiles.
This commit is contained in:
Jakob Bornecrantz 2009-02-20 00:14:00 +01:00
parent 8cf997b7c8
commit d9602e5144
23 changed files with 50 additions and 156 deletions

View file

@ -1,64 +1,66 @@
# -*-makefile-*-
# src/gallium/Makefile.template
# We still have a dependency on the "dri" buffer manager. Most likely
# the interface can be reused in non-dri environments, and also as a
# frontend to simpler memory managers.
# Template makefile for gallium libraries.
#
COMMON_SOURCES =
# Usage:
# The minimum that the including makefile needs to define
# is TOP, LIBNAME and one of of the *_SOURCES.
#
# Optional defines:
# LIBRARY_INCLUDES are appended to the list of includes directories.
# LIBRARY_DEFINES is not used for makedepend, but for compilation.
### Basic defines ###
OBJECTS = $(C_SOURCES:.c=.o) \
$(CPP_SOURCES:.cpp=.o) \
$(ASM_SOURCES:.S=.o)
$(CPP_SOURCES:.cpp=.o) \
$(ASM_SOURCES:.S=.o)
### Include directories
INCLUDES = \
-I. \
-I$(TOP)/src/gallium/include \
-I$(TOP)/src/gallium/auxiliary \
-I$(TOP)/src/gallium/drivers \
-I$(TOP)/include \
$(DRIVER_INCLUDES)
##### RULES #####
.c.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
.cpp.o:
$(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DRIVER_DEFINES) $< -o $@
.S.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
-I$(GALLIUM)/src/gallium/include \
-I$(GALLIUM)/src/gallium/auxiliary \
-I$(GALLIUM)/src/gallium/drivers \
$(LIBRARY_INCLUDES)
##### TARGETS #####
default: depend symlinks lib$(LIBNAME).a
default: depend lib$(LIBNAME).a
lib$(LIBNAME).a: $(OBJECTS) Makefile $(TOP)/src/gallium/Makefile.template
$(TOP)/bin/mklib -o $(LIBNAME) -static $(OBJECTS) $(DRIVER_LIBS)
$(MKLIB) -o $(LIBNAME) -static $(OBJECTS)
depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
rm -f depend
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) \
$(ASM_SOURCES) 2> /dev/null
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) 2> /dev/null
# Emacs tags
tags:
etags `find . -name \*.[ch]` `find ../include`
# Remove .o and backup files
clean::
-rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS)
-rm -f depend depend.bak
clean:
rm -f $(OBJECTS) lib$(LIBNAME).a depend depend.bak
# Dummy target
install:
@echo -n ""
##### RULES #####
.c.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@
.cpp.o:
$(CXX) -c $(INCLUDES) $(CXXFLAGS) $(LIBRARY_DEFINES) $< -o $@
.S.o:
$(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@
include depend
sinclude depend

View file

@ -9,6 +9,3 @@ C_SOURCES = \
cso_hash.c
include ../../Makefile.template
symlinks:

View file

@ -43,8 +43,4 @@ C_SOURCES = \
draw_vs_ppc.c \
draw_vs_sse.c
include ../../Makefile.template
symlinks:

View file

@ -10,7 +10,3 @@ include ../../Makefile.template
u_indices_gen.c: u_indices_gen.py
python $< > $@
symlinks:

View file

@ -17,6 +17,3 @@ C_SOURCES = \
pb_validate.c
include ../../Makefile.template
symlinks:

View file

@ -11,6 +11,3 @@ C_SOURCES = \
rtasm_ppc_spe.c
include ../../Makefile.template
symlinks:

View file

@ -7,6 +7,3 @@ C_SOURCES = \
sct.c
include ../../Makefile.template
symlinks:

View file

@ -19,6 +19,3 @@ C_SOURCES = \
tgsi_util.c
include ../../Makefile.template
symlinks:

View file

@ -10,6 +10,3 @@ C_SOURCES = \
translate_cache.c
include ../../Makefile.template
symlinks:

View file

@ -27,6 +27,3 @@ C_SOURCES = \
u_simple_screen.c
include ../../Makefile.template
symlinks:

View file

@ -9,6 +9,3 @@ C_SOURCES = \
fo_context.c
include ../../Makefile.template
symlinks:

View file

@ -26,6 +26,3 @@ C_SOURCES = \
i915_surface.c
include ../../Makefile.template
symlinks:

View file

@ -50,5 +50,3 @@ C_SOURCES = \
brw_wm_surface_state.c
include ../../Makefile.template
symlinks:

View file

@ -3,7 +3,7 @@ include $(TOP)/configs/current
LIBNAME = nv04
DRIVER_SOURCES = \
C_SOURCES = \
nv04_surface_2d.c \
nv04_clear.c \
nv04_context.c \
@ -17,13 +17,4 @@ DRIVER_SOURCES = \
nv04_surface.c \
nv04_vbo.c
C_SOURCES = \
$(COMMON_SOURCES) \
$(DRIVER_SOURCES)
ASM_SOURCES =
include ../../Makefile.template
symlinks:

View file

@ -3,7 +3,7 @@ include $(TOP)/configs/current
LIBNAME = nv10
DRIVER_SOURCES = \
C_SOURCES = \
nv10_clear.c \
nv10_context.c \
nv10_fragprog.c \
@ -16,13 +16,4 @@ DRIVER_SOURCES = \
nv10_surface.c \
nv10_vbo.c
C_SOURCES = \
$(COMMON_SOURCES) \
$(DRIVER_SOURCES)
ASM_SOURCES =
include ../../Makefile.template
symlinks:

View file

@ -3,7 +3,7 @@ include $(TOP)/configs/current
LIBNAME = nv20
DRIVER_SOURCES = \
C_SOURCES = \
nv20_clear.c \
nv20_context.c \
nv20_fragprog.c \
@ -17,13 +17,4 @@ DRIVER_SOURCES = \
nv20_vbo.c
# nv20_vertprog.c
C_SOURCES = \
$(COMMON_SOURCES) \
$(DRIVER_SOURCES)
ASM_SOURCES =
include ../../Makefile.template
symlinks:

View file

@ -3,7 +3,7 @@ include $(TOP)/configs/current
LIBNAME = nv30
DRIVER_SOURCES = \
C_SOURCES = \
nv30_clear.c \
nv30_context.c \
nv30_draw.c \
@ -25,13 +25,4 @@ DRIVER_SOURCES = \
nv30_vbo.c \
nv30_vertprog.c
C_SOURCES = \
$(COMMON_SOURCES) \
$(DRIVER_SOURCES)
ASM_SOURCES =
include ../../Makefile.template
symlinks:

View file

@ -3,7 +3,7 @@ include $(TOP)/configs/current
LIBNAME = nv40
DRIVER_SOURCES = \
C_SOURCES = \
nv40_clear.c \
nv40_context.c \
nv40_draw.c \
@ -25,13 +25,4 @@ DRIVER_SOURCES = \
nv40_vbo.c \
nv40_vertprog.c
C_SOURCES = \
$(COMMON_SOURCES) \
$(DRIVER_SOURCES)
ASM_SOURCES =
include ../../Makefile.template
symlinks:

View file

@ -3,7 +3,7 @@ include $(TOP)/configs/current
LIBNAME = nv50
DRIVER_SOURCES = \
C_SOURCES = \
nv50_clear.c \
nv50_context.c \
nv50_draw.c \
@ -18,13 +18,4 @@ DRIVER_SOURCES = \
nv50_transfer.c \
nv50_vbo.c
C_SOURCES = \
$(COMMON_SOURCES) \
$(DRIVER_SOURCES)
ASM_SOURCES =
include ../../Makefile.template
symlinks:

View file

@ -18,5 +18,3 @@ C_SOURCES = \
r300_texture.c
include ../../Makefile.template
symlinks:

View file

@ -42,6 +42,3 @@ C_SOURCES = \
sp_surface.c
include ../../Makefile.template
symlinks:

View file

@ -9,10 +9,6 @@ C_SOURCES = \
tr_screen.c \
tr_state.c \
tr_texture.c \
tr_winsys.c
tr_winsys.c
include ../../Makefile.template
symlinks:

View file

@ -3,23 +3,15 @@ include $(TOP)/configs/current
LIBNAME = xlib
DRIVER_INCLUDES = \
LIBRARY_INCLUDES = \
-I$(TOP)/include \
-I$(TOP)/src/mesa \
-I$(TOP)/src/mesa/main \
-I$(TOP)/src/gallium/include \
-I$(TOP)/src/gallium/drivers \
-I$(TOP)/src/gallium/auxiliary
-I$(TOP)/src/mesa/main
C_SOURCES = \
glxapi.c \
fakeglx.c \
fakeglx_fonts.c \
glxapi.c \
fakeglx.c \
fakeglx_fonts.c \
xm_api.c
include ../../../Makefile.template
symlinks: