1 # src/gbm/backends/Makefile.template 2 # 3 # Backends should define 4 # 5 # GBM_BACKEND, the driver name 6 # GBM_SOURCES, the driver sources 7 # GBM_INCLUDES, the include pathes 8 # GBM_CFLAGS, additional CFLAGS 9 # GBM_LIBS, additional LIBS 10 # 11 # before including this template. 12 # 13 14 15 GBM_BACKEND_PATH = $(TOP)/$(LIB_DIR)/gbm/$(GBM_BACKEND).so 16 GBM_OBJECTS = $(GBM_SOURCES:.c=.o) 17 18 GBM_TARGET = $(GBM_BACKEND_PATH) 19 GBM_INSTALL = install-so 20 21 default: depend $(GBM_TARGET) $(GBM_EXTRA_TARGETS) 22 23 $(GBM_BACKEND_PATH): $(GBM_BACKEND).so 24 @$(INSTALL) -d $(TOP)/$(LIB_DIR)/gbm 25 $(INSTALL) $< $(TOP)/$(LIB_DIR)/gbm 26 27 $(GBM_BACKEND).so: $(GBM_OBJECTS) Makefile $(TOP)/src/gbm/backends/Makefile.template 28 @$(MKLIB) -o $(GBM_BACKEND).so -noprefix \ 29 -linker '$(CC)' -ldflags '-L$(TOP)/$(LIB_DIR) $(LDFLAGS)' \ 30 $(MKLIB_OPTIONS) \ 31 $(GBM_OBJECTS) $(GBM_LIBS) -lgbm 32 33 .c.o: 34 $(CC) -c $(GBM_INCLUDES) $(CFLAGS) $(GBM_CFLAGS) $< -o $@ 35 36 install-so: $(GBM_BACKEND_PATH) 37 $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/gbm 38 $(MINSTALL) $(GBM_BACKEND_PATH) $(DESTDIR)$(INSTALL_LIB_DIR)/gbm 39 40 install: $(GBM_INSTALL) $(GBM_EXTRA_INSTALL) 41 42 clean: $(GBM_EXTRA_CLEAN) 43 rm -f $(GBM_BACKEND).so 44 rm -f $(GBM_OBJECTS) 45 rm -f depend depend.bak 46 47 depend: $(GBM_SOURCES) $(GBM_EXTRA_SOURCES) 48 @ echo "running $(MKDEP)" 49 @ rm -f depend 50 @ touch depend 51 $(MKDEP) $(MKDEP_OPTIONS) $(GBM_INCLUDES) $(GBM_SOURCES) \ 52 $(GBM_EXTRA_SOURCES) >/dev/null 2>/dev/null 53 54 sinclude depend 55 # DO NOT DELETE 56