41
41
#COVERAGE=--coverage
42
42
OPTIMIZE:=-Os -fno-strict-aliasing
43
43
LANGUAGE:=-std=gnu11
44
FEATURES:=-D_FILE_OFFSET_BITS=64
48
PKG_CONFIG?=pkg-config
50
48
USER:=$(firstword $(subst :, ,$(shell getent passwd _mandos \
51
49
|| getent passwd nobody || echo 65534)))
88
SYSTEMD:=$(DESTDIR)$(shell $(PKG_CONFIG) systemd \
86
SYSTEMD:=$(DESTDIR)$(shell pkg-config systemd \
89
87
--variable=systemdsystemunitdir)
90
TMPFILES:=$(DESTDIR)$(shell $(PKG_CONFIG) systemd \
91
--variable=tmpfilesdir)
88
TMPFILES:=$(DESTDIR)$(shell pkg-config systemd --variable=tmpfilesdir)
93
GNUTLS_CFLAGS:=$(shell $(PKG_CONFIG) --cflags-only-I gnutls)
94
GNUTLS_LIBS:=$(shell $(PKG_CONFIG) --libs gnutls)
95
AVAHI_CFLAGS:=$(shell $(PKG_CONFIG) --cflags-only-I avahi-core)
96
AVAHI_LIBS:=$(shell $(PKG_CONFIG) --libs avahi-core)
90
GNUTLS_CFLAGS:=$(shell pkg-config --cflags-only-I gnutls)
91
GNUTLS_LIBS:=$(shell pkg-config --libs gnutls)
92
AVAHI_CFLAGS:=$(shell pkg-config --cflags-only-I avahi-core)
93
AVAHI_LIBS:=$(shell pkg-config --libs avahi-core)
97
94
GPGME_CFLAGS:=$(shell gpgme-config --cflags; getconf LFS_CFLAGS)
98
95
GPGME_LIBS:=$(shell gpgme-config --libs; getconf LFS_LIBS; \
99
96
getconf LFS_LDFLAGS)
100
LIBNL3_CFLAGS:=$(shell $(PKG_CONFIG) --cflags-only-I libnl-route-3.0)
101
LIBNL3_LIBS:=$(shell $(PKG_CONFIG) --libs libnl-route-3.0)
102
GLIB_CFLAGS:=$(shell $(PKG_CONFIG) --cflags glib-2.0)
103
GLIB_LIBS:=$(shell $(PKG_CONFIG) --libs glib-2.0)
97
LIBNL3_CFLAGS:=$(shell pkg-config --cflags-only-I libnl-route-3.0)
98
LIBNL3_LIBS:=$(shell pkg-config --libs libnl-route-3.0)
99
GLIB_CFLAGS:=$(shell pkg-config --cflags glib-2.0)
100
GLIB_LIBS:=$(shell pkg-config --libs glib-2.0)
105
102
# Do not change these two
106
CFLAGS+=$(WARN) $(DEBUG) $(FORTIFY) $(COVERAGE) $(OPTIMIZE) \
107
$(LANGUAGE) $(FEATURES) -DVERSION='"$(version)"'
103
CFLAGS+=$(WARN) $(DEBUG) $(FORTIFY) $(COVERAGE) \
104
$(OPTIMIZE) $(LANGUAGE) -DVERSION='"$(version)"'
108
105
LDFLAGS+=-Xlinker --as-needed $(COVERAGE) $(LINK_FORTIFY) $(strip \
109
106
) $(foreach flag,$(LINK_FORTIFY_LD),-Xlinker $(flag))