/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-10-04 01:55:56 UTC
  • Revision ID: teddy@fukt.bsnet.se-20081004015556-hp0374bc62khen0z
* mandos-keygen.xml (FILES): Fixed id to be "files", not "file".
* mandos.xml (FILES): - '' -
  (CLIENTS, SERVER): Changed id attribute to lower case.  All
                     referrers changed.
* plugins.d/mandos-client.xml (FILES): Fixed id to be "files", not
                                       "file".

* plugins.d/password-prompt.xml (DESCRIPTION): Improved wording.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
WARN=-O -Wall -Wformat=2 -Winit-self -Wmissing-include-dirs \
2
2
        -Wswitch-default -Wswitch-enum -Wunused-parameter \
3
 
        -Wstrict-aliasing=1 -Wextra -Wfloat-equal -Wundef -Wshadow \
 
3
        -Wstrict-aliasing=2 -Wextra -Wfloat-equal -Wundef -Wshadow \
4
4
        -Wunsafe-loop-optimizations -Wpointer-arith \
5
5
        -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings \
6
6
        -Wconversion -Wstrict-prototypes -Wold-style-definition \
8
8
#       -Wunreachable-code 
9
9
#DEBUG=-ggdb3
10
10
# For info about _FORTIFY_SOURCE, see
11
 
# <http://www.kernel.org/doc/man-pages/online/pages/man7/feature_test_macros.7.html>
12
 
# and <http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html>.
13
 
FORTIFY=-D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIC
14
 
LINK_FORTIFY_LD=-z relro -z now
15
 
LINK_FORTIFY=
16
 
ifndef BROKEN_PIE
17
 
FORTIFY += -fPIE
18
 
LINK_FORTIFY_LD += -fPIE
19
 
LINK_FORTIFY += -pie
20
 
endif
 
11
# <http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html>
 
12
FORTIFY=-D_FORTIFY_SOURCE=2 -fstack-protector-all
21
13
#COVERAGE=--coverage
22
14
OPTIMIZE=-Os
23
15
LANGUAGE=-std=gnu99
24
16
htmldir=man
25
 
version=1.0.14
 
17
version=1.0
26
18
SED=sed
27
19
 
28
20
## Use these settings for a traditional /usr/local install
41
33
INITRAMFSTOOLS=$(DESTDIR)/usr/share/initramfs-tools
42
34
##
43
35
 
44
 
GNUTLS_CFLAGS=$(shell pkg-config --cflags-only-I gnutls)
45
 
GNUTLS_LIBS=$(shell pkg-config --libs gnutls)
 
36
GNUTLS_CFLAGS=$(shell libgnutls-config --cflags)
 
37
GNUTLS_LIBS=$(shell libgnutls-config --libs)
46
38
AVAHI_CFLAGS=$(shell pkg-config --cflags-only-I avahi-core)
47
39
AVAHI_LIBS=$(shell pkg-config --libs avahi-core)
48
 
GPGME_CFLAGS=$(shell gpgme-config --cflags; getconf LFS_CFLAGS)
49
 
GPGME_LIBS=$(shell gpgme-config --libs; getconf LFS_LIBS; \
50
 
        getconf LFS_LDFLAGS)
 
40
GPGME_CFLAGS=$(shell gpgme-config --cflags)
 
41
GPGME_LIBS=$(shell gpgme-config --libs)
51
42
 
52
43
# Do not change these two
53
44
CFLAGS=$(WARN) $(DEBUG) $(FORTIFY) $(COVERAGE) $(OPTIMIZE) \
54
45
        $(LANGUAGE) $(GNUTLS_CFLAGS) $(AVAHI_CFLAGS) $(GPGME_CFLAGS) \
55
46
        -DVERSION='"$(version)"'
56
 
LDFLAGS=$(COVERAGE) $(LINK_FORTIFY) $(foreach flag,$(LINK_FORTIFY_LD),-Xlinker $(flag))
 
47
LDFLAGS=$(COVERAGE)
57
48
 
58
49
# Commands to format a DocBook <refentry> document into a manual page
59
50
DOCBOOKTOMAN=cd $(dir $<); xsltproc --nonet --xinclude \
78
69
        /usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl \
79
70
        $<; $(HTMLPOST) $@
80
71
# Fix citerefentry links
81
 
HTMLPOST=$(SED) --in-place \
82
 
        --expression='s/\(<a class="citerefentry" href="\)\("><span class="citerefentry"><span class="refentrytitle">\)\([^<]*\)\(<\/span>(\)\([^)]*\)\()<\/span><\/a>\)/\1\3.\5\2\3\4\5\6/g'
 
72
HTMLPOST=$(SED) --in-place --expression='s/\(<a class="citerefentry" href="\)\("><span class="citerefentry"><span class="refentrytitle">\)\([^<]*\)\(<\/span>(\)\([^)]*\)\()<\/span><\/a>\)/\1\3.\5\2\3\4\5\6/g'
83
73
 
84
74
PLUGINS=plugins.d/password-prompt plugins.d/mandos-client \
85
75
        plugins.d/usplash plugins.d/splashy plugins.d/askpass-fifo
86
76
CPROGS=plugin-runner $(PLUGINS)
87
 
PROGS=mandos mandos-keygen mandos-ctl $(CPROGS)
 
77
PROGS=mandos mandos-keygen $(CPROGS)
88
78
DOCS=mandos.8 plugin-runner.8mandos mandos-keygen.8 \
89
79
        plugins.d/mandos-client.8mandos \
90
80
        plugins.d/password-prompt.8mandos mandos.conf.5 \
91
 
        plugins.d/usplash.8mandos plugins.d/splashy.8mandos \
92
 
        plugins.d/askpass-fifo.8mandos mandos-clients.conf.5
 
81
        mandos-clients.conf.5
93
82
 
94
83
htmldocs=$(addsuffix .xhtml,$(DOCS))
95
84
 
96
85
objects=$(addsuffix .o,$(CPROGS))
97
86
 
98
 
all: $(PROGS) mandos.lsm
 
87
all: $(PROGS)
99
88
 
100
89
doc: $(DOCS)
101
90
 
157
146
 
158
147
# Update all these files with version number $(version)
159
148
common.ent: Makefile
160
 
        $(SED) --in-place \
161
 
                --expression='s/^\(<!ENTITY version "\)[^"]*">$$/\1$(version)">/' \
162
 
                $@
 
149
        $(SED) --in-place --expression='s/^\(<ENTITY VERSION "\)[^"]*">$$/\1$(version)"/' $@
163
150
 
164
151
mandos: Makefile
165
 
        $(SED) --in-place \
166
 
                --expression='s/^\(version = "\)[^"]*"$$/\1$(version)"/' \
167
 
                $@
 
152
        $(SED) --in-place --expression='s/^\(version = "\)[^"]*"$$/\1$(version)"/' $@
168
153
 
169
154
mandos-keygen: Makefile
170
 
        $(SED) --in-place \
171
 
                --expression='s/^\(VERSION="\)[^"]*"$$/\1$(version)"/' \
172
 
                $@
173
 
 
174
 
mandos-ctl: Makefile
175
 
        $(SED) --in-place \
176
 
                --expression='s/^\(version = "\)[^"]*"$$/\1$(version)"/' \
177
 
                $@
178
 
 
179
 
mandos.lsm: Makefile
180
 
        $(SED) --in-place \
181
 
                --expression='s/^\(Version:\).*/\1\t$(version)/' \
182
 
                $@
183
 
        $(SED) --in-place \
184
 
                --expression='s/^\(Entered-date:\).*/\1\t$(shell date --rfc-3339=date --reference=Makefile)/' \
185
 
                $@
186
 
        $(SED) --in-place \
187
 
                --expression='s/\(mandos_\)[0-9.]\+\(\.orig\.tar\.gz\)/\1$(version)\2/' \
188
 
                $@
 
155
        $(SED) --in-place --expression='s/^\(VERSION="\)[^"]*"$$/\1$(version)"/' $@
189
156
 
190
157
plugins.d/mandos-client: plugins.d/mandos-client.o
191
158
        $(LINK.o) $(GNUTLS_LIBS) $(AVAHI_LIBS) $(GPGME_LIBS) \
210
177
run-client: all keydir/seckey.txt keydir/pubkey.txt
211
178
        ./plugin-runner --plugin-dir=plugins.d \
212
179
                --config-file=plugin-runner.conf \
213
 
                --options-for=mandos-client:--seckey=keydir/seckey.txt,--pubkey=keydir/pubkey.txt \
214
 
                $(CLIENTARGS)
 
180
                --options-for=mandos-client:--seckey=keydir/seckey.txt,--pubkey=keydir/pubkey.txt
215
181
 
216
182
# Used by run-client
217
183
keydir/seckey.txt keydir/pubkey.txt: mandos-keygen
220
186
 
221
187
# Run the server with a local config
222
188
run-server: confdir/mandos.conf confdir/clients.conf
223
 
        ./mandos --debug --no-dbus --configdir=confdir $(SERVERARGS)
 
189
        ./mandos --debug --configdir=confdir
224
190
 
225
191
# Used by run-server
226
192
confdir/mandos.conf: mandos.conf
234
200
 
235
201
install: install-server install-client-nokey
236
202
 
237
 
install-html: html
 
203
install-html: $(htmldocs)
238
204
        install --directory $(htmldir)
239
205
        install --mode=u=rw,go=r --target-directory=$(htmldir) \
240
206
                $(htmldocs)
292
258
        install --mode=u=rw,go=r initramfs-tools-hook-conf \
293
259
                $(INITRAMFSTOOLS)/conf-hooks.d/mandos
294
260
        install initramfs-tools-script \
295
 
                $(INITRAMFSTOOLS)/scripts/init-premount/mandos
 
261
                $(INITRAMFSTOOLS)/scripts/local-top/mandos
296
262
        install --mode=u=rw,go=r plugin-runner.conf $(CONFDIR)
297
263
        gzip --best --to-stdout mandos-keygen.8 \
298
264
                > $(MANDIR)/man8/mandos-keygen.8.gz
302
268
                > $(MANDIR)/man8/password-prompt.8mandos.gz
303
269
        gzip --best --to-stdout plugins.d/mandos-client.8mandos \
304
270
                > $(MANDIR)/man8/mandos-client.8mandos.gz
305
 
        gzip --best --to-stdout plugins.d/usplash.8mandos \
306
 
                > $(MANDIR)/man8/usplash.8mandos.gz
307
 
        gzip --best --to-stdout plugins.d/splashy.8mandos \
308
 
                > $(MANDIR)/man8/splashy.8mandos.gz
309
 
        gzip --best --to-stdout plugins.d/askpass-fifo.8mandos \
310
 
                > $(MANDIR)/man8/askpass-fifo.8mandos.gz
311
271
 
312
272
install-client: install-client-nokey
313
273
# Post-installation stuff
336
296
                $(PREFIX)/lib/mandos/plugins.d/mandos-client \
337
297
                $(PREFIX)/lib/mandos/plugins.d/usplash \
338
298
                $(PREFIX)/lib/mandos/plugins.d/splashy \
339
 
                $(PREFIX)/lib/mandos/plugins.d/askpass-fifo \
340
299
                $(INITRAMFSTOOLS)/hooks/mandos \
341
300
                $(INITRAMFSTOOLS)/conf-hooks.d/mandos \
342
 
                $(INITRAMFSTOOLS)/scripts/init-premount/mandos \
 
301
                $(INITRAMFSTOOLS)/scripts/local-top/mandos \
343
302
                $(MANDIR)/man8/plugin-runner.8mandos.gz \
344
303
                $(MANDIR)/man8/mandos-keygen.8.gz \
345
304
                $(MANDIR)/man8/password-prompt.8mandos.gz \
346
 
                $(MANDIR)/man8/usplash.8mandos.gz \
347
 
                $(MANDIR)/man8/splashy.8mandos.gz \
348
 
                $(MANDIR)/man8/askpass-fifo.8mandos.gz \
349
305
                $(MANDIR)/man8/mandos-client.8mandos.gz
350
306
        -rmdir $(PREFIX)/lib/mandos/plugins.d $(CONFDIR)/plugins.d \
351
307
                 $(PREFIX)/lib/mandos $(CONFDIR) $(KEYDIR)