gallium: Improve makefiles for libraries
authorJakob Bornecrantz <jakob@vmware.com>
Thu, 19 Feb 2009 23:14:00 +0000 (00:14 +0100)
committerJakob Bornecrantz <jakob@vmware.com>
Fri, 20 Feb 2009 10:22:10 +0000 (10:22 +0000)
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.

23 files changed:
src/gallium/Makefile.template
src/gallium/auxiliary/cso_cache/Makefile
src/gallium/auxiliary/draw/Makefile
src/gallium/auxiliary/indices/Makefile
src/gallium/auxiliary/pipebuffer/Makefile
src/gallium/auxiliary/rtasm/Makefile
src/gallium/auxiliary/sct/Makefile
src/gallium/auxiliary/tgsi/Makefile
src/gallium/auxiliary/translate/Makefile
src/gallium/auxiliary/util/Makefile
src/gallium/drivers/failover/Makefile
src/gallium/drivers/i915simple/Makefile
src/gallium/drivers/i965simple/Makefile
src/gallium/drivers/nv04/Makefile
src/gallium/drivers/nv10/Makefile
src/gallium/drivers/nv20/Makefile
src/gallium/drivers/nv30/Makefile
src/gallium/drivers/nv40/Makefile
src/gallium/drivers/nv50/Makefile
src/gallium/drivers/r300/Makefile
src/gallium/drivers/softpipe/Makefile
src/gallium/drivers/trace/Makefile
src/gallium/state_trackers/glx/xlib/Makefile

index 655e949ca2daa1068af26c4efd7fbce531c07d71..98487d43bd646f4da3024fc93069da43acc5a364 100644 (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.
+#
+# Usage:
+#   The minimum that the including makefile needs to define
+#   is TOP, LIBNAME and one of of the *_SOURCES.
 #
-COMMON_SOURCES = 
+# Optional defines:
+#   LIBRARY_INCLUDES are appended to the list of includes directories.
+#   LIBRARY_DEFINES is not used for makedepend, but for compilation.
 
-OBJECTS = $(C_SOURCES:.c=.o) \
-          $(CPP_SOURCES:.cpp=.o) \
-         $(ASM_SOURCES:.S=.o) 
+### Basic defines ###
 
+OBJECTS = $(C_SOURCES:.c=.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
index 6bd66020887e55b425098eb802aba073899eb904..8726afcd949b5671c89d57804d7519564b520620 100644 (file)
@@ -9,6 +9,3 @@ C_SOURCES = \
        cso_hash.c
 
 include ../../Makefile.template
-
-symlinks:
-
index bdbf5a08ede4b3279ffa26070878582689d1dc5f..5041dcc072bfd7a2e350af91254447e977a8cc7d 100644 (file)
@@ -43,8 +43,4 @@ C_SOURCES = \
        draw_vs_ppc.c  \
        draw_vs_sse.c 
 
-
 include ../../Makefile.template
-
-symlinks:
-
index 8fa61d265ea210f4ca7cf1a2994a8fc409268244..25ee899c404e768ad73e306f12528498aefc32a1 100644 (file)
@@ -10,7 +10,3 @@ include ../../Makefile.template
 
 u_indices_gen.c: u_indices_gen.py
        python $< > $@
-
-
-symlinks:
-
index 3b501c51dffcdb2210947682c663d78b61c0731d..1c00ba8d986d36b6c62e885be7521f48ff6d9091 100644 (file)
@@ -17,6 +17,3 @@ C_SOURCES = \
        pb_validate.c
 
 include ../../Makefile.template
-
-symlinks:
-
index 252dc5274abb2a5c9094a4647b579eba4b78abcd..ab8ea464c6e27d5360318e6e27189c9ba54fd7a2 100644 (file)
@@ -11,6 +11,3 @@ C_SOURCES = \
        rtasm_ppc_spe.c
 
 include ../../Makefile.template
-
-symlinks:
-
index 516d1756cf95686d39a75e3616a06c33c3d75561..a7d111b6891fc96c2081de0f297fb6308ca3cdcd 100644 (file)
@@ -7,6 +7,3 @@ C_SOURCES = \
        sct.c
 
 include ../../Makefile.template
-
-symlinks:
-
index d7df9490cfa3047b6e42d926b86366c047b1d7a6..b4900e8dbaa2f91e4a1ad942e1fd0700d075d22b 100644 (file)
@@ -19,6 +19,3 @@ C_SOURCES = \
        tgsi_util.c
 
 include ../../Makefile.template
-
-symlinks:
-
index ad2a5b705e4f5cf9f2b32c92653360d24b4c25be..3c82f8ae03763b7c27095517b89333933ddb6048 100644 (file)
@@ -10,6 +10,3 @@ C_SOURCES = \
         translate_cache.c
 
 include ../../Makefile.template
-
-symlinks:
-
index 671e671df23ead4a38ce7768b8c8838f4b2e173c..160df8dfa71ec168dd19b84b5e2e214478e5d2f0 100644 (file)
@@ -27,6 +27,3 @@ C_SOURCES = \
        u_simple_screen.c
 
 include ../../Makefile.template
-
-symlinks:
-
index f08b8df07a16ff65a244d1d1671207363eb00c3c..dfb7f5dcf602e52d3c99bee6c84457c2c4453484 100644 (file)
@@ -9,6 +9,3 @@ C_SOURCES = \
        fo_context.c 
 
 include ../../Makefile.template
-
-symlinks:
-
index 41a61a0020b513a0f5cc365c41f5533050cb2279..12821c5a76179383b19006a8ca8456a5d1cd5eda 100644 (file)
@@ -26,6 +26,3 @@ C_SOURCES = \
        i915_surface.c 
 
 include ../../Makefile.template
-
-symlinks:
-
index e97146e57ca7c0d0c481610b86f06fe2e1347469..19182afa75d1cb15ef97f4b934cc58edc69691b6 100644 (file)
@@ -50,5 +50,3 @@ C_SOURCES = \
        brw_wm_surface_state.c
 
 include ../../Makefile.template
-
-symlinks:
index 4ed62dae95d5468bfaaf24c159550d998a57b592..cf9deea8519d5daf16601864ad8c1d94d2bf9549 100644 (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:
-
index 4ba7ce586d6c995d6cd37edac957d504ef1f3e62..2b5fbd4f5a67f09941f42c02a2a987697d67a4b4 100644 (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:
-
index d777fd3d8b4825ad68c292119840ad92333bada5..93e34f8e92ace779572257586b8924e0c91630ee 100644 (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:
-
index 69f2790dfe280e920ed2ce5fed9815515d701d9a..4c29e2eab31d7897f50606764db013863352fdfd 100644 (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:
-
index 9c8eadf7e440c07694da8a90bfb762f059fbac02..8c738aefa6a1cdd098c812858a5e56147329d008 100644 (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:
-
index 48244dbbac77aa6790858e17cc5a2006a24d9f74..612aea28a34b5c001752bf398f26386cd84dabbf 100644 (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:
-
index 85b3f15ac5b18bb586429fe7401c275750d7eb48..9b7524b523a6ea2504c96246d9b8d8120a2f3a67 100644 (file)
@@ -18,5 +18,3 @@ C_SOURCES = \
        r300_texture.c
 
 include ../../Makefile.template
-
-symlinks:
index f186f6df1d706f4212f87931743c9c0272e66e87..516e3992fdddf53963f6ebb523cde34a3ba4e0ed 100644 (file)
@@ -42,6 +42,3 @@ C_SOURCES = \
        sp_surface.c 
 
 include ../../Makefile.template
-
-symlinks:
-
index 3859b8acb06579a925e245cba9aa9ff74a6e5b3c..e1bd9709373aa23d906a495f31fcddd0845b52cc 100644 (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:
-
index 1b63db1f0ea94fb482ae4a0df88f57fbe8949233..6d10b090aa0c9e37a9b9a58dbc533d7c4d268e1a 100644 (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:
-