1 # src/gallium/Makefile.template
3 # Template makefile for gallium libraries.
6 # The minimum that the including makefile needs to define
7 # is TOP, LIBNAME and one of of the *_SOURCES.
10 # LIBRARY_INCLUDES are appended to the list of includes directories.
11 # LIBRARY_DEFINES is not used for makedepend, but for compilation.
15 OBJECTS = $(C_SOURCES:.c=.o) \
16 $(CPP_SOURCES:.cpp=.o) \
21 -I$(TOP)/src/gallium/include \
22 -I$(TOP)/src/gallium/auxiliary \
23 -I$(TOP)/src/gallium/drivers \
27 LIBRARY_DEFINES += $(LLVM_CFLAGS)
33 default: depend lib$(LIBNAME).a $(PROGS)
35 lib$(LIBNAME).a: $(OBJECTS) $(EXTRA_OBJECTS) Makefile $(TOP)/src/gallium/Makefile.template
36 $(MKLIB) -o $(LIBNAME) -static $(OBJECTS) $(EXTRA_OBJECTS)
38 depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) $(GENERATED_SOURCES)
41 $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(GENERATED_SOURCES) 2> /dev/null
43 $(PROGS): % : %.o $(PROGS_DEPS)
44 $(LD) $(LDFLAGS) $(filter %.o,$^) -o $@ -Wl,--start-group $(LIBS) -Wl,--end-group
48 etags `find . -name \*.[ch]` `find $(TOP)/src/gallium/include -name \*.h`
50 # Remove .o and backup files
52 rm -f $(OBJECTS) $(GENERATED_SOURCES) $(PROGS) lib$(LIBNAME).a depend depend.bak $(CLEAN_EXTRA)
61 $(CC) -S $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@
64 $(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@
67 $(CXX) -c $(INCLUDES) $(CXXFLAGS) $(LIBRARY_DEFINES) $< -o $@
70 $(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@