Skip to content

Commit

Permalink
Update build
Browse files Browse the repository at this point in the history
  • Loading branch information
arbitar committed Dec 13, 2022
1 parent ad74743 commit ddec4aa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit ddec4aa

Please sign in to comment.