-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
68 lines (52 loc) · 1.91 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
58
59
60
61
62
63
64
65
66
67
68
PROGRAM = Compile
VERSION = git-$(shell date +%Y%m%d)
goboPrograms ?= /Programs
PREFIX ?=
DESTDIR = $(PREFIX)/$(goboPrograms)/$(PROGRAM)/$(VERSION)
INSTALL_DIR = install -d
INSTALL_FILE = install
man_files = $(shell grep -l Parse_Options bin/* | xargs -i echo {}.1)
scripts = ApplyVariables Compile FetchArchive GoboPath2Ruby NewVersion PrepareProgram AutoPatch ContributeRecipe NoRecipe RecipeLint UnionSandbox ColorMake EditRecipe GetRecipe MakeRecipe SandboxInstall UpdateRecipes
.PHONY: all clean install uninstall
default: all
manuals: $(man_files)
$(man_files): %.1: %
@echo "Generating man page $@"
help2man --name=" " --source="GoboLinux" --no-info $< --output $@
clean_manuals:
@echo "Cleaning man pages"
echo $(man_files) | tr '\n' ' ' | xargs -d ' ' -n 1 rm -f
clean_resources:
rm -rf Resources/FileHash*
clean: clean_manuals clean_resources
install_manuals: manuals
@$(INSTALL_DIR) -d -m 755 $(DESTDIR)/share/man/man1
echo $(man_files) | tr '\n' ' ' | xargs -d ' ' -n 1 -i \
$(INSTALL_FILE) -m 644 {} $(DESTDIR)/share/man/man1
install_scripts:
@echo "Installing scripts"
$(INSTALL_DIR) -d -m 755 $(DESTDIR)/bin
echo $(scripts) | tr '\n' ' ' | xargs -d ' ' -n 1 -i \
$(INSTALL_FILE) -m 755 bin/{} $(DESTDIR)/bin
install_lib:
@echo "Installing lib"
$(INSTALL_DIR) -d -m 755 $(DESTDIR)
cp -r lib $(DESTDIR)
install_resources:
@echo "Installing Resources"
cp -r Resources $(DESTDIR)
install_share_data:
@echo "Installing share data"
cp -rf share $(DESTDIR)
install_functions:
@echo "Installing Functions"
cp -rf Functions $(DESTDIR)
install_docs:
@echo "Installing docs"
cp -rf doc $(DESTDIR)
cp -rf examples $(DESTDIR)/doc
prepare_install:
@echo "Installing $(PROGRAM) into $(DESTDIR)"
$(INSTALL_DIR) -d -m 755 $(DESTDIR)
install: install_scripts install_manuals prepare_install install_lib install_resources install_share_data install_functions
@echo "Installed $(PROGRAM) into $(DESTDIR)"