/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: 2019-11-21 19:30:47 UTC
  • mto: This revision was merged to the branch mainline in revision 396.
  • 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:
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 '######################################################'
356
353
        ./mandos-keygen --dir keydir --force
357
354
 
358
355
# Run the server with a local config
359
 
.PHONY: run-server
360
356
run-server: confdir/mandos.conf confdir/clients.conf statedir
361
357
        ./mandos --debug --no-dbus --configdir=confdir \
362
358
                --statedir=statedir $(SERVERARGS)
373
369
statedir:
374
370
        install --directory statedir
375
371
 
376
 
.PHONY: install
377
372
install: install-server install-client-nokey
378
373
 
379
 
.PHONY: install-html
380
374
install-html: html
381
375
        install --directory $(htmldir)
382
376
        install --mode=u=rw,go=r --target-directory=$(htmldir) \
383
377
                $(htmldocs)
384
378
 
385
 
.PHONY: install-server
386
379
install-server: doc
387
380
        install --directory $(CONFDIR)
388
381
        if install --directory --mode=u=rwx --owner=$(USER) \
435
428
        gzip --best --to-stdout intro.8mandos \
436
429
                > $(MANDIR)/man8/intro.8mandos.gz
437
430
 
438
 
.PHONY: install-client-nokey
439
431
install-client-nokey: all doc
440
432
        install --directory $(LIBDIR)/mandos $(CONFDIR)
441
433
        install --directory --mode=u=rwx $(KEYDIR) \
520
512
        gzip --best --to-stdout dracut-module/password-agent.8mandos \
521
513
                > $(MANDIR)/man8/password-agent.8mandos.gz
522
514
 
523
 
.PHONY: install-client
524
515
install-client: install-client-nokey
525
516
# Post-installation stuff
526
517
        -$(PREFIX)/sbin/mandos-keygen --dir "$(KEYDIR)"
536
527
        fi
537
528
        echo "Now run mandos-keygen --password --dir $(KEYDIR)"
538
529
 
539
 
.PHONY: uninstall
540
530
uninstall: uninstall-server uninstall-client
541
531
 
542
 
.PHONY: uninstall-server
543
532
uninstall-server:
544
533
        -rm --force $(PREFIX)/sbin/mandos \
545
534
                $(PREFIX)/sbin/mandos-ctl \
552
541
        update-rc.d -f mandos remove
553
542
        -rmdir $(CONFDIR)
554
543
 
555
 
.PHONY: uninstall-client
556
544
uninstall-client:
557
545
# Refuse to uninstall client if /etc/crypttab is explicitly configured
558
546
# to use it.
594
582
            done; \
595
583
        fi
596
584
 
597
 
.PHONY: purge
598
585
purge: purge-server purge-client
599
586
 
600
 
.PHONY: purge-server
601
587
purge-server: uninstall-server
602
588
        -rm --force $(CONFDIR)/mandos.conf $(CONFDIR)/clients.conf \
603
589
                $(DESTDIR)/etc/dbus-1/system.d/mandos.conf
608
594
                $(DESTDIR)/var/run/mandos.pid
609
595
        -rmdir $(CONFDIR)
610
596
 
611
 
.PHONY: purge-client
612
597
purge-client: uninstall-client
613
598
        -shred --remove $(KEYDIR)/seckey.txt $(KEYDIR)/tls-privkey.pem
614
599
        -rm --force $(CONFDIR)/plugin-runner.conf \