-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile.am
158 lines (128 loc) · 3.54 KB
/
Makefile.am
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
##
## Copyright (C) 2019 Red Hat, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
##
## Author(s): Attila Lakatos <[email protected]>
##
ACLOCAL_AMFLAGS = -I m4
CLEANFILES =
SUBDIRS = src/Tests/
bin_PROGRAMS = usbguard-notifier
if NOTIFIER_CLI_ENABLED
bin_PROGRAMS += \
usbguard-notifier-cli
endif
EXTRA_DIST = \
src/BuildConfig.h.in \
README.md \
LICENSE \
CHANGELOG.md \
src/ThirdParty/Catch2/single_include/catch2
usbguard_notifier_SOURCES = \
src/usbguard-icon.hpp \
src/Notifier.hpp \
src/NotifyWrapper.hpp \
src/Serializer.hpp \
src/Log.hpp \
src/Main.cpp \
src/Notifier.cpp \
src/NotifyWrapper.cpp \
src/Serializer.cpp \
src/Log.cpp
usbguard_notifier_LDFLAGS = \
@rsvg_LIBS@ \
@notify_LIBS@ \
@usbguard_LIBS@
usbguard_notifier_CXXFLAGS = \
@rsvg_CFLAGS@ \
@notify_CFLAGS@ \
@usbguard_CFLAGS@ \
-fPIC
if CUSTOM_USBGUARD_DEVEL_ENABLED
usbguard_notifier_LDADD = \
@usbguard_LA@
usbguard_notifier_cli_LDADD = \
@usbguard_LA@
endif
BUILT_SOURCES = \
src/BuildConfig.h \
src/usbguard-icon.hpp
usbguard_notifier_cli_SOURCES = \
src/Serializer.hpp \
src/NotifierCLI.hpp \
src/Serializer.cpp \
src/NotifierCLI.cpp \
src/MainCli.cpp
usbguard_notifier_cli_LDFLAGS = \
@usbguard_LIBS@
usbguard_notifier_cli_CXXFLAGS = \
@usbguard_CFLAGS@ \
-fPIC
#
# manual pages
#
SUFFIXES = .adoc
man_ADOC_FILES = \
$(top_builddir)/man/usbguard-notifier.1
if NOTIFIER_CLI_ENABLED
man_ADOC_FILES += \
$(top_builddir)/man/usbguard-notifier-cli.1
endif
.adoc:
$(A2X) -f manpage $^
man1_MANS = \
$(man_ADOC_FILES)
CLEANFILES += \
$(man_ADOC_FILES)
EXTRA_DIST += \
$(man_ADOC_FILES)
#
# usbguard icon
#
EXTRA_DIST += \
$(top_builddir)/icons/usbguard-icon.svg
$(top_builddir)/src/usbguard-icon.hpp: $(top_builddir)/icons/usbguard-icon.svg
echo -e "#ifndef ICON_HPP\n#define ICON_HPP\nnamespace notify {\nconst char *icon =" > $@
$(SED) 's/"/\\"/g' $^ | $(SED) 's/^/"/' | $(SED) 's/$$/\\n"/' >> $@
echo -e ";\n}\n#endif" >> $@
CLEANFILES += \
$(top_builddir)/src/usbguard-icon.hpp
#
# unit file
#
install-data-hook: install-systemd-service
uninstall-hook: uninstall-systemd-service
CLEANFILES += $(top_builddir)/usbguard-notifier.service
#
# Notifier service
#
EXTRA_DIST += \
$(top_srcdir)/usbguard-notifier.service.in
usbguard-notifier.service: $(top_srcdir)/usbguard-notifier.service.in
$(SED) -e "s|%bindir%|${bindir}|" $^ > $@ || rm -f $@
install-systemd-service: $(top_builddir)/usbguard-notifier.service
$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
$(INSTALL) -m 644 $(top_builddir)/usbguard-notifier.service \
$(DESTDIR)$(SYSTEMD_UNIT_DIR)/usbguard-notifier.service
uninstall-systemd-service:
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/usbguard-notifier.service
CLEANFILES += $(top_builddir)/usbguard-notifier.service
#
# Common defines
#
$(top_builddir)/src/BuildConfig.h: $(top_builddir)/src/BuildConfig.h.in
$(SED) -e "s|%NOTIFICATION_PATH%|@NOTIFICATION_PATH@|g" $^ > $@ || rm -f $@
$(MKDIR_P) @NOTIFICATION_PATH@
CLEANFILES += $(top_builddir)/src/BuildConfig.h