/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-02 10:48:24 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080802104824-fx0miwp9o4g9r31e
* plugbasedclient.c (struct process): New fields "eof", "completed",
                                      and "status".
  (handle_sigchld): New function.
  (main): Initialize "dir" to NULL to only closedir() it if necessary.
          Move "process_list" to be a global variable to be accessible
          by "handle_sigchld".  Make "handle_sigchld" handle SIGCHLD.
          Remove redundant check for NULL "dir".  Free "filename" when
          no longer used.  Block SIGCHLD around fork()/exec().
          Restore normal signals in child.  Only loop while running
          processes exist.  Print process buffer when the process is
          done and it has emitted EOF, not when it only emits EOF.
          Remove processes from list which exit non-cleanly.  In
          cleaning up, closedir() if necessary.  Bug fix: set next
          pointer correctly when freeing process list.

* plugins.d/passprompt.c (main): Do not ignore SIGQUIT.

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>
12
5
FORTIFY=-D_FORTIFY_SOURCE=2 # -fstack-protector-all
13
 
#COVERAGE=-fprofile-arcs -ftest-coverage
 
6
#COVERAGE=--coverage
14
7
OPTIMIZE=-Os
15
8
LANGUAGE=-std=gnu99
16
9
 
18
11
CFLAGS=$(WARN) $(DEBUG) $(FORTIFY) $(COVERAGE) $(OPTIMIZE) $(LANGUAGE)
19
12
LDFLAGS=$(COVERAGE)
20
13
 
21
 
DOCBOOKTOMAN=xsltproc --nonet \
22
 
        --param man.charmap.use.subset          0 \
23
 
        --param make.year.ranges                1 \
24
 
        --param make.single.year.ranges         1 \
25
 
        --param man.output.quietly              1 \
26
 
        --param man.authors.section.enabled     0
27
 
 
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
 
14
PROGS=plugbasedclient plugins.d/mandosclient plugins.d/passprompt
34
15
 
35
16
objects=$(shell for p in $(PROGS); do echo $${p}.o; done)
36
17
 
37
18
all: $(PROGS)
38
19
 
39
 
doc: $(DOCS)
40
 
 
41
 
%.5: %.xml
42
 
        cd $(dir $^); $(DOCBOOKTOMAN) $(notdir $^)
43
 
 
44
 
%.8: %.xml
45
 
        cd $(dir $^); $(DOCBOOKTOMAN) $(notdir $^)
46
 
 
47
 
%.8mandos: %.xml
48
 
        cd $(dir $^); $(DOCBOOKTOMAN) $(notdir $^)
49
 
 
50
 
mandos-client: mandos-client.o
 
20
plugbasedclient: plugbasedclient.o
51
21
        $(LINK.o) -lgnutls $(COMMON) $^ $(LOADLIBES) $(LDLIBS) -o $@
52
22
 
53
 
plugins.d/password-request: plugins.d/password-request.o
54
 
        $(LINK.o) -lgnutls -lavahi-core -lgpgme $(COMMON) $^ \
55
 
                $(LOADLIBES) $(LDLIBS) -o $@
 
23
plugins.d/mandosclient: plugins.d/mandosclient.o
 
24
        $(LINK.o) -lgnutls -lavahi-core -lgpgme $(COMMON) $^ $(LOADLIBES) $(LDLIBS) -o $@
56
25
 
57
 
plugins.d/password-prompt: plugins.d/password-prompt.o
 
26
plugins.d/passprompt: plugins.d/passprompt.o
58
27
        $(LINK.o) $(COMMON) $^ $(LOADLIBES) $(LDLIBS) -o $@
59
28
 
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
63
 
 
 
29
.PHONY : clean
64
30
clean:
65
 
        -rm --force $(PROGS) $(objects) $(DOCS) core
66
 
 
67
 
distclean: clean
68
 
mostlyclean: clean
69
 
maintainer-clean: clean
70
 
        -rm --force --recursive keydir
71
 
 
72
 
check:
73
 
        ./mandos --check
74
 
 
75
 
run-client: all
76
 
        -mkdir keydir
77
 
        -./mandos-keygen --dir keydir
78
 
        ./mandos-client --plugin-dir=plugins.d \
79
 
                --options-for=password-request:--keydir=keydir
80
 
 
81
 
run-server:
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
 
        gzip --best --to-stdout mandos-keygen.8 \
117
 
                > /usr/share/man/man8/mandos-keygen.8.gz
118
 
        gzip --best --to-stdout mandos-client.8mandos \
119
 
                > /usr/share/man/man8/mandos-client.8mandos.gz
120
 
        gzip --best --to-stdout plugins.d/password-prompt.8mandos \
121
 
                > /usr/share/man/man8/password-prompt.8mandos.gz
122
 
        gzip --best --to-stdout plugins.d/password-request.8mandos \
123
 
                > /usr/share/man/man8/password-request.8mandos.gz
124
 
        /usr/sbin/mandos-keygen
125
 
        update-initramfs -k all -u
126
 
 
127
 
uninstall: uninstall-server uninstall-client
128
 
 
129
 
uninstall-server: /usr/sbin/mandos
130
 
        -rm --force /usr/sbin/mandos /usr/share/man/man8/mandos.8.gz \
131
 
                /usr/share/man/man5/mandos.conf.5.gz \
132
 
                /usr/share/man/man5/mandos-clients.conf.5.gz
133
 
        -rmdir --force /etc/mandos
134
 
 
135
 
uninstall-client:
136
 
        -rm --force /usr/sbin/mandos-keygen \
137
 
                /usr/lib/mandos/mandos-client \
138
 
                /usr/lib/mandos/plugins.d/password-prompt \
139
 
                /usr/lib/mandos/plugins.d/password-request \
140
 
                /usr/share/initramfs-tools/hooks/mandos \
141
 
                /usr/share/initramfs-tools/conf-hooks.d/mandos \
142
 
                /usr/share/man/man8/mandos-client.8mandos.gz \
143
 
                /usr/share/man/man8/mandos-keygen.8.gz \
144
 
                /usr/share/man/man8/password-prompt.8mandos.gz \
145
 
                /usr/share/man/man8/password-request.8mandos.gz
146
 
        -rmdir --force /usr/lib/mandos/plugins.d /usr/lib/mandos \
147
 
                /etc/mandos/plugins.d /etc/mandos
148
 
 
149
 
purge: purge-server purge-client
150
 
 
151
 
purge-server: uninstall-server
152
 
        -rm --force /etc/mandos/server.conf /etc/mandos/clients.conf
153
 
        -rmdir --force /etc/mandos
154
 
 
155
 
purge-client: uninstall-client
156
 
        -rm --force /etc/mandos/seckey.txt /etc/mandos/pubkey.txt
157
 
        -rmdir --force /etc/mandos
 
31
        -rm -f $(PROGS) $(objects) core