/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Teddy Hogeborn
  • Date: 2008-08-11 20:16:35 UTC
  • mfrom: (24.1.45 mandos)
  • Revision ID: teddy@fukt.bsnet.se-20080811201635-1vor0gz43trtily1
Merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
WARN=-O -Wall -Wformat=2 -Winit-self -Wmissing-include-dirs \
2
 
        -Wswitch-default -Wswitch-enum -Wunused-parameter \
3
 
        -Wstrict-aliasing=2 -Wextra -Wfloat-equal -Wundef -Wshadow \
4
 
        -Wunsafe-loop-optimizations -Wpointer-arith \
5
 
        -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings \
6
 
        -Wconversion -Wstrict-prototypes -Wold-style-definition \
7
 
        -Wpacked -Wnested-externs -Wunreachable-code -Winline \
8
 
        -Wvolatile-register-var
 
1
WARN=-O -Wall -Wformat=2 -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-parameter -Wstrict-aliasing=2 -Wextra -Wfloat-equal -Wundef -Wshadow -Wunsafe-loop-optimizations -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wold-style-definition -Wpacked -Wnested-externs -Wunreachable-code -Winline -Wvolatile-register-var 
9
2
DEBUG=-ggdb3
10
3
# For info about _FORTIFY_SOURCE, see
11
4
# <http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html>
13
6
#COVERAGE=--coverage
14
7
OPTIMIZE=-Os
15
8
LANGUAGE=-std=gnu99
16
 
# PREFIX=/usr/local
17
 
PREFIX=/usr
18
 
# CONFDIR=/usr/local/lib/mandos
19
 
CONFDIR=/etc/mandos
20
 
# MANDIR=/usr/local/man
21
 
MANDIR=/usr/share/man
22
9
 
23
10
# Do not change these two
24
11
CFLAGS=$(WARN) $(DEBUG) $(FORTIFY) $(COVERAGE) $(OPTIMIZE) $(LANGUAGE)
31
18
        --param man.output.quietly              1 \
32
19
        --param man.authors.section.enabled     0
33
20
 
34
 
PLUGINS=plugins.d/password-prompt plugins.d/password-request
35
 
PROGS=plugin-runner $(PLUGINS)
36
 
DOCS=mandos.8 plugin-runner.8mandos mandos-keygen.8 \
37
 
        plugins.d/password-request.8mandos \
38
 
        plugins.d/password-prompt.8mandos mandos.conf.5 \
39
 
        mandos-clients.conf.5
 
21
PROGS=mandos-client plugins.d/password-request plugins.d/password-prompt
 
22
DOCS=mandos.8 mandos-client.8mandos plugins.d/password-request.8mandos plugins.d/password-prompt.8mandos mandos.conf.5 mandos-clients.conf.5
40
23
 
41
24
objects=$(shell for p in $(PROGS); do echo $${p}.o; done)
42
25
 
43
 
all: $(PROGS)
44
 
 
45
 
doc: $(DOCS)
 
26
all: $(PROGS) $(DOCS)
46
27
 
47
28
%.5: %.xml
48
 
        cd $(dir $^); $(DOCBOOKTOMAN) $(notdir $^)
 
29
        cd $(shell dirname $^); $(DOCBOOKTOMAN) $(shell basename $^)
49
30
 
50
31
%.8: %.xml
51
 
        cd $(dir $^); $(DOCBOOKTOMAN) $(notdir $^)
 
32
        cd $(shell dirname $^); $(DOCBOOKTOMAN) $(shell basename $^)
52
33
 
53
34
%.8mandos: %.xml
54
 
        cd $(dir $^); $(DOCBOOKTOMAN) $(notdir $^)
 
35
        cd $(shell dirname $^); $(DOCBOOKTOMAN) $(shell basename $^)
55
36
 
56
 
plugin-runner: plugin-runner.o
 
37
mandos-client: mandos-client.o
57
38
        $(LINK.o) -lgnutls $(COMMON) $^ $(LOADLIBES) $(LDLIBS) -o $@
58
39
 
59
40
plugins.d/password-request: plugins.d/password-request.o
60
 
        $(LINK.o) -lgnutls -lavahi-core -lgpgme $(COMMON) $^ \
61
 
                $(LOADLIBES) $(LDLIBS) -o $@
 
41
        $(LINK.o) -lgnutls -lavahi-core -lgpgme $(COMMON) $^ $(LOADLIBES) $(LDLIBS) -o $@
62
42
 
63
43
plugins.d/password-prompt: plugins.d/password-prompt.o
64
44
        $(LINK.o) $(COMMON) $^ $(LOADLIBES) $(LDLIBS) -o $@
65
45
 
66
 
.PHONY : all clean distclean run-client run-server install \
67
 
        install-server install-client uninstall uninstall-server \
68
 
        uninstall-client purge purge-server purge-client
 
46
.PHONY : all clean distclean run-client run-server
69
47
 
70
48
clean:
71
49
        -rm --force $(PROGS) $(objects) $(DOCS) core
73
51
distclean: clean
74
52
mostlyclean: clean
75
53
maintainer-clean: clean
76
 
        -rm --force --recursive keydir
77
54
 
78
 
check:
 
55
check: all
79
56
        ./mandos --check
80
57
 
81
58
run-client: all
82
 
        -mkdir keydir
83
 
        -./mandos-keygen --dir keydir
84
 
        ./plugin-runner --plugin-dir=plugins.d \
85
 
                --options-for=password-request:--keydir=keydir
 
59
        ./mandos-client --plugin-dir=plugins.d --options-for=password-request:--keydir=keydir
86
60
 
87
 
run-server:
 
61
run-server: all
88
62
        ./mandos --debug --configdir=.
89
 
 
90
 
install: install-server install-client
91
 
 
92
 
install-server: doc
93
 
        mkdir --mode=0755 --parents $(CONFDIR) $(MANDIR)/man5 \
94
 
                $(MANDIR)/man8
95
 
        install --mode=0755 mandos $(PREFIX)/sbin/mandos
96
 
        install --mode=0644 --target-directory=$(CONFDIR) mandos.conf
97
 
        install --mode=0640 --target-directory=$(CONFDIR) \
98
 
                clients.conf
99
 
        gzip --best --to-stdout mandos.8 \
100
 
                > $(MANDIR)/man8/mandos.8.gz
101
 
        gzip --best --to-stdout mandos.conf.5 \
102
 
                > $(MANDIR)/man5/mandos.conf.5.gz
103
 
        gzip --best --to-stdout mandos-clients.conf.5 \
104
 
                > $(MANDIR)/man5/mandos-clients.conf.5.gz
105
 
 
106
 
install-client: all doc /usr/share/initramfs-tools/hooks/.
107
 
        mkdir --mode=0755 --parents $(PREFIX)/lib/mandos $(CONFDIR) \
108
 
                $(MANDIR)/man8
109
 
        -mkdir --mode=0700 $(PREFIX)/lib/mandos/plugins.d
110
 
        chmod u=rwx,g=,o= $(PREFIX)/lib/mandos/plugins.d
111
 
        install --mode=0755 --target-directory=$(PREFIX)/lib/mandos \
112
 
                plugin-runner
113
 
        install --mode=0755 --target-directory=$(PREFIX)/sbin \
114
 
                mandos-keygen
115
 
        install --mode=0755 \
116
 
                --target-directory=$(PREFIX)/lib/mandos/plugins.d \
117
 
                plugins.d/password-prompt
118
 
        install --mode=4755 \
119
 
                --target-directory=$(PREFIX)/lib/mandos/plugins.d \
120
 
                plugins.d/password-request
121
 
        install initramfs-tools-hook \
122
 
                /usr/share/initramfs-tools/hooks/mandos
123
 
        install initramfs-tools-hook-conf \
124
 
                /usr/share/initramfs-tools/conf-hooks.d/mandos
125
 
        install initramfs-tools-script \
126
 
                /usr/share/initramfs-tools/scripts/local-top/mandos
127
 
        gzip --best --to-stdout mandos-keygen.8 \
128
 
                > $(MANDIR)/man8/mandos-keygen.8.gz
129
 
        gzip --best --to-stdout plugin-runner.8mandos \
130
 
                > $(MANDIR)/man8/plugin-runner.8mandos.gz
131
 
        gzip --best --to-stdout plugins.d/password-prompt.8mandos \
132
 
                > $(MANDIR)/man8/password-prompt.8mandos.gz
133
 
        gzip --best --to-stdout plugins.d/password-request.8mandos \
134
 
                > $(MANDIR)/man8/password-request.8mandos.gz
135
 
        -$(PREFIX)/sbin/mandos-keygen
136
 
        update-initramfs -k all -u
137
 
 
138
 
uninstall: uninstall-server uninstall-client
139
 
 
140
 
uninstall-server: $(PREFIX)/sbin/mandos
141
 
        -rm --force $(PREFIX)/sbin/mandos \
142
 
                $(MANDIR)/man8/mandos.8.gz \
143
 
                $(MANDIR)/man5/mandos.conf.5.gz \
144
 
                $(MANDIR)/man5/mandos-clients.conf.5.gz
145
 
        -rmdir $(CONFDIR)
146
 
 
147
 
uninstall-client:
148
 
# Refuse to uninstall client if /etc/crypttab is explicitly configured
149
 
# to use it.
150
 
        ! grep --regexp='^ *[^ #].*keyscript=[^,=]*/mandos/' \
151
 
                /etc/crypttab
152
 
        -rm --force $(PREFIX)/sbin/mandos-keygen \
153
 
                $(PREFIX)/lib/mandos/plugin-runner \
154
 
                $(PREFIX)/lib/mandos/plugins.d/password-prompt \
155
 
                $(PREFIX)/lib/mandos/plugins.d/password-request \
156
 
                /usr/share/initramfs-tools/hooks/mandos \
157
 
                /usr/share/initramfs-tools/conf-hooks.d/mandos \
158
 
                $(MANDIR)/man8/plugin-runner.8mandos.gz \
159
 
                $(MANDIR)/man8/mandos-keygen.8.gz \
160
 
                $(MANDIR)/man8/password-prompt.8mandos.gz \
161
 
                $(MANDIR)/man8/password-request.8mandos.gz
162
 
        -rmdir $(PREFIX)/lib/mandos/plugins.d $(CONFDIR)/plugins.d \
163
 
                 $(PREFIX)/lib/mandos $(CONFDIR)
164
 
        update-initramfs -k all -u
165
 
 
166
 
purge: purge-server purge-client
167
 
 
168
 
purge-server: uninstall-server
169
 
        -rm --force $(CONFDIR)/mandos.conf $(CONFDIR)/clients.conf
170
 
        -rmdir $(CONFDIR)
171
 
 
172
 
purge-client: uninstall-client
173
 
        -rm --force $(CONFDIR)/seckey.txt $(CONFDIR)/pubkey.txt
174
 
        -rmdir $(CONFDIR) $(CONFDIR)/plugins.d