1 TOP = ../../../.. 2 include $(TOP)/configs/current 3 4 gbm_INCLUDES = \ 5 -I. \ 6 -I$(TOP)/src/gallium/include \ 7 -I$(TOP)/src/gallium/auxiliary \ 8 -I$(TOP)/src/gbm/main \ 9 -I$(TOP)/include 10 11 gbm_SOURCES = $(wildcard *.c) 12 gbm_OBJECTS = $(gbm_SOURCES:.c=.o) 13 14 ALL_INCLUDES = $(gbm_INCLUDES) 15 ALL_SOURCES = $(gbm_SOURCES) 16 17 GBM_OBJECTS = $(gbm_OBJECTS) 18 GBM_CPPFLAGS = $(gbm_INCLUDES) 19 20 ifneq ($(findstring wayland, $(EGL_PLATFORMS)),) 21 GBM_CPPFLAGS += -DHAVE_WAYLAND_PLATFORM 22 endif 23 24 ##### TARGETS ##### 25 26 default: depend libgbm.a 27 28 libgbm.a: $(GBM_OBJECTS) Makefile 29 $(MKLIB) -o gbm -static $(GBM_OBJECTS) 30 31 depend: 32 rm -f depend 33 touch depend 34 $(MKDEP) $(MKDEP_OPTIONS) $(ALL_INCLUDES) $(ALL_SOURCES) 2> /dev/null 35 36 clean: 37 rm -f libgbm.a 38 rm -f $(GBM_OBJECTS) 39 rm -f depend depend.bak 40 41 # Dummy target 42 install: 43 @echo -n "" 44 45 ##### RULES ##### 46 47 $(gbm_OBJECTS): %.o: %.c 48 $(CC) -c $(GBM_CPPFLAGS) $(DEFINES) $(CFLAGS) $< -o $@ 49 50 sinclude depend 51