From 9a0427c2f629886b449b6213e9a836c881afa711 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 8 Jul 2020 00:32:34 +0100 Subject: [PATCH] before make make run nailing-cargo --- Makefile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..a181e0dd --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +#!/bin/sh + +SHELL=/bin/bash + +CARGO ?= cargo + +default: debug + +ifneq (,$(NAILINGCARGO_MANIFEST_DIR)) +vpath % $(NAILINGCARGO_MANIFEST_DIR) +CARGO_FLAGS += $(addprefix --manifest-path=,$(NAILINGCARGO_MANIFEST_DIR)/Cargo.toml) +CARGO_FLAGS += $(NAILINGCARGO_CARGO_OPTIONS) +endif + +foo: + printenv | sort + +debug: target/debug/server templates/script.js + +.PHONY: target/debug/server + +target/debug/server: + $(CARGO) build $(CARGO_FLAGS) + +templates/script.js: templates/script.ts tsconfig.json + mkdir -p templates + test -f templates || ln -s $< templates/ + tsc --outfile $@.tmp 2>&1 \ + | perl -pe 's/\((\d+),(\d+)\):/:$$1:$$2:/'; \ + test "$${PIPESTATUS[*]}" = "0 0" + mv -f $@.tmp $@ + +clean: + rm -f templates/script.js + rm -rf target -- 2.30.2