Fix makefile

pull/4/head v1.8
Dmitry Razumov 2 years ago
parent f743e9e427
commit cb3d4f02ec

@ -9,8 +9,9 @@ CMAKE_COMMAND = cmake
CMAKE_SOURCE_DIR = $(MAKEFILE_PATH)source CMAKE_SOURCE_DIR = $(MAKEFILE_PATH)source
CMAKE_BUILD_DIR = $(MAKEFILE_PATH)compile CMAKE_BUILD_DIR = $(MAKEFILE_PATH)compile
DEPENDS = /bin/cmake DEPENDS = /bin/cmake
PREFIX ?= /usr PREFIX ?= /usr/local
PKGNAME = $(MAKEFILE_DIR) PKGNAME = $(MAKEFILE_DIR)
FILE_VER = source/${PKGNAME}.h
default_target: all default_target: all
@ -21,11 +22,11 @@ all: init build
init: init:
@echo "Initialize ..."; \ @echo "Initialize ..."; \
if [ -d ".git" ]; then \ if [ -d ".git" ]; then \
LATEST_TAG=$$(git describe --tags | sed 's/^v//'); \ LATEST_TAG=$$(git describe --abbrev=0 --tags | sed 's/^v//'); \
else \ else \
LATEST_TAG="0.0"; \ LATEST_TAG="Development"; \
fi; \ fi; \
sed -r "s/^(string version_application).*/\1 = \"$${LATEST_TAG}\";/" -i source/${PKGNAME}.h; \ sed -r "s/^(string version_application).*/\1 = \"$${LATEST_TAG}\";/" -i ${FILE_VER}; \
echo "-- Build path: ${CMAKE_BUILD_DIR}" echo "-- Build path: ${CMAKE_BUILD_DIR}"
depend: depend:
@ -64,7 +65,8 @@ check:
build: depend prepare build: depend prepare
@echo "Build ..."; \ @echo "Build ..."; \
make --directory=${CMAKE_BUILD_DIR}; \ $(MAKE_COMMAND) --directory=${CMAKE_BUILD_DIR}; \
sed -r "s/^(string version_application).*/\1;/" -i ${FILE_VER}; \
echo "Build: OK" echo "Build: OK"
uninstall: uninstall:
@ -113,17 +115,12 @@ install: check uninstall
install -dm755 "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}x$${SIZE}/apps"; \ install -dm755 "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}x$${SIZE}/apps"; \
rsvg-convert -w $${SIZE} -h $${SIZE} -f svg --keep-image-data "com.ublinux.${PKGNAME}.svg" -o "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/com.ublinux.${PKGNAME}.svg"; \ rsvg-convert -w $${SIZE} -h $${SIZE} -f svg --keep-image-data "com.ublinux.${PKGNAME}.svg" -o "${DESTDIR}${PREFIX}/share/icons/hicolor/$${SIZE}x$${SIZE}/apps/com.ublinux.${PKGNAME}.svg"; \
done 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 -Dm644 -t "${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/" "com.ublinux.${PKGNAME}.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/" "com.ublinux.${PKGNAME}.policy"
@install -Dm755 -t "${DESTDIR}${PREFIX}/bin/" "${CMAKE_BUILD_DIR}/${PKGNAME}" @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 -Dm644 -t "${DESTDIR}${PREFIX}/share/applications/" "${PKGNAME}.desktop"
@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}/ui/" "${PKGNAME}.glade"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/css/" "${PKGNAME}.css" @install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/css/" "${PKGNAME}.css"
@install -dm755 -d "${DESTDIR}${PREFIX}/share/${PKGNAME}/images"
@install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/images/" "${PKGNAME}-banner.png" @install -Dm644 -t "${DESTDIR}${PREFIX}/share/${PKGNAME}/images/" "${PKGNAME}-banner.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}.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}.warning.svg"

@ -25,7 +25,7 @@
#define LocalePath "/usr/share/locale" #define LocalePath "/usr/share/locale"
#define LocaleName "ubl-settings-repomanager" #define LocaleName "ubl-settings-repomanager"
typedef char* string; typedef char* string;
string version_application = "1.0"; string version_application;
char *local; char *local;

Loading…
Cancel
Save