/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.7
 
46
version:=1.8.9
47
47
SED:=sed
48
48
PKG_CONFIG?=pkg-config
49
49
 
89
89
                        --variable=systemdsystemunitdir)
90
90
TMPFILES:=$(DESTDIR)$(shell $(PKG_CONFIG) systemd \
91
91
                        --variable=tmpfilesdir)
 
92
SYSUSERS:=$(DESTDIR)$(shell $(PKG_CONFIG) systemd \
 
93
                        --variable=sysusersdir)
92
94
 
93
95
GNUTLS_CFLAGS:=$(shell $(PKG_CONFIG) --cflags-only-I gnutls)
94
96
GNUTLS_LIBS:=$(shell $(PKG_CONFIG) --libs gnutls)
280
282
                $@)
281
283
 
282
284
# Need to add the GnuTLS, Avahi and GPGME libraries
283
 
plugins.d/mandos-client: plugins.d/mandos-client.c
284
 
        $(LINK.c) $^ $(GNUTLS_CFLAGS) $(AVAHI_CFLAGS) $(strip\
285
 
                ) $(GPGME_CFLAGS) $(GNUTLS_LIBS) $(strip\
286
 
                ) $(AVAHI_LIBS) $(GPGME_LIBS) $(LOADLIBES) $(strip\
287
 
                ) $(LDLIBS) -o $@
 
285
plugins.d/mandos-client: CFLAGS += $(GNUTLS_CFLAGS) $(strip \
 
286
        ) $(AVAHI_CFLAGS) $(GPGME_CFLAGS)
 
287
plugins.d/mandos-client: LDLIBS += $(GNUTLS_LIBS) $(strip \
 
288
        ) $(AVAHI_LIBS) $(GPGME_LIBS)
288
289
 
289
290
# Need to add the libnl-route library
290
 
plugin-helpers/mandos-client-iprouteadddel: plugin-helpers/mandos-client-iprouteadddel.c
291
 
        $(LINK.c) $(LIBNL3_CFLAGS) $^ $(LIBNL3_LIBS) $(strip\
292
 
                ) $(LOADLIBES) $(LDLIBS) -o $@
 
291
plugin-helpers/mandos-client-iprouteadddel: CFLAGS += $(LIBNL3_CFLAGS)
 
292
plugin-helpers/mandos-client-iprouteadddel: LDLIBS += $(LIBNL3_LIBS)
293
293
 
294
294
# Need to add the GLib and pthread libraries
295
 
dracut-module/password-agent: dracut-module/password-agent.c
296
 
        $(LINK.c) $(GLIB_CFLAGS) $^ $(GLIB_LIBS) -lpthread $(strip\
297
 
                ) $(LOADLIBES) $(LDLIBS) -o $@
 
295
dracut-module/password-agent: CFLAGS += $(GLIB_CFLAGS)
 
296
dracut-module/password-agent: LDLIBS += $(GLIB_LIBS) -lpthread
298
297
 
299
298
.PHONY : all doc html clean distclean mostlyclean maintainer-clean \
300
299
        check run-client run-server install install-html \
390
389
                install --mode=u=rw,go=r tmpfiles.d-mandos.conf \
391
390
                        $(TMPFILES)/mandos.conf; \
392
391
        fi
 
392
        if [ "$(SYSUSERS)" != "$(DESTDIR)" \
 
393
                        -a -d "$(SYSUSERS)" ]; then \
 
394
                install --mode=u=rw,go=r sysusers.d-mandos.conf \
 
395
                        $(SYSUSERS)/mandos.conf; \
 
396
        fi
393
397
        install --mode=u=rwx,go=rx mandos $(PREFIX)/sbin/mandos
394
398
        install --mode=u=rwx,go=rx --target-directory=$(PREFIX)/sbin \
395
399
                mandos-ctl
429
433
        install --directory --mode=u=rwx $(KEYDIR) \
430
434
                $(LIBDIR)/mandos/plugins.d \
431
435
                $(LIBDIR)/mandos/plugin-helpers
 
436
        if [ "$(SYSUSERS)" != "$(DESTDIR)" \
 
437
                        -a -d "$(SYSUSERS)" ]; then \
 
438
                install --mode=u=rw,go=r sysusers.d-mandos.conf \
 
439
                        $(SYSUSERS)/mandos-client.conf; \
 
440
        fi
432
441
        if [ "$(CONFDIR)" != "$(LIBDIR)/mandos" ]; then \
433
442
                install --mode=u=rwx \
434
443
                        --directory "$(CONFDIR)/plugins.d" \