Permalink
Newer
Older
100644 68 lines (55 sloc) 1.63 KB
1
#
2
# Makefile
3
#
4
# This file is part of geninit.
5
#
6
@falconindy
Apr 27, 2011
7
VERSION = 0.1
8
9
all: init doc
@falconindy
Apr 27, 2011
10
11
CC ?= cc
12
CPPFLAGS +=
@falconindy
Apr 28, 2011
13
CFLAGS += -std=c99 -Wall -pedantic -Wextra ${CPPFLAGS}
14
LDFLAGS := -lblkid ${LDFLAGS}
15
@falconindy
Apr 28, 2011
16
DISTFILES := \
17
builders/ \
18
hooks/ \
19
geninit.conf \
20
geninit.api \
21
geninit.quirks \
@falconindy
Apr 28, 2011
22
geninit \
23
init.c \
24
example.preset \
25
Makefile
26
27
init: init.c
28
${CC} -c ${CFLAGS} ${CPPFLAGS} init.c
29
${CC} -o $@ ${LDFLAGS} init.o
30
31
install-doc: doc
32
install -Dm644 geninit.8 ${DESTDIR}${PREFIX}/share/man/man8/geninit.8
33
34
install: init install-doc
@falconindy
Apr 28, 2011
35
install -dm755 ${DESTDIR}${PREFIX}/share/geninit/builders
36
install -dm755 ${DESTDIR}${PREFIX}/share/geninit/hooks
37
install -dm755 ${DESTDIR}${PREFIX}/sbin
38
install -Dm644 geninit.conf ${DESTDIR}/etc/geninit.conf
39
install -Dm644 example.preset ${DESTDIR}/etc/geninit.d/example.preset
@falconindy
Apr 28, 2011
40
install -m755 -t ${DESTDIR}${PREFIX}/share/geninit/hooks hooks/*
41
install -m644 -t ${DESTDIR}${PREFIX}/share/geninit/builders builders/*
@falconindy
Apr 29, 2011
42
install -m644 -t ${DESTDIR}${PREFIX}/share/geninit geninit.api geninit.quirks
@falconindy
Apr 28, 2011
43
install -m755 -t ${DESTDIR}${PREFIX}/share/geninit init
44
sed "s#^\(declare.\+_sharedir\)=.*#\1=${PREFIX}/share/geninit#" < geninit > ${DESTDIR}${PREFIX}/sbin/geninit
@falconindy
Apr 28, 2011
45
chmod 755 ${DESTDIR}${PREFIX}/sbin/geninit
@falconindy
Apr 27, 2011
46
.PHONY: install
47
48
strip: init
49
strip --strip-all init
@falconindy
Apr 28, 2011
50
.PHONY: strip
52
doc: geninit.8
53
geninit.8: README.pod
54
pod2man --section=8 --center="geninit manual" --name="GENINIT" --release="geninit ${VERSION}" $< > $@
@falconindy
Apr 27, 2011
55
.PHONY: doc
56
@falconindy
Apr 28, 2011
57
dist:
58
mkdir geninit-${VERSION}
59
cp -r ${DISTFILES} geninit-${VERSION}
60
tar czf geninit-${VERSION}.tar.gz ${DISTFILES}
61
${RM} -r geninit-${VERSION}
62
.PHONY:
63
@falconindy
Apr 27, 2011
64
clean:
65
${RM} init.o init geninit.8
@falconindy
Apr 28, 2011
66
.PHONY: clean
@falconindy
Apr 27, 2011
67