Ticket #51916: patch-Makefile.diff

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

    diff --git a/Makefile b/Makefile
    index bd53080..0a56a11 100644
    a b CPPFLAGS += "-DVERSION_MAJOR=${VERSION_MAJOR}" 
    2020CPPFLAGS += "-DVERSION_MINOR=${VERSION_MINOR}"
    2121CPPFLAGS += "-DVERSION_REV=${VERSION_REV}"
    2222
    23 all: options ${PLUGIN}.so
     23all: options ${PLUGIN}.dylib
    2424
    2525zathura-version-check:
    2626ifneq ($(ZATHURA_VERSION_CHECK), 0)
    options: 
    4848${OBJECTS}:  config.mk zathura-version-check
    4949${DOBJECTS}: config.mk zathura-version-check
    5050
    51 ${PLUGIN}.so: ${OBJECTS}
     51${PLUGIN}.dylib: ${OBJECTS}
    5252        $(ECHO) LD $@
    53         $(QUIET)${CC} -shared ${LDFLAGS} -o $@ $(OBJECTS) ${LIBS}
     53        $(QUIET)${CC} -Wl,-dylib_install_name,${PLUGIN}.dylib -Wl,-bundle_loader,${PREFIX}/bin/zathura -bundle ${LDFLAGS} -o $@ $(OBJECTS) ${LIBS}
    5454
    55 ${PLUGIN}-debug.so: ${DOBJECTS}
     55${PLUGIN}-debug.dylib: ${DOBJECTS}
    5656        $(ECHO) LD $@
    5757        $(QUIET)${CC} -shared ${LDFLAGS} -o $@ $(DOBJECTS) ${LIBS}
    5858
    5959clean:
    60         $(QUIET)rm -rf ${OBJECTS} ${DOBJECTS} $(PLUGIN).so doc .depend \
    61                 ${PROJECT}-${VERSION}.tar.gz ${PLUGIN}-debug.so zathura-version-check
     60        $(QUIET)rm -rf ${OBJECTS} ${DOBJECTS} $(PLUGIN).dylib doc .depend \
     61                ${PROJECT}-${VERSION}.tar.gz ${PLUGIN}-debug.dylib zathura-version-check
    6262
    63 debug: options ${PLUGIN}-debug.so
     63debug: options ${PLUGIN}-debug.dylib
    6464
    6565dist: clean
    6666        $(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 
    8585
    8686uninstall:
    8787        $(ECHO) uninstalling ${PLUGIN} plugin
    88         $(QUIET)rm -f ${DESTDIR}${PLUGINDIR}/${PLUGIN}.so
    89         $(QUIET)rmdir --ignore-fail-on-non-empty ${DESTDIR}${PLUGINDIR} 2> /dev/null
     88        $(QUIET)rm -f ${DESTDIR}${PLUGINDIR}/${PLUGIN}.dylib
     89        $(QUIET)rmdir ${DESTDIR}${PLUGINDIR} 2> /dev/null
    9090        $(ECHO) removing desktop file
    9191        $(QUIET)rm -f ${DESTDIR}${DESKTOPPREFIX}/${PROJECT}.desktop
    92         $(QUIET)rmdir --ignore-fail-on-non-empty ${DESTDIR}${DESKTOPPREFIX} 2> /dev/null
     92        $(QUIET)rmdir ${DESTDIR}${DESKTOPPREFIX} 2> /dev/null
    9393
    9494-include $(wildcard .depend/*.dep)
    9595