diff options
author | Christophe Vu-Brugier <cvubrugier@fastmail.fm> | 2020-07-02 10:57:22 +0200 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2020-07-06 18:00:28 +0100 |
commit | 991c272062a4300bbd5fe22dce17ab2fb5126e3f (patch) | |
tree | c2b3ec87d8c9391855235a275c2f2b7a4eab54e0 | |
parent | 9b815047340ad7e1d9e3be496b232a29f1b5b232 (diff) | |
download | keyutils-991c272062a4300bbd5fe22dce17ab2fb5126e3f.tar.gz |
Check that keyutils.h has valid C++ syntax at build time
Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r-- | Makefile | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -1,5 +1,6 @@ CPPFLAGS := -I. CFLAGS := -g -Wall -Werror +CXXFLAGS := -g -Wall -Werror INSTALL := install DESTDIR := SPECFILE := keyutils.spec @@ -99,7 +100,7 @@ endif # Normal build rule # ############################################################################### -all: keyctl request-key key.dns_resolver +all: keyctl request-key key.dns_resolver cxx ############################################################################### # @@ -167,6 +168,18 @@ dns.afsdb.o: dns.afsdb.c key.dns.h ############################################################################### # +# Check that the header file has valid C++ syntax +# +############################################################################### +cxx.stamp: keyutils.h Makefile + $(CXX) $(CPPFLAGS) $(CXXFLAGS) -x c++-header -fsyntax-only $< + touch $@ + +cxx: cxx.stamp +.PHONY: cxx + +############################################################################### +# # Install everything # ############################################################################### @@ -247,6 +260,7 @@ clean: $(RM) keyctl request-key key.dns_resolver $(RM) *.o *.os *~ $(RM) debugfiles.list debugsources.list + $(RM) cxx.stamp distclean: clean $(RM) -r rpmbuild $(TARBALL) |