-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·53 lines (40 loc) · 1.97 KB
/
Makefile
File metadata and controls
executable file
·53 lines (40 loc) · 1.97 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
#!/usr/bin/make -f
# Makefile for debirf
# (c) 2008-2011 Jameson Graef Rollins <jrollins@finestructure.net>
# Daniel Kahn Gillmor <dkg@fifthhorseman.net>
# Licensed under GPL v3 or later
VERSION := `head -n1 debian/changelog | sed 's/.*(\([^-)]*\).*/\1/'`
BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date)
PREFIX ?= /usr
MANPREFIX ?= $(PREFIX)/share/man
PROFILES = minimal rescue
PROFILE_TARBALLS = $(foreach profile,$(PROFILES),doc/example-profiles/$(profile).tgz)
PROFILE_MODULES = $(foreach profile,$(PROFILES),doc/example-profiles/$(profile)/modules)
default: $(PROFILE_TARBALLS)
doc/example-profiles/%/modules: doc/example-profiles/%.modules
mkdir -p "$@"
for m in $(shell cat $<); do ln -s /usr/share/debirf/modules/$$m $@/; done
doc/example-profiles/%.tgz: doc/example-profiles/% doc/example-profiles/%/modules
(cd doc/example-profiles && tar c --sort=name --mtime="$(BUILD_DATE)" --owner=0 --group=0 --numeric-owner --mode=u=rwX,go=rX --exclude='*~' $(notdir $<)) | gzip -9 -n > "$@"
install: installman profiles
mkdir -p $(DESTDIR)$(PREFIX)/bin
mkdir -p $(DESTDIR)$(PREFIX)/share/doc/debirf/example-profiles
mkdir -p $(DESTDIR)$(PREFIX)/share/debirf/modules
install src/debirf $(DESTDIR)$(PREFIX)/bin
install src/common $(DESTDIR)$(PREFIX)/share/debirf
install --mode=644 src/packages $(DESTDIR)$(PREFIX)/share/debirf
install --mode=644 src/devices.tar.gz $(DESTDIR)$(PREFIX)/share/debirf
install src/modules/* $(DESTDIR)$(PREFIX)/share/debirf/modules
echo $(VERSION) > $(DESTDIR)$(PREFIX)/share/debirf/version
install doc/README $(DESTDIR)$(PREFIX)/share/doc/debirf
install doc/autobuilder $(DESTDIR)$(PREFIX)/share/doc/debirf
install doc/example-profiles/*.tgz $(DESTDIR)$(PREFIX)/share/doc/debirf/example-profiles
installman:
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
gzip -n man/*/*
install man/man1/* $(DESTDIR)$(MANPREFIX)/man1
gzip -d man/*/*
clean:
rm -f $(PROFILE_TARBALLS)
rm -rf $(PROFILE_MODULES)
.PHONY: default install installman profiles clean