-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
Makefile
57 lines (45 loc) · 1.49 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
SHELL = /bin/bash
DESTDIR :=
prefix ?= /usr/local
bindir ?= $(prefix)/bin
libdir ?= $(prefix)/lib
srcdir = Sources
repomandir = man
mandir := ${prefix}/share/man
REPODIR = $(shell pwd)
BUILDDIR = $(REPODIR)/.build
SOURCES = $(wildcard $(srcdir)/**/*.swift)
MANPAGES = $(wildcard $(repomandir)/**/swiftplantuml.1)
.DEFAULT_GOAL = all
create-man-files: $(SOURCES)
swift package plugin generate-manual
cp $(BUILDDIR)/plugins/GenerateManualPlugin/outputs/swiftplantuml/swiftplantuml.1 $(REPODIR)/man/swiftplantuml.1
install-man-files: $(SOURCES)
mkdir -p ${DESTDIR}${mandir}/man1
cp $(REPODIR)/man/swiftplantuml.1 ${DESTDIR}${mandir}/man1/swiftplantuml.1
create-and-install-man-files: $(SOURCES)
swift package plugin generate-manual
mkdir -p ${DESTDIR}${mandir}/man1
cp $(BUILDDIR)/plugins/GenerateManualPlugin/outputs/swiftplantuml/swiftplantuml.1 ${DESTDIR}${mandir}/man1/swiftplantuml.1
download-plantuml:
curl -L https://github.com/plantuml/plantuml/releases/download/v1.2022.14/plantuml.jar > plantuml.jar
build-swiftplantuml: $(SOURCES)
@swift build \
-c release \
--disable-sandbox \
--build-path "$(BUILDDIR)"
.PHONY: install
install: build-swiftplantuml
@install -d "$(bindir)"
@install "$(wildcard $(BUILDDIR)/**/release/swiftplantuml)" "$(bindir)"
@make install-man-files
.PHONY: uninstall
uninstall:
@rm -rf "$(bindir)/swiftplantuml"
@rm -rf /usr/local/share/man/man1/swiftplantuml.1
.PHONY: clean
distclean:
@rm -f $(BUILDDIR)/release
.PHONY: clean
clean: distclean
@rm -rf $(BUILDDIR)