/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: 2019-11-21 19:30:47 UTC
  • Revision ID: teddy@recompile.se-20191121193047-nszsowvqcvk081p2
Makefile: Use target-specific variables

Instead of overriding a whole rule and invoking $(LINK.c) explicitly
for certain targets (in order to append special compilation flags),
set CFLAGS and LDLIBS as target-specific variables on those targets.

* Makefile (plugins.d/mandos-client): Replace with a target-specific
  variable setting.
  (plugin-helpers/mandos-client-iprouteadddel): - ''-
  (dracut-module/password-agent): - '' -

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
LANGUAGE:=-std=gnu11
44
44
FEATURES:=-D_FILE_OFFSET_BITS=64
45
45
htmldir:=man
46
 
version:=1.8.11
 
46
version:=1.8.9
47
47
SED:=sed
48
48
PKG_CONFIG?=pkg-config
49
49
 
156
156
 
157
157
objects:=$(addsuffix .o,$(CPROGS))
158
158
 
159
 
.PHONY: all
160
159
all: $(PROGS) mandos.lsm
161
160
 
162
 
.PHONY: doc
163
161
doc: $(DOCS)
164
162
 
165
 
.PHONY: html
166
163
html: $(htmldocs)
167
164
 
168
165
%.5: %.xml common.ent legalnotice.xml
298
295
dracut-module/password-agent: CFLAGS += $(GLIB_CFLAGS)
299
296
dracut-module/password-agent: LDLIBS += $(GLIB_LIBS) -lpthread
300
297
 
301
 
.PHONY: clean
 
298
.PHONY : all doc html clean distclean mostlyclean maintainer-clean \
 
299
        check run-client run-server install install-html \
 
300
        install-server install-client-nokey install-client uninstall \
 
301
        uninstall-server uninstall-client purge purge-server \
 
302
        purge-client
 
303
 
302
304
clean:
303
305
        -rm --force $(CPROGS) $(objects) $(htmldocs) $(DOCS) core
304
306
 
305
 
.PHONY: distclean
306
307
distclean: clean
307
 
.PHONY: mostlyclean
308
308
mostlyclean: clean
309
 
.PHONY: maintainer-clean
310
309
maintainer-clean: clean
311
310
        -rm --force --recursive keydir confdir statedir
312
311
 
313
 
.PHONY: check
314
312
check: all
315
313
        ./mandos --check
316
314
        ./mandos-ctl --check
320
318
        ./dracut-module/password-agent --test
321
319
 
322
320
# Run the client with a local config and key
323
 
.PHONY: run-client
324
321
run-client: all keydir/seckey.txt keydir/pubkey.txt \
325
322
                        keydir/tls-privkey.pem keydir/tls-pubkey.pem
326
323
        @echo '######################################################'
354
351
keydir/seckey.txt keydir/pubkey.txt keydir/tls-privkey.pem keydir/tls-pubkey.pem: mandos-keygen
355
352
        install --directory keydir
356
353
        ./mandos-keygen --dir keydir --force
357
 
        if ! [ -e keydir/tls-privkey.pem ]; then \
358
 
                install --mode=u=rw /dev/null keydir/tls-privkey.pem; \
359
 
        fi
360
 
        if ! [ -e keydir/tls-pubkey.pem ]; then \
361
 
                install --mode=u=rw /dev/null keydir/tls-pubkey.pem; \
362
 
        fi
363
354
 
364
355
# Run the server with a local config
365
 
.PHONY: run-server
366
356
run-server: confdir/mandos.conf confdir/clients.conf statedir
367
357
        ./mandos --debug --no-dbus --configdir=confdir \
368
358
                --statedir=statedir $(SERVERARGS)
379
369
statedir:
380
370
        install --directory statedir
381
371
 
382
 
.PHONY: install
383
372
install: install-server install-client-nokey
384
373
 
385
 
.PHONY: install-html
386
374
install-html: html
387
375
        install --directory $(htmldir)
388
376
        install --mode=u=rw,go=r --target-directory=$(htmldir) \
389
377
                $(htmldocs)
390
378
 
391
 
.PHONY: install-server
392
379
install-server: doc
393
380
        install --directory $(CONFDIR)
394
381
        if install --directory --mode=u=rwx --owner=$(USER) \
441
428
        gzip --best --to-stdout intro.8mandos \
442
429
                > $(MANDIR)/man8/intro.8mandos.gz
443
430
 
444
 
.PHONY: install-client-nokey
445
431
install-client-nokey: all doc
446
432
        install --directory $(LIBDIR)/mandos $(CONFDIR)
447
433
        install --directory --mode=u=rwx $(KEYDIR) \
526
512
        gzip --best --to-stdout dracut-module/password-agent.8mandos \
527
513
                > $(MANDIR)/man8/password-agent.8mandos.gz
528
514
 
529
 
.PHONY: install-client
530
515
install-client: install-client-nokey
531
516
# Post-installation stuff
532
517
        -$(PREFIX)/sbin/mandos-keygen --dir "$(KEYDIR)"
542
527
        fi
543
528
        echo "Now run mandos-keygen --password --dir $(KEYDIR)"
544
529
 
545
 
.PHONY: uninstall
546
530
uninstall: uninstall-server uninstall-client
547
531
 
548
 
.PHONY: uninstall-server
549
532
uninstall-server:
550
533
        -rm --force $(PREFIX)/sbin/mandos \
551
534
                $(PREFIX)/sbin/mandos-ctl \
558
541
        update-rc.d -f mandos remove
559
542
        -rmdir $(CONFDIR)
560
543
 
561
 
.PHONY: uninstall-client
562
544
uninstall-client:
563
545
# Refuse to uninstall client if /etc/crypttab is explicitly configured
564
546
# to use it.
600
582
            done; \
601
583
        fi
602
584
 
603
 
.PHONY: purge
604
585
purge: purge-server purge-client
605
586
 
606
 
.PHONY: purge-server
607
587
purge-server: uninstall-server
608
588
        -rm --force $(CONFDIR)/mandos.conf $(CONFDIR)/clients.conf \
609
589
                $(DESTDIR)/etc/dbus-1/system.d/mandos.conf
614
594
                $(DESTDIR)/var/run/mandos.pid
615
595
        -rmdir $(CONFDIR)
616
596
 
617
 
.PHONY: purge-client
618
597
purge-client: uninstall-client
619
598
        -shred --remove $(KEYDIR)/seckey.txt $(KEYDIR)/tls-privkey.pem
620
599
        -rm --force $(CONFDIR)/plugin-runner.conf \