From 14993a8389e5dbf7e033a93c88c1e77077b209bb Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 12 May 2017 12:31:31 -0400 Subject: Have the Makefile be AutoThing friendly. While it mostly played nice with autothing before, by having autothing treat `go generate` as an opaque step, it didn't populate `files.src.gen`. --- sd_daemon/Makefile | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/sd_daemon/Makefile b/sd_daemon/Makefile index 1d8579e..2a67514 100644 --- a/sd_daemon/Makefile +++ b/sd_daemon/Makefile @@ -12,14 +12,36 @@ # See the License for the specific language governing permissions and # limitations under the License. +# header +ifneq ($(topsrcdir),) +include $(topsrcdir)/build-aux/Makefile.head.mk +else +srcdir = . +.DEFAULT_GOAL = files.generate +endif + +# body + files.src.gen += log_util.go +ifeq ($(topsrcdir),) files.generate: $(files.src.gen) maintainer-clean: rm -f -- $(files.src.gen) .PHONY: files.generate maintainer-clean +.DELETE_ON_ERROR: +endif -%.go: %.go.gen - ./$^ > $@ +$(srcdir)/%.go: $(srcdir)/%.go.gen + cd $(@D) && ./$(^F) > $(@F) +# footer +ifneq ($(topsrcdir),) +include $(topsrcdir)/build-aux/Makefile.tail.mk +else +files.generate: $(files.src.gen) +maintainer-clean: + rm -f -- $(files.src.gen) $(files.src.int) +.PHONY: files.generate maintainer-clean .DELETE_ON_ERROR: +endif -- cgit v1.2.3-54-g00ecf