-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
38 lines (30 loc) · 1.23 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
##
## usage:
## $ make install
##
MANPAGES = /usr/share/man
DOCSETSDIR = $(HOME)/.local/share/Zeal/Zeal/docsets
DOCSETNAME = Linux Man Pages
# the supplied DOCSETNAME, with spaces replaced by underscores
DOCSETNAME_ = $(subst $(null) $(null),_,$(DOCSETNAME))
# workaround to allow subst'ing a space, since it normally trims whitespace
null =
# if not supplied, mandocset.py defaults to first word of DOCSETNAME_, split on underscores
#SHORTCUT = man
ICON = etc/tux.png
ICON2X = $(ICON:[email protected])
MAYBEDO = $(if $(DRYRUN),echo)
docset: $(DOCSETNAME_).docset/Contents/Info.plist
install: $(DOCSETSDIR)/$(DOCSETNAME_).docset/Contents/Info.plist
clean:
$(MAYBEDO) rm -rf $(DOCSETNAME_).docset
reallyclean: clean
$(MAYBEDO) rm -rf $(DOCSETSDIR)/$(DOCSETNAME_).docset
$(DOCSETNAME_).docset/Contents/Info.plist:
$(MAYBEDO) python3 mandocset.py -o $(DOCSETNAME_) -i $(ICON) -I $(ICON2X) -p $(MANPAGES)
ifneq ($(SHORTCUT),)
$(MAYBEDO) sed -i "/DocSetPlatformFamily/{N;s^<string>.*</string>^<string>$(SHORTCUT)</string>^;}" $@
endif
# use 'cp -r' here if you don't have 'rsync' installed
$(DOCSETSDIR)/$(DOCSETNAME_).docset/Contents/Info.plist: $(DOCSETNAME_).docset/Contents/Info.plist
$(MAYBEDO) rsync -av --delete $(DOCSETNAME_).docset $(DOCSETSDIR)