Исправлен Makefile

pull/24/head
Igor Belitskiy 2 years ago
parent af2bedbe70
commit 5d93e7ea4f

@ -21,11 +21,11 @@ all: init build
init:
@echo "Initialize ..."; \
if [ -d ".git" ]; then \
LATEST_TAG=$$(git describe --tags | sed 's/^v//'); \
LATEST_TAG=$$(git describe --tags | sed 's/^v//'|grep -oE "^[0-9]{1,}.[0-9]{1,}"); \
else \
LATEST_TAG="0.0"; \
fi; \
sed -r "s/^(string version_application = ).*/\1\"$${LATEST_TAG}\";/" -i source/${PKGNAME}.cc; \
sed -r "s/^(string version_application).*/\1=\"$${LATEST_TAG}\";/" -i source/${PKGNAME}.h; \
echo "-- Build path: ${CMAKE_BUILD_DIR}"
depend:
@ -43,6 +43,7 @@ debug:
@echo "Debug ..."
if [ ! -d ${CMAKE_BUILD_DIR} ]; then \
$(CMAKE_COMMAND) -S${CMAKE_SOURCE_DIR} -B${CMAKE_BUILD_DIR} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="${PREFIX}"; \
@gcc source/ubl-settings-cmake.h compile/ubl-cmake.h source/ubl-settings-multiseat.c source/ubl-settings-multiseat.h source/ubl-settings-multiseat-strings.h source/ubl-utils.c source/ubl-utils.h -o ubl-settings-multiseat `pkg-config --cflags --libs gtk+-3.0 vte-2.91 webkit2gtk-4.0 webkit2gtk-web-extension-4.0` -g
fi; \
echo "Debug: OK"
@ -86,10 +87,10 @@ uninstall:
done
@$(RM) "${DESTDIR}${PREFIX}/bin/${PKGNAME}"
@$(RM) "${DESTDIR}${PREFIX}/share/applications/${PKGNAME}.desktop"
@$(RM) "${DESTDIR}${PREFIX}/share/${PKGNAME}/images/logo-background.png"
@$(RM) "${DESTDIR}${PREFIX}/share/polkit-1/actions/com.ublinux.${PKGNAME}.policy"
@$(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/com.ublinux.${PKGNAME}.svg"
@$(RM) -rd "${DESTDIR}${PREFIX}/share/${PKGNAME}"
@$(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/com.ublinux.${PKGNAME}.checked.svg"
@$(RM) "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/com.ublinux.${PKGNAME}.warning.svg"
@$(RM) "${DESTDIR}${PREFIX}/share/polkit-1/actions/com.ublinux.${PKGNAME}.policy"
@if [ -z ${DESTDIR} ]; then \
[ -d "${DESTDIR}${PREFIX}/share/icons/hicolor/" ] && gtk-update-icon-cache -fiq "${DESTDIR}${PREFIX}/share/icons/hicolor/" &>/dev/null || true; \
update-desktop-database --quiet &>/dev/null || true; \
@ -113,24 +114,23 @@ install: check uninstall
done
@install -dm755 "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/" "com.ublinux.${PKGNAME}.svg"
@install -Dm755 -t "${DESTDIR}${PREFIX}/bin/" "${CMAKE_BUILD_DIR}/${PKGNAME}"
@install -dm755 "${DESTDIR}${PREFIX}/share/applications"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/applications/" "${PKGNAME}.desktop"
@install -dm755 "${DESTDIR}${PREFIX}/share/polkit-1/actions"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/polkit-1/actions/" "com.ublinux.${PKGNAME}.policy"
@install -dm755 "${DESTDIR}${PREFIX}/share/${PKGNAME}"/{ui,css,images}
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/ui/" "${PKGNAME}.glade"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/css/" "${PKGNAME}.css"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/images/" "logo-background.png"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.checked.svg"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.warning.svg"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/status/" "com.ublinux.${PKGNAME}.funnel.svg"
@install -dm755 "${DESTDIR}${PREFIX}/share/polkit-1/actions"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/polkit-1/actions/" "com.ublinux.${PKGNAME}.policy"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/polkit-1/actions/" "gdb.policy"
@install -Dm755 -t "${DESTDIR}${PREFIX}/bin/" "${CMAKE_BUILD_DIR}/${PKGNAME}"
@install -dm755 "${DESTDIR}/etc/xdg"
@install -dm755 "${DESTDIR}${PREFIX}/share/applications"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/applications/" "${PKGNAME}.desktop"
@if [ -z ${DESTDIR} ]; then \
[ -d "${DESTDIR}${PREFIX}/share/icons/hicolor/" ] && gtk-update-icon-cache -fiq "${DESTDIR}${PREFIX}/share/icons/hicolor/" &>/dev/null || true; \
update-desktop-database --quiet &>/dev/null || true; \
[ -d "${DESTDIR}${PREFIX}/share/applications" ] && touch "${DESTDIR}${PREFIX}/share/applications" &>/dev/null || true; \
fi
@echo "Install: OK"
@sed -r "s/^(string version_application=\"*\").*/string version_application;/" -i source/${PKGNAME}.h; \
clean:
@echo "Clean ..."
@ -151,3 +151,4 @@ help:
echo "... install"; \
echo "... uninstall"; \
echo "... clean"

Loading…
Cancel
Save