forked from qwinff/qwinff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
83 lines (67 loc) · 2.4 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Build Parameters
# You can change these parameters to customize the build.
# Installation Prefix
PREFIX?=/usr
# Version ID String (displayed after the version string in the about dialog)
VIDSTR=
###############################
# Variables here are not meant to be changed.
# Paths
PROJECT_ROOT=$(PWD)
SRC_DIR=$(PROJECT_ROOT)/src
BUILD_DIR=$(PROJECT_ROOT)/build
BIN_DIR=$(PROJECT_ROOT)/bin
DATA_PATH=$(PREFIX)/share/qwinff
TRANSLATION_PATH=$(DATA_PATH)/translations
# Tools
QMAKE=qmake
LRELEASE=lrelease
# Settings
QMAKE_DEFS= DESTDIR=$(BIN_DIR) \
OBJECTS_DIR=$(BUILD_DIR)/obj \
MOC_DIR=$(BUILD_DIR)/moc \
RCC_DIR=$(BUILD_DIR)/rcc \
UI_DIR=$(BUILD_DIR)/ui \
DEFINES+=QT_NO_DEBUG_OUTPUT
DEFS= DATA_PATH=\\\"$(DATA_PATH)\\\" \
VERSION_ID_STRING=\\\"$(VIDSTR)\\\"
USE_LIBNOTIFY=0
ifneq ($(USE_LIBNOTIFY),0)
QMAKE_DEFS += CONFIG+=libnotify
endif
all: release
release:
+cd $(SRC_DIR) && $(QMAKE) $(QMAKE_DEFS) qwinff.pro && $(DEFS) $(MAKE)
-cd src && $(LRELEASE) qwinff.pro
check:
cd $(SRC_DIR)/tests && sh run-tests.sh
clean:
rm -rf $(BIN_DIR)/*
rm -rf $(BUILD_DIR)/*
-cd $(SRC_DIR) && $(MAKE) clean && rm Makefile
install:
-install -d $(DESTDIR)$(PREFIX)/bin/
install -m 755 bin/qwinff $(DESTDIR)$(PREFIX)/bin/
-install -d $(DESTDIR)$(DATA_PATH)
install -m 644 src/presets.xml $(DESTDIR)$(DATA_PATH)
install -m 644 src/constants.xml $(DESTDIR)$(DATA_PATH)
-install -d $(DESTDIR)$(TRANSLATION_PATH)
-install -m 644 src/translations/*.qm $(DESTDIR)$(TRANSLATION_PATH)
-install -d $(DESTDIR)$(PREFIX)/share/man/man1
install -m 644 man/qwinff.1 $(DESTDIR)$(PREFIX)/share/man/man1/
-install -d $(DESTDIR)$(PREFIX)/share/applications
install -m 644 qwinff.desktop $(DESTDIR)$(PREFIX)/share/applications/
-install -d $(DESTDIR)$(PREFIX)/share/pixmaps
install -m 644 src/icons/qwinff_256x256.png $(DESTDIR)$(PREFIX)/share/pixmaps/qwinff.png
gzip -9 -f $(DESTDIR)$(PREFIX)/share/man/man1/qwinff.1
uninstall:
-rm -f $(DESTDIR)$(PREFIX)/bin/qwinff
-rm -f $(DESTDIR)$(DATA_PATH)/presets.xml
-rm -f $(DESTDIR)$(DATA_PATH)/constants.xml
-rm -f $(DESTDIR)$(TRANSLATION_PATH)/*.qm
-rmdir $(DESTDIR)$(TRANSLATION_PATH)
-rmdir $(DESTDIR)$(DATA_PATH)
-rm -f $(DESTDIR)$(PREFIX)/share/applications/qwinff.desktop
-rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/qwinff.png
-rm -f $(DESTDIR)$(PREFIX)/share/man/man1/qwinff.1.gz
.PHONY: all release check clean install uninstall