-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (55 loc) · 2.31 KB
/
Makefile
File metadata and controls
66 lines (55 loc) · 2.31 KB
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
# StateCraft
# A CLI tool to create complex directory structures via scripts on Linux.
#
# StateCraft is a CLI tool for creating Linux directory trees via scripts.
# It supports mounting snapshots, creating files, archives, and more.
# Designed for admins seeking flexible, scriptable backup setups.
#
# Copyright (C) 2025 Daniel Rudolf <https://www.daniel-rudolf.de>
#
# 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, version 3 of the License only.
#
# 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/>.
#
# License: GNU General Public License <https://opensource.org/license/gpl-3-0>
# SPDX-License-Identifier: GPL-3.0-only
SHELL = /bin/sh
INSTALL ?= install
INSTALL_PROGRAM ?= $(INSTALL)
INSTALL_DATA ?= $(INSTALL) -m644
srcdir ?= .
prefix ?= /usr/local
exec_prefix ?= $(prefix)
bindir ?= $(exec_prefix)/bin
libdir ?= $(exec_prefix)/lib/statecraft
datarootdir ?= $(prefix)/share
docdir ?= $(datarootdir)/doc/statecraft
licensedir ?= $(datarootdir)/licenses/statecraft
.PHONY: all install uninstall clean
all:
@echo "Nothing to build."
install:
$(INSTALL) -d "$(DESTDIR)$(bindir)"
$(INSTALL_PROGRAM) -D "$(srcdir)/src/bin/statecraft" "$(DESTDIR)$(bindir)/statecraft"
$(INSTALL) -d "$(DESTDIR)$(libdir)"
(cd "$(srcdir)/src/lib/statecraft"; find -type d -print0) | xargs -t -0 -I{} \
$(INSTALL) -d "$(DESTDIR)$(libdir)/{}"
(cd "$(srcdir)/src/lib/statecraft"; find -type f -not -name '.gitignore' -print0) | xargs -t -0 -I{} \
$(INSTALL_DATA) "$(srcdir)/src/lib/statecraft/{}" "$(DESTDIR)$(libdir)/{}"
$(INSTALL) -d "$(DESTDIR)$(docdir)" "$(DESTDIR)$(licensedir)"
$(INSTALL_DATA) -D "$(srcdir)/README.md" "$(DESTDIR)$(docdir)/README.md"
$(INSTALL_DATA) -D "$(srcdir)/LICENSE" "$(DESTDIR)$(licensedir)/LICENSE"
uninstall:
rm -f "$(DESTDIR)$(bindir)/statecraft"
rm -rf "$(DESTDIR)$(libdir)"
rm -rf "$(DESTDIR)$(docdir)" "$(DESTDIR)$(licensedir)"
clean:
@echo "Nothing to clean."