-
Notifications
You must be signed in to change notification settings - Fork 15
/
rules.mk
52 lines (46 loc) · 1.7 KB
/
rules.mk
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
#
# rules.mk
# This file is part of slide-switch.
#
# Copyright (C) 2016-2019, 2022 The slide-switch authors
# https://github.com/jefferyto/openwrt-slide-switch
#
# slide-switch is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# slide-switch 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 slide-switch. If not, see <http://www.gnu.org/licenses/>.
#
SUFFIXES = -cut -in
-cut-in:
$(AWK) 'p; /--8<----/ {p=1}' $< > $@
.json-in.json:
tr -d '[:space:]' < $< > $@
# https://www.gnu.org/software/make/manual/html_node/Directory-Variables.html
# https://www.gnu.org/software/automake/manual/html_node/Uniform.html#index-pkgdatadir
# https://www.gnu.org/software/automake/manual/html_node/Basics-of-Distribution.html#index-PACKAGE
.sh-in.sh:
sed \
-e 's,[@]prefix[@],$(prefix),g' \
-e 's,[@]exec_prefix[@],$(exec_prefix),g' \
-e 's,[@]bindir[@],$(bindir),g' \
-e 's,[@]sbindir[@],$(sbindir),g' \
-e 's,[@]libexecdir[@],$(libexecdir),g' \
-e 's,[@]datarootdir[@],$(datarootdir),g' \
-e 's,[@]datadir[@],$(datadir),g' \
-e 's,[@]sysconfdir[@],$(sysconfdir),g' \
-e 's,[@]sharedstatedir[@],$(sharedstatedir),g' \
-e 's,[@]localstatedir[@],$(localstatedir),g' \
-e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \
-e 's,[@]PACKAGE[@],$(PACKAGE),g' \
-e 's,[@]VERSION[@],$(VERSION),g' \
$< > $@
.sh:
cp $< $@
TESTS = $(dist_check_SCRIPTS)