i915g: fix i915_winsys_batchbuffer_write
[mesa.git] / src / gallium / Makefile.template
index 7606a947e2244170f3a01a3acbcd4d0e29074b07..036c11986ee8c0880cea1fa03f381ebb9d312855 100644 (file)
@@ -23,10 +23,14 @@ INCLUDES = \
        -I$(TOP)/src/gallium/drivers \
        $(LIBRARY_INCLUDES)
 
+ifeq ($(MESA_LLVM),1)
+LIBRARY_DEFINES += $(LLVM_CFLAGS)
+endif
+
 
 ##### TARGETS #####
 
-default: depend lib$(LIBNAME).a
+default: depend lib$(LIBNAME).a $(PROGS)
 
 lib$(LIBNAME).a: $(OBJECTS) $(EXTRA_OBJECTS) Makefile $(TOP)/src/gallium/Makefile.template
        $(MKLIB) -o $(LIBNAME) -static $(OBJECTS) $(EXTRA_OBJECTS)
@@ -34,7 +38,10 @@ lib$(LIBNAME).a: $(OBJECTS) $(EXTRA_OBJECTS) Makefile $(TOP)/src/gallium/Makefil
 depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) $(GENERATED_SOURCES)
        rm -f depend
        touch depend
-       $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(LIBRARY_DEFINES) $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(GENERATED_SOURCES) 2> /dev/null
+       $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(GENERATED_SOURCES) 2> /dev/null
+
+$(PROGS): % : %.o $(PROGS_DEPS)
+       $(LD) $(LDFLAGS) $(filter %.o,$^) -o $@ -Wl,--start-group  $(LIBS) -Wl,--end-group
 
 # Emacs tags
 tags:
@@ -42,7 +49,7 @@ tags:
 
 # Remove .o and backup files
 clean:
-       rm -f $(OBJECTS) $(GENERATED_SOURCES) lib$(LIBNAME).a depend depend.bak
+       rm -f $(OBJECTS) $(GENERATED_SOURCES) $(PROGS) lib$(LIBNAME).a depend depend.bak $(CLEAN_EXTRA)
 
 # Dummy target
 install: