Ticket #51918: patch-Makefile.diff

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

    diff --git a/Makefile b/Makefile
    index 1fb42e2..423657a 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: 
    4646${OBJECTS}:  config.mk zathura-version-check
    4747${DOBJECTS}: config.mk zathura-version-check
    4848
    49 ${PLUGIN}.so: ${OBJECTS}
     49${PLUGIN}.dylib: ${OBJECTS}
    5050        $(ECHO) LD $@
    51         $(QUIET)${CC} -shared ${LDFLAGS} -o $@ $(OBJECTS) ${LIBS}
     51        $(QUIET)${CC} -Wl,-dylib_install_name,${PLUGIN}.dylib -Wl,-bundle_loader,${PREFIX}/bin/zathura -bundle ${LDFLAGS} -o $@ $(OBJECTS) ${LIBS}
    5252
    53 ${PLUGIN}-debug.so: ${DOBJECTS}
     53${PLUGIN}-debug.dylib: ${DOBJECTS}
    5454        $(ECHO) LD $@
    5555        $(QUIET)${CC} -shared ${LDFLAGS} -o $@ $(DOBJECTS) ${LIBS}
    5656
    5757clean:
    58         $(QUIET)rm -rf ${OBJECTS} ${DOBJECTS} $(PLUGIN).so $(PLUGIN)-debug.so \
     58        $(QUIET)rm -rf ${OBJECTS} ${DOBJECTS} $(PLUGIN).dylib $(PLUGIN)-debug.dylib \
    5959                doc .depend ${PROJECT}-${VERSION}.tar.gz zathura-version-check
    6060
    61 debug: options ${PLUGIN}-debug.so
     61debug: options ${PLUGIN}-debug.dylib
    6262
    6363dist: clean
    6464        $(QUIET)mkdir -p ${PROJECT}-${VERSION}
    doc: clean 
    7575install: all
    7676        $(ECHO) installing ${PLUGIN} plugin
    7777        $(QUIET)mkdir -p ${DESTDIR}${PLUGINDIR}
    78         $(QUIET)cp -f ${PLUGIN}.so ${DESTDIR}${PLUGINDIR}
     78        $(QUIET)cp -f ${PLUGIN}.dylib ${DESTDIR}${PLUGINDIR}
    7979        $(QUIET)mkdir -m 755 -p ${DESTDIR}${DESKTOPPREFIX}
    8080        $(ECHO) installing desktop file
    8181        $(QUIET)install -m 644 ${PROJECT}.desktop ${DESTDIR}${DESKTOPPREFIX}
    8282
    8383uninstall:
    8484        $(ECHO) uninstalling ${PLUGIN} plugin
    85         $(QUIET)rm -f ${DESTDIR}${PLUGINDIR}/${PLUGIN}.so
    86         $(QUIET)rmdir --ignore-fail-on-non-empty ${DESTDIR}${PLUGINDIR} 2> /dev/null
     85        $(QUIET)rm -f ${DESTDIR}${PLUGINDIR}/${PLUGIN}.dylib
     86        $(QUIET)rmdir ${DESTDIR}${PLUGINDIR} 2> /dev/null
    8787        $(ECHO) removing desktop file
    8888        $(QUIET)rm -f ${DESTDIR}${DESKTOPPREFIX}/${PROJECT}.desktop
    89         $(QUIET)rmdir --ignore-fail-on-non-empty ${DESTDIR}${DESKTOPPREFIX} 2> /dev/null
     89        $(QUIET)rmdir ${DESTDIR}${DESKTOPPREFIX} 2> /dev/null
    9090
    9191-include $(wildcard .depend/*.dep)
    9292