Skip to content

Commit ddec4aa

Browse files
committed
Update build
1 parent ad74743 commit ddec4aa

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ RUN apt-get update && apt-get install -y libjson-c-dev build-essential
88

99
WORKDIR /host
1010

11-
CMD gcc -static -o jsonsubst jsonsubst.c -ljson-c
11+
CMD make build

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@ all:
33
docker run --rm -v "${PWD}":/host jsonsubst
44
docker rmi jsonsubst
55

6+
build:
7+
gcc -static -o jsonsubst jsonsubst.c -ljson-c
8+
69
clean:
710
rm jsonsubst

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,10 @@ Or, in a pipeline of some kind...
1111

1212
`cat input.txt | ./jsonsubst data.json | tee output.txt`
1313

14+
## Build
15+
If you're cool and already have a good working C build environment on your system, just run `make build`.
16+
17+
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.
18+
1419
## Notes
15-
No runtime dependencies, so it should run anywhere. Which means it'll run inside your quick-and-dirty Docker stuff without complaint.
20+
No external runtime dependencies, so it should run anywhere. Which means it'll run inside your quick-and-dirty Docker stuff without complaint.

0 commit comments

Comments
 (0)