Skip to content

Commit da93499

Browse files
committed
Add Makefile for rebuilding bindings
Having a makefile is a nice little trick to re-run the binding generation code without having to copy-paste and/or remember the right docker incantations :)
1 parent 3d864cd commit da93499

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

.github/workflows/miqt.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,15 @@ jobs:
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v4
16-
17-
- name: Linux64 docker build
18-
run: docker build -t miqt/genbindings:latest -f docker/genbindings.Dockerfile .
19-
16+
2017
- name: Cache clang ASTs
2118
uses: actions/cache@v4
2219
with:
2320
path: cmd/genbindings/cachedir
2421
key: linux64-clang-cache
2522

2623
- name: Rebuild binding source
27-
run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/genbindings:latest /bin/bash -c 'cd cmd/genbindings && go build && ./genbindings'
24+
run: make
2825

2926
- name: Assert no changes
3027
run: git update-index --really-refresh && git diff-index HEAD

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@ examples/libraries/restricted-extras-qscintilla/restricted-extras-qscintilla
4646
# android temporary build files
4747
android-build
4848
deployment-settings.json
49+
50+
*.docker-buildstamp
51+
compile_flags.txt

Makefile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
BUILDSTAMPS = docker/genbindings.docker-buildstamp
2+
3+
all: genbindings
4+
5+
docker/genbindings.docker-buildstamp: docker/genbindings.Dockerfile
6+
docker build -t miqt/genbindings:latest -f docker/genbindings.Dockerfile .
7+
touch $@
8+
9+
clean:
10+
docker image rm -f miqt/genbindings:latest
11+
rm -f $(BUILDSTAMPS)
12+
13+
genbindings: $(BUILDSTAMPS)
14+
docker run --user $$(id -u):$$(id -g) -v ~/.cache/go-build:/.cache/go-build -v $$PWD:/src -w /src miqt/genbindings:latest /bin/bash -c 'cd cmd/genbindings && go build && ./genbindings'
15+
16+
.PHONY : all clean genbindings

0 commit comments

Comments
 (0)