# $Id$ # # special rules for lib*.a linker invocation. # # Variables: # # prefix ... install prefix # DESTDIR ... temporary destination directory, where prefix resides. (Used by debian and rpm packagers) # AR ... path of linker (either CC or CXX) # OBJS ... objet files to be linked in. # ARTIFACT ... The name of the build artifact # NODEVRULES ... If non-empty don't generate install-dev rules. # LIBSUBDIR ... subdirectory where libraries should be installed. # Will be set to $(ARCHLIBSUBDIR) or as a last fallback to'lib' if empty. # (Sometimes may be 'lib/foo' or 'lib64') # TARGET=lib$(ARTIFACT).a ifeq ($(LIBSUBDIR),) ifeq ($(ARCHLIBSUBDIR),) LIBSUBDIR=lib else LIBSUBDIR=$(ARCHLIBSUBDIR) endif endif $(TARGET): $(OBJS) rm -f $(TARGET) $(AR) cq $(TARGET) $(OBJS) link:: $(TARGET) ifeq ($(NODEVRULES),) install-dev:: $(TARGET) mkdir -p $(DESTDIR)$(prefix)/$(LIBSUBDIR) install -m 644 -p $(TARGET) $(DESTDIR)$(prefix)/$(LIBSUBDIR) endif clean:: rm -f $(TARGET)