/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:50:51 UTC
  • Revision ID: teddy@recompile.se-20191121195051-jq57g07ybacsjw3r
Makefile: Declare phoniness of targets at each target

Instead of having one global list of .PHONY targets, with its
associated risk of that list becoming out-of-date, declare a target to
be phony at each target declaration.

* Makefile (.PHONY): Remove global list.  Spread out .PHONY
  declarations to be located before the declaration of each target.

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
159
160
all: $(PROGS) mandos.lsm
160
161
 
 
162
.PHONY: doc
161
163
doc: $(DOCS)
162
164
 
 
165
.PHONY: html
163
166
html: $(htmldocs)
164
167
 
165
168
%.5: %.xml common.ent legalnotice.xml
295
298
dracut-module/password-agent: CFLAGS += $(GLIB_CFLAGS)
296
299
dracut-module/password-agent: LDLIBS += $(GLIB_LIBS) -lpthread
297
300
 
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
 
 
 
301
.PHONY: clean
304
302
clean:
305
303
        -rm --force $(CPROGS) $(objects) $(htmldocs) $(DOCS) core
306
304
 
 
305
.PHONY: distclean
307
306
distclean: clean
 
307
.PHONY: mostlyclean
308
308
mostlyclean: clean
 
309
.PHONY: maintainer-clean
309
310
maintainer-clean: clean
310
311
        -rm --force --recursive keydir confdir statedir
311
312
 
 
313
.PHONY: check
312
314
check: all
313
315
        ./mandos --check
314
316
        ./mandos-ctl --check
318
320
        ./dracut-module/password-agent --test
319
321
 
320
322
# Run the client with a local config and key
 
323
.PHONY: run-client
321
324
run-client: all keydir/seckey.txt keydir/pubkey.txt \
322
325
                        keydir/tls-privkey.pem keydir/tls-pubkey.pem
323
326
        @echo '######################################################'
353
356
        ./mandos-keygen --dir keydir --force
354
357
 
355
358
# Run the server with a local config
 
359
.PHONY: run-server
356
360
run-server: confdir/mandos.conf confdir/clients.conf statedir
357
361
        ./mandos --debug --no-dbus --configdir=confdir \
358
362
                --statedir=statedir $(SERVERARGS)
369
373
statedir:
370
374
        install --directory statedir
371
375
 
 
376
.PHONY: install
372
377
install: install-server install-client-nokey
373
378
 
 
379
.PHONY: install-html
374
380
install-html: html
375
381
        install --directory $(htmldir)
376
382
        install --mode=u=rw,go=r --target-directory=$(htmldir) \
377
383
                $(htmldocs)
378
384
 
 
385
.PHONY: install-server
379
386
install-server: doc
380
387
        install --directory $(CONFDIR)
381
388
        if install --directory --mode=u=rwx --owner=$(USER) \
428
435
        gzip --best --to-stdout intro.8mandos \
429
436
                > $(MANDIR)/man8/intro.8mandos.gz
430
437
 
 
438
.PHONY: install-client-nokey
431
439
install-client-nokey: all doc
432
440
        install --directory $(LIBDIR)/mandos $(CONFDIR)
433
441
        install --directory --mode=u=rwx $(KEYDIR) \
512
520
        gzip --best --to-stdout dracut-module/password-agent.8mandos \
513
521
                > $(MANDIR)/man8/password-agent.8mandos.gz
514
522
 
 
523
.PHONY: install-client
515
524
install-client: install-client-nokey
516
525
# Post-installation stuff
517
526
        -$(PREFIX)/sbin/mandos-keygen --dir "$(KEYDIR)"
527
536
        fi
528
537
        echo "Now run mandos-keygen --password --dir $(KEYDIR)"
529
538
 
 
539
.PHONY: uninstall
530
540
uninstall: uninstall-server uninstall-client
531
541
 
 
542
.PHONY: uninstall-server
532
543
uninstall-server:
533
544
        -rm --force $(PREFIX)/sbin/mandos \
534
545
                $(PREFIX)/sbin/mandos-ctl \
541
552
        update-rc.d -f mandos remove
542
553
        -rmdir $(CONFDIR)
543
554
 
 
555
.PHONY: uninstall-client
544
556
uninstall-client:
545
557
# Refuse to uninstall client if /etc/crypttab is explicitly configured
546
558
# to use it.
582
594
            done; \
583
595
        fi
584
596
 
 
597
.PHONY: purge
585
598
purge: purge-server purge-client
586
599
 
 
600
.PHONY: purge-server
587
601
purge-server: uninstall-server
588
602
        -rm --force $(CONFDIR)/mandos.conf $(CONFDIR)/clients.conf \
589
603
                $(DESTDIR)/etc/dbus-1/system.d/mandos.conf
594
608
                $(DESTDIR)/var/run/mandos.pid
595
609
        -rmdir $(CONFDIR)
596
610
 
 
611
.PHONY: purge-client
597
612
purge-client: uninstall-client
598
613
        -shred --remove $(KEYDIR)/seckey.txt $(KEYDIR)/tls-privkey.pem
599
614
        -rm --force $(CONFDIR)/plugin-runner.conf \