# $Id$ # # special rules for DLL linker invocation. # # Variables: # # prefix ... install prefix # DESTDIR ... temporary destination directory, where prefix resides. (Used by debian and rpm packagers) # LD ... path of linker (either CC or CXX) # OBJS ... objet files to be linked in. # EXT_LIBS ... pkg-config detected libraries. # LIBS ... list of optional additional libraries # SILENT_LIBS ... optional list of additional libraries, which are not propagated to pkg-config's .pc-file # LDFLAGS ... Additional linker flags # ARTIFACT ... The name of the build artifact # ABI_VERSION ... Version of the ABI for shared libraries. # NODEVRULES ... If non-empty don't generate install-dev rules. # LIBSUBDIR ... subdirectory where executable should be installed. # Will be set to $(ARCHLIBSUBDIR) or as a last fallback to'lib' if empty. # (Sometimes may be 'lib/foo' for installing into a subdirectory) # BINSUBDIR ... subdirectory where executable should be installed. Will be set to 'bin' if empty. # (Sometimes may be 'sbin') # TARGET=$(ARTIFACT)-$(ABI_VERSION).dll TARGET2=lib$(ARTIFACT).dll.a ifeq ($(BINSUBDIR),) BINSUBDIR=bin endif ifeq ($(LIBSUBDIR),) ifeq ($(ARCHLIBSUBDIR),) LIBSUBDIR=lib else LIBSUBDIR=$(ARCHLIBSUBDIR) endif endif $(TARGET) $(TARGET2): $(OBJS) $(LD) -shared -Wl,--dll -Wl,--out-implib=$(TARGET2) $(LDFLAGS) $(OBJS) $(SILENT_LIBS) $(LIBS) $(EXT_LIBS) -o $(TARGET) link:: $(TARGET) $(TARGET2) install-bin:: $(TARGET) mkdir -p $(DESTDIR)$(prefix)/$(BINSUBDIR) install -m 755 -p $(TARGET) $(DESTDIR)$(prefix)/$(BINSUBDIR) ifeq ($(NODEVRULES),) install-dev:: $(TARGET2) mkdir -p $(DESTDIR)$(prefix)/$(LIBSUBDIR) install -m 644 -p $(TARGET2) $(DESTDIR)$(prefix)/$(LIBSUBDIR) endif clean:: rm -f $(TARGET) $(TARGET2)