From cf99e73177ae3f4534938c29a4534177d4a8915f Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Wed, 28 Jun 2023 02:26:12 +0200 Subject: [PATCH] Only compile when needed. --- Makefile | 13 +++++++++---- shard.yml | 4 ++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 78c2610..15c483d 100644 --- a/Makefile +++ b/Makefile @@ -18,10 +18,15 @@ Q ?= @ #################### DOMAIN ?= example.com -zone-file: - crystal run ./tools/write-zone-file.cr -- $(DOMAIN) -zone-basic-template-file: - crystal run ./tools/write-template-zone-file.cr -- $(DOMAIN) +build-write-zone-file: tools/write-zone-file.cr + $(Q)-([ ! -f bin/write-zone-file ] || [ tools/write-zone-file.cr -nt bin/write-zone-file ]) && shards build write-zone-file +zone-file: build-write-zone-file + $(Q)./bin/write-zone-file $(DOMAIN) + +build-write-template-zone-file: tools/write-template-zone-file.cr + $(Q)-([ ! -f bin/write-template-zone-file ] || [ tools/write-template-zone-file.cr -nt bin/write-template-zone-file ]) && shards build write-template-zone-file +zone-basic-template-file: build-write-template-zone-file + $(Q)./bin/write-template-zone-file $(DOMAIN) VERBOSITY ?= 4 run-client-verbosity: diff --git a/shard.yml b/shard.yml index f212aff..e2308de 100644 --- a/shard.yml +++ b/shard.yml @@ -26,5 +26,9 @@ targets: main: src/main.cr dnsmanager-client: main: src/client/main.cr + write-zone-file: + main: tools/write-zone-file.cr + write-template-zone-file: + main: tools/write-template-zone-file.cr license: ISC