diff options
author | EuAndreh <eu@euandre.org> | 2024-08-15 07:37:18 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-08-15 07:37:18 -0300 |
commit | aa44df7545e13f6d2bb5ea088786d14f4a31a04d (patch) | |
tree | 035567e78bc4489ed2b7d9425cc4b2c9dcf658bc /Makefile | |
parent | Makefile: Simplify a bit compile rule (diff) | |
download | binder-aa44df7545e13f6d2bb5ea088786d14f4a31a04d.tar.gz binder-aa44df7545e13f6d2bb5ea088786d14f4a31a04d.tar.xz |
Add src/version.go
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -38,10 +38,12 @@ objects = \ sources = \ src/$(NAME).go \ + src/version.go \ src/main.go \ derived-assets = \ + src/version.go \ $(objects) \ src/main.bin \ tests/main.bin \ @@ -59,23 +61,28 @@ all: $(derived-assets) $(objects): Makefile -src/$(NAME).a: src/$(NAME).go +src/$(NAME).a: src/$(NAME).go src/version.go + go tool compile $(GOCFLAGS) -o $@ -p $(*F) -I $(@D) $*.go src/version.go + src/main.a: src/main.go src/$(NAME).a tests/main.a: tests/main.go tests/$(NAME).a -src/$(NAME).a src/main.a tests/main.a: +src/main.a tests/main.a: go tool compile $(GOCFLAGS) -o $@ -p $(*F) -I $(@D) $*.go -tests/$(NAME).a: tests/$(NAME).go src/$(NAME).go - go tool compile $(GOCFLAGS) -o $@ -p $(*F) $*.go src/$(*F).go +tests/$(NAME).a: tests/$(NAME).go src/$(NAME).go src/version.go + go tool compile $(GOCFLAGS) -o $@ -p $(*F) $*.go src/$(*F).go src/version.go src/main.bin: src/main.a tests/main.bin: tests/main.a src/main.bin tests/main.bin: - go tool link $(GOLDFLAGS) -o $@ -L $(@D) $*.a + go tool link $(GOLDFLAGS) -o $@ -L $(@D) --extldflags '$(LDLIBS)' $*.a $(NAME).bin: src/main.bin ln -fs $? $@ +src/version.go: Makefile + echo 'package $(NAME); var version = "$(VERSION)"' > $@ + tests.bin-check = \ |