Ticket #51915: patch-Makefile.diff

File patch-Makefile.diff, 2.3 KB (added by harciga, 8 years ago)
  • Makefile

    diff --git a/Makefile b/Makefile
    index cbe15f5..bfaa5bd 100644
    a b CPPFLAGS += "-DVERSION_MAJOR=${VERSION_MAJOR}" 
    1818CPPFLAGS += "-DVERSION_MINOR=${VERSION_MINOR}"
    1919CPPFLAGS += "-DVERSION_REV=${VERSION_REV}"
    2020
    21 all: options ${PLUGIN}.so
     21all: options ${PLUGIN}.dylib
    2222
    2323zathura-version-check:
    2424ifneq ($(ZATHURA_VERSION_CHECK), 0)
    options: 
    4747${OBJECTS}:  config.mk zathura-version-check
    4848${DOBJECTS}: config.mk zathura-version-check
    4949
    50 ${PLUGIN}.so: ${OBJECTS}
     50${PLUGIN}.dylib: ${OBJECTS}
    5151        $(ECHO) LD $@
    52         $(QUIET)${CC} -shared ${LDFLAGS} -o $@ ${OBJECTS} ${LIBS}
     52        $(QUIET)${CC} -Wl,-dylib_install_name,${PLUGIN}.dylib -Wl,-bundle_loader,${PREFIX}/bin/zathura -bundle ${LDFLAGS} -o $@ ${OBJECTS} ${LIBS}
    5353
    54 ${PLUGIN}-debug.so: ${DOBJECTS}
     54${PLUGIN}-debug.dylib: ${DOBJECTS}
    5555        $(ECHO) LD $@
    5656        $(QUIET)${CC} -shared ${LDFLAGS} -o $@ ${DOBJECTS} ${LIBS}
    5757
    5858clean:
    59         $(QUIET)rm -rf ${OBJECTS} ${DOBJECTS} $(PLUGIN).so $(PLUGIN)-debug.so \
     59        $(QUIET)rm -rf ${OBJECTS} ${DOBJECTS} $(PLUGIN).dylib $(PLUGIN)-debug.dylib \
    6060                doc .depend ${PROJECT}-${VERSION}.tar.gz zathura-version-check
    6161
    62 debug: options ${PLUGIN}-debug.so
     62debug: options ${PLUGIN}-debug.dylib
    6363
    6464dist: clean
    6565        $(QUIET)mkdir -p ${PROJECT}-${VERSION}
    doc: clean 
    7777install: all
    7878        $(ECHO) installing ${PLUGIN} plugin
    7979        $(QUIET)mkdir -p ${DESTDIR}${PLUGINDIR}
    80         $(QUIET)cp -f ${PLUGIN}.so ${DESTDIR}${PLUGINDIR}
     80        $(QUIET)cp -f ${PLUGIN}.dylib ${DESTDIR}${PLUGINDIR}
    8181        $(QUIET)mkdir -m 755 -p ${DESTDIR}${DESKTOPPREFIX}
    8282        $(ECHO) installing desktop file
    8383        $(QUIET)install -m 644 ${PROJECT}.desktop ${DESTDIR}${DESKTOPPREFIX}
    install: all 
    8787
    8888uninstall:
    8989        $(ECHO) uninstalling ${PLUGIN} plugin
    90         $(QUIET)rm -f ${DESTDIR}${PLUGINDIR}/${PLUGIN}.so
    91         $(QUIET)rmdir --ignore-fail-on-non-empty ${DESTDIR}${PLUGINDIR} 2> /dev/null
     90        $(QUIET)rm -f ${DESTDIR}${PLUGINDIR}/${PLUGIN}.dylib
     91        $(QUIET)rmdir ${DESTDIR}${PLUGINDIR} 2> /dev/null
    9292        $(ECHO) removing desktop file
    9393        $(QUIET)rm -f ${DESTDIR}${DESKTOPPREFIX}/${PROJECT}.desktop
    94         $(QUIET)rmdir --ignore-fail-on-non-empty ${DESTDIR}${DESKTOPPREFIX} 2> /dev/null
     94        $(QUIET)rmdir ${DESTDIR}${DESKTOPPREFIX} 2> /dev/null
    9595        $(ECHO) removing AppData file
    9696        $(QUIET)rm -f $(DESTDIR)$(APPDATAPREFIX)/$(PROJECT).metainfo.xml
    9797