Ticket #43836: patch-Makefile.diff

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

    diff --git a/Makefile b/Makefile
    index f4d4d6b..d468f3e 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
    5555${PLUGIN}-debug.so: ${DOBJECTS}
    5656        $(ECHO) LD $@
    5757        $(QUIET)${CC} -shared ${LDFLAGS} -o $@ $(DOBJECTS) ${LIBS}
    5858
    5959clean:
    60         $(QUIET)rm -rf ${OBJECTS} ${DOBJECTS} $(PLUGIN).so $(PLUGIN)-debug.so \
     60        $(QUIET)rm -rf ${OBJECTS} ${DOBJECTS} $(PLUGIN).dylib $(PLUGIN)-debug.so \
    6161                doc .depend ${PROJECT}-${VERSION}.tar.gz zathura-version-check
    6262
    6363debug: options ${PLUGIN}-debug.so
    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