From ddec4aa678679a275a55c4c60d196886c032274d Mon Sep 17 00:00:00 2001 From: arbitar Date: Mon, 12 Dec 2022 19:48:50 -0800 Subject: [PATCH] Update build --- Dockerfile | 2 +- Makefile | 3 +++ README.md | 7 ++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5d54d6a..0498384 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,4 @@ RUN apt-get update && apt-get install -y libjson-c-dev build-essential WORKDIR /host -CMD gcc -static -o jsonsubst jsonsubst.c -ljson-c +CMD make build diff --git a/Makefile b/Makefile index 88d2bb6..4b52f2e 100644 --- a/Makefile +++ b/Makefile @@ -3,5 +3,8 @@ all: docker run --rm -v "${PWD}":/host jsonsubst docker rmi jsonsubst +build: + gcc -static -o jsonsubst jsonsubst.c -ljson-c + clean: rm jsonsubst diff --git a/README.md b/README.md index 45735e9..6a7f5e1 100644 --- a/README.md +++ b/README.md @@ -11,5 +11,10 @@ Or, in a pipeline of some kind... `cat input.txt | ./jsonsubst data.json | tee output.txt` +## Build +If you're cool and already have a good working C build environment on your system, just run `make build`. + +I'm not cool though, so I use Docker for this kind of thing, which is why it's the default make target. Just run `make` on a system with Docker running on it, and a build image will be created, `make build` executed within the container where all the prerequisites exist, and the build image will be removed after it's done. + ## Notes -No runtime dependencies, so it should run anywhere. Which means it'll run inside your quick-and-dirty Docker stuff without complaint. +No external runtime dependencies, so it should run anywhere. Which means it'll run inside your quick-and-dirty Docker stuff without complaint.