/mandos/trunk

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

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Teddy Hogeborn
  • Date: 2008-08-12 06:46:11 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080812064611-7wfjg391ypmff085
* mandos-keygen: New program to generate new client keys on
                 installation.

* Makefile (all): No longer build documentation.
  (doc): New; build documentation.
  (maintainer-clean): Remove build-local client keydir.
  (run-client): Make build-local keydir with keys.
  (run-server): Do not depend on "all".
  (install, install-server, install-client, uninstall,
  uninstall-server, uninstall-client, purge, purge-server,
  purge-client): New.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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 
 
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
2
9
DEBUG=-ggdb3
3
10
# For info about _FORTIFY_SOURCE, see
4
11
# <http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html>
18
25
        --param man.output.quietly              1 \
19
26
        --param man.authors.section.enabled     0
20
27
 
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
 
28
PLUGINS=plugins.d/password-prompt plugins.d/password-request
 
29
PROGS=mandos-client $(PLUGINS)
 
30
DOCS=mandos.8 mandos-client.8mandos mandos-keygen.8 \
 
31
        plugins.d/password-request.8mandos \
 
32
        plugins.d/password-prompt.8mandos mandos.conf.5 \
 
33
         mandos-clients.conf.5
23
34
 
24
35
objects=$(shell for p in $(PROGS); do echo $${p}.o; done)
25
36
 
26
 
all: $(PROGS) $(DOCS)
 
37
all: $(PROGS)
 
38
 
 
39
doc: $(DOCS)
27
40
 
28
41
%.5: %.xml
29
 
        cd $(shell dirname $^); $(DOCBOOKTOMAN) $(shell basename $^)
 
42
        cd $(dir $^); $(DOCBOOKTOMAN) $(notdir $^)
30
43
 
31
44
%.8: %.xml
32
 
        cd $(shell dirname $^); $(DOCBOOKTOMAN) $(shell basename $^)
 
45
        cd $(dir $^); $(DOCBOOKTOMAN) $(notdir $^)
33
46
 
34
47
%.8mandos: %.xml
35
 
        cd $(shell dirname $^); $(DOCBOOKTOMAN) $(shell basename $^)
 
48
        cd $(dir $^); $(DOCBOOKTOMAN) $(notdir $^)
36
49
 
37
50
mandos-client: mandos-client.o
38
51
        $(LINK.o) -lgnutls $(COMMON) $^ $(LOADLIBES) $(LDLIBS) -o $@
39
52
 
40
53
plugins.d/password-request: plugins.d/password-request.o
41
 
        $(LINK.o) -lgnutls -lavahi-core -lgpgme $(COMMON) $^ $(LOADLIBES) $(LDLIBS) -o $@
 
54
        $(LINK.o) -lgnutls -lavahi-core -lgpgme $(COMMON) $^ \
 
55
                $(LOADLIBES) $(LDLIBS) -o $@
42
56
 
43
57
plugins.d/password-prompt: plugins.d/password-prompt.o
44
58
        $(LINK.o) $(COMMON) $^ $(LOADLIBES) $(LDLIBS) -o $@
45
59
 
46
 
.PHONY : all clean distclean run-client run-server
 
60
.PHONY : all clean distclean run-client run-server install \
 
61
        install-server install-client uninstall uninstall-server \
 
62
        uninstall-client purge purge-server purge-client
47
63
 
48
64
clean:
49
65
        -rm --force $(PROGS) $(objects) $(DOCS) core
51
67
distclean: clean
52
68
mostlyclean: clean
53
69
maintainer-clean: clean
 
70
        -rm --force --recursive keydir
54
71
 
55
 
check: all
 
72
check:
56
73
        ./mandos --check
57
74
 
58
75
run-client: all
59
 
        ./mandos-client --plugin-dir=plugins.d --options-for=password-request:--keydir=keydir
 
76
        -mkdir keydir
 
77
        -./mandos-keygen --dir keydir
 
78
        ./mandos-client --plugin-dir=plugins.d \
 
79
                --options-for=password-request:--keydir=keydir
60
80
 
61
 
run-server: all
 
81
run-server:
62
82
        ./mandos --debug --configdir=.
 
83
 
 
84
install: install-server install-client
 
85
 
 
86
install-server: doc
 
87
        mkdir --mode=0755 --parents /etc/mandos
 
88
        install --mode=0755 mandos /usr/sbin/mandos
 
89
        install --mode=0644 --target-directory=/etc/mandos mandos.conf
 
90
        install --mode=0640 --target-directory=/etc/mandos \
 
91
                clients.conf
 
92
        gzip --best --to-stdout mandos.8 \
 
93
                > /usr/share/man/man8/mandos.8.gz
 
94
        gzip --best --to-stdout mandos.conf.5 \
 
95
                > /usr/share/man/man5/mandos.conf.5.gz
 
96
        gzip --best --to-stdout mandos-clients.conf.5 \
 
97
                > /usr/share/man/man5/mandos-clients.conf.5.gz
 
98
 
 
99
install-client: all doc /usr/share/initramfs-tools/hooks/.
 
100
        mkdir --mode=0755 --parents /usr/lib/mandos /etc/mandos
 
101
        mkdir --mode=0700 /usr/lib/mandos/plugins.d
 
102
        chmod u=rwx,g=,o= /usr/lib/mandos/plugins.d
 
103
        install --mode=0755 --target-directory=/usr/lib/mandos \
 
104
                mandos-client
 
105
        install --mode=0755 --target-directory=/usr/sbin mandos-keygen
 
106
        install --mode=0755 \
 
107
                --target-directory=/usr/lib/mandos/plugins.d \
 
108
                plugins.d/password-prompt
 
109
        install --mode=4755 \
 
110
                --target-directory=/usr/lib/mandos/plugins.d \
 
111
                plugins.d/password-request
 
112
        install initramfs-tools-hook \
 
113
                /usr/share/initramfs-tools/hooks/mandos
 
114
        install initramfs-tools-hook-conf \
 
115
                /usr/share/initramfs-tools/conf-hooks.d/mandos
 
116
        install initramfs-tools-hook-conf \
 
117
                /usr/share/initramfs-tools/conf-hooks.d/mandos
 
118
        gzip --best --to-stdout mandos-keygen.8 \
 
119
                > /usr/share/man/man8/mandos-keygen.8.gz
 
120
        gzip --best --to-stdout mandos-client.8mandos \
 
121
                > /usr/share/man/man8/mandos-client.8mandos.gz
 
122
        gzip --best --to-stdout plugins.d/password-prompt.8mandos \
 
123
                > /usr/share/man/man8/password-prompt.8mandos.gz
 
124
        gzip --best --to-stdout plugins.d/password-request.8mandos \
 
125
                > /usr/share/man/man8/password-request.8mandos.gz
 
126
        /usr/sbin/mandos-keygen
 
127
        update-initramfs -k all -u
 
128
 
 
129
uninstall: uninstall-server uninstall-client
 
130
 
 
131
uninstall-server: /usr/sbin/mandos
 
132
        -rm --force /usr/sbin/mandos /usr/share/man/man8/mandos.8.gz \
 
133
                /usr/share/man/man5/mandos.conf.5.gz \
 
134
                /usr/share/man/man5/mandos-clients.conf.5.gz
 
135
        -rmdir --force /etc/mandos
 
136
 
 
137
uninstall-client:
 
138
        -rm --force /usr/sbin/mandos-keygen \
 
139
                /usr/lib/mandos/mandos-client \
 
140
                /usr/lib/mandos/plugins.d/password-prompt \
 
141
                /usr/lib/mandos/plugins.d/password-request \
 
142
                /usr/share/initramfs-tools/hooks/mandos \
 
143
                /usr/share/initramfs-tools/conf-hooks.d/mandos \
 
144
                /usr/share/man/man8/mandos-client.8mandos.gz \
 
145
                /usr/share/man/man8/mandos-keygen.8.gz \
 
146
                /usr/share/man/man8/password-prompt.8mandos.gz \
 
147
                /usr/share/man/man8/password-request.8mandos.gz
 
148
        -rmdir --force /usr/lib/mandos/plugins.d /usr/lib/mandos \
 
149
                /etc/mandos/plugins.d /etc/mandos
 
150
 
 
151
purge: purge-server purge-client
 
152
 
 
153
purge-server: uninstall-server
 
154
        -rm --force /etc/mandos/server.conf /etc/mandos/clients.conf
 
155
        -rmdir --force /etc/mandos
 
156
 
 
157
purge-client: uninstall-client
 
158
        -rm --force /etc/mandos/seckey.txt /etc/mandos/pubkey.txt
 
159
        -rmdir --force /etc/mandos