]> granicus.if.org Git - pdns/commitdiff
make dnspcap2protobuf buildable without `make all`
authorPieter Lexis <pieter.lexis@powerdns.com>
Thu, 31 Mar 2016 06:13:13 +0000 (08:13 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Thu, 7 Apr 2016 15:11:17 +0000 (17:11 +0200)
pdns/Makefile.am

index 055de8d35ee21b8a1b544abdc90de71e44d59fb7..90b1a4b30a169851f26ea9ec9937cb95386bb402 100644 (file)
@@ -61,7 +61,8 @@ CLEANFILES = \
        *.gcov \
        backends/gsql/gsqlbackend.gcda \
        backends/gsql/gsqlbackend.gcno \
-       backends/gsql/gsqlbackend.gcov
+       backends/gsql/gsqlbackend.gcov \
+       dnsmessage.pb.cc dnsmessage.pb.h
 
 noinst_SCRIPTS = pdns.init
 sysconf_DATA = pdns.conf-dist
@@ -121,10 +122,6 @@ EXTRA_PROGRAMS = \
        tsig-tests \
        zone2ldap
 
-if HAVE_PROTOBUF
-EXTRA_PROGRAMS += dnspcap2protobuf
-endif
-
 pdns_server_SOURCES = \
        arguments.cc arguments.hh \
        auth-carbon.cc \
@@ -1010,10 +1007,16 @@ dnsdemog_LDFLAGS = \
 dnsdemog_LDADD = \
        $(OPENSSL_LIBS)
 
+if HAVE_PROTOBUF
+if HAVE_PROTOC
+EXTRA_PROGRAMS += dnspcap2protobuf
+
 dnsmessage.pb.cc: dnsmessage.proto
-       protoc --cpp_out=./ $<
+       $(AM_V_GEN)$(PROTOC) --cpp_out=./ $<
+
+BUILT_SOURCES += dnsmessage.pb.cc
+dnspcap2protobuf.$(OBJEXT): dnsmessage.pb.cc
 
-if HAVE_PROTOBUF
 dnspcap2protobuf_SOURCES = \
        base32.cc \
        base64.cc base64.hh \
@@ -1034,7 +1037,7 @@ dnspcap2protobuf_SOURCES = \
        unix_utility.cc \
        utility.hh
 
-nodist_dnspcap2protobuf_SOURCES=dnsmessage.pb.cc dnsmessage.pb.h 
+nodist_dnspcap2protobuf_SOURCES=dnsmessage.pb.cc dnsmessage.pb.h
 
 dnspcap2protobuf_LDFLAGS = \
        $(AM_LDFLAGS) \
@@ -1046,6 +1049,7 @@ dnspcap2protobuf_LDADD = \
        $(PROTOBUF_LIBS) \
        $(BOOST_PROGRAM_OPTIONS_LIBS)
 endif
+endif
 
 testrunner_SOURCES = \
        arguments.cc \