Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 81 lines (66 sloc) 1.833 kb
e5a8d5b @falconindy standardize file headers and add MIT licensee
authored
1 #
2 # Makefile
3 #
4 # This file is part of geninit.
5 #
6
75052c2 @falconindy initial commit
authored
7 VERSION = 0.1
8
0eb2d67 @falconindy merge dinit into base directory
authored
9 all: init doc
75052c2 @falconindy initial commit
authored
10
0eb2d67 @falconindy merge dinit into base directory
authored
11 CC ?= cc
12 CPPFLAGS +=
db406fc @falconindy cleanup Makefile
authored
13 CFLAGS += -std=c99 -Wall -pedantic -Wextra ${CPPFLAGS}
0eb2d67 @falconindy merge dinit into base directory
authored
14 LDFLAGS := -lblkid ${LDFLAGS}
15
16f2dde @falconindy restructure Makefile
authored
16 DIRS := \
17 ${PREFIX}/share/geninit/builders \
18 ${PREFIX}/share/geninit/hooks \
19 ${PREFIX}/sbin \
20 ${PREFIX}/bin \
21 /etc/geninit.d
22
af8ca64 @falconindy add dist target
authored
23 DISTFILES := \
24 builders/ \
25 hooks/ \
26 geninit.conf \
27 geninit.api \
f2136d7 @falconindy add quirks file for quirky modules
authored
28 geninit.quirks \
af8ca64 @falconindy add dist target
authored
29 geninit \
fedd108 @falconindy add new util: lsinitramfs
authored
30 lsinitramfs \
76792f5 @falconindy add libinit to Makefile and base builder
authored
31 libinit \
af8ca64 @falconindy add dist target
authored
32 init.c \
33 example.preset \
34 Makefile
35
0eb2d67 @falconindy merge dinit into base directory
authored
36 init: init.c
37 ${CC} -c ${CFLAGS} ${CPPFLAGS} init.c
38 ${CC} -o $@ ${LDFLAGS} init.o
39
1373c3e @falconindy add install-doc target
authored
40 install-doc: doc
16f2dde @falconindy restructure Makefile
authored
41 install -Dm644 geninit.8 ${DESTDIR}/share/man/man8/geninit.8
42 .PHONY: install-doc
43
44 install-dirs:
45 $(foreach dir,${DIRS},install -dm755 ${DESTDIR}${dir};)
46 .PHONY: install-dirs
1373c3e @falconindy add install-doc target
authored
47
16f2dde @falconindy restructure Makefile
authored
48 install: init install-dirs install-doc
49 install -m644 -t ${DESTDIR}/etc geninit.conf
50 install -m644 -t ${DESTDIR}/etc/geninit.d example.preset
db406fc @falconindy cleanup Makefile
authored
51 install -m755 -t ${DESTDIR}${PREFIX}/share/geninit/hooks hooks/*
52 install -m644 -t ${DESTDIR}${PREFIX}/share/geninit/builders builders/*
16f2dde @falconindy restructure Makefile
authored
53 install -m644 -t ${DESTDIR}${PREFIX}/share/geninit libinit geninit.api geninit.quirks
54 install -m755 -t ${DESTDIR}${PREFIX}/share/geninit init
fedd108 @falconindy add new util: lsinitramfs
authored
55 install -m755 -t ${DESTDIR}${PREFIX}/bin lsinitramfs
16f2dde @falconindy restructure Makefile
authored
56 sed "s#^\(declare.\+_sharedir\)=.*#\1=${PREFIX}/share/geninit#" < \
57 geninit > ${DESTDIR}${PREFIX}/sbin/geninit
af8ca64 @falconindy add dist target
authored
58 chmod 755 ${DESTDIR}${PREFIX}/sbin/geninit
75052c2 @falconindy initial commit
authored
59 .PHONY: install
60
0eb2d67 @falconindy merge dinit into base directory
authored
61 strip: init
62 strip --strip-all init
db406fc @falconindy cleanup Makefile
authored
63 .PHONY: strip
0eb2d67 @falconindy merge dinit into base directory
authored
64
855cefa @falconindy add the beginnings of a man page
authored
65 doc: geninit.8
66 geninit.8: README.pod
67 pod2man --section=8 --center="geninit manual" --name="GENINIT" --release="geninit ${VERSION}" $< > $@
75052c2 @falconindy initial commit
authored
68 .PHONY: doc
69
af8ca64 @falconindy add dist target
authored
70 dist:
71 mkdir geninit-${VERSION}
72 cp -r ${DISTFILES} geninit-${VERSION}
73 tar czf geninit-${VERSION}.tar.gz ${DISTFILES}
74 ${RM} -r geninit-${VERSION}
75 .PHONY:
76
75052c2 @falconindy initial commit
authored
77 clean:
a301e66 @falconindy remove generated manpage as part of cleaning
authored
78 ${RM} init.o init geninit.8
db406fc @falconindy cleanup Makefile
authored
79 .PHONY: clean
75052c2 @falconindy initial commit
authored
80
Something went wrong with that request. Please try again.