From 50920be443fa1b8c037639ba6177f78614164e66 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 11 Aug 2024 08:20:48 -0300 Subject: Makefile: Simplify a bit compile rule --- Makefile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 38ec6d9..60d170b 100644 --- a/Makefile +++ b/Makefile @@ -60,15 +60,13 @@ all: $(derived-assets) $(objects): Makefile src/$(NAME).a: src/$(NAME).go - go tool compile $(GOCFLAGS) -o $@ -p $(*F) $*.go - -tests/$(NAME).a: tests/$(NAME).go src/$(NAME).go - go tool compile $(GOCFLAGS) -o $@ -p $(*F) $*.go src/$(NAME).go - src/main.a: src/main.go src/$(NAME).a tests/main.a: tests/main.go tests/$(NAME).a -src/main.a tests/main.a: - go tool compile $(GOCFLAGS) -o $@ -I $(@D) $*.go +src/$(NAME).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 src/main.bin: src/main.a tests/main.bin: tests/main.a @@ -81,9 +79,9 @@ $(NAME).bin: src/main.bin tests.bin-check = \ - tests/main.bin-check + tests/main.bin-check \ -$(tests.bin-check): tests/main.bin +tests/main.bin-check: tests/main.bin $(tests.bin-check): $(EXEC)$*.bin -- cgit v1.2.3