From 2eb97310f4c6d7c9a2ed597b9f4058b8e54e8da9 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 11 Aug 2024 08:28:05 -0300 Subject: Makefile: Normalize Go rules and simplify compile rules --- Makefile | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b2773fa..118914a 100644 --- a/Makefile +++ b/Makefile @@ -55,13 +55,12 @@ all: $(derived-assets) $(objects): Makefile src/$(NAME).a: src/$(NAME).go - go tool compile $(GOCFLAGS) -o $@ -p $(*F) $*.go +tests/main.a: tests/main.go tests/$(NAME).a +src/$(NAME).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/$(NAME).go - -tests/main.a: tests/main.go tests/$(NAME).a - go tool compile $(GOCFLAGS) -o $@ -I $(@D) $*.go + go tool compile $(GOCFLAGS) -o $@ -p $(*F) $*.go src/$(*F).go tests/main.bin: tests/main.a go tool link $(GOLDFLAGS) -o $@ -L $(@D) $*.a @@ -69,10 +68,10 @@ tests/main.bin: tests/main.a tests.bin-check = \ - tests/main.bin/1 \ - tests/main.bin/2 \ - tests/main.bin/3 \ - tests/main.bin/4 \ + tests/main.bin/1 \ + tests/main.bin/2 \ + tests/main.bin/3 \ + tests/main.bin/4 \ $(tests.bin-check): tests/main.bin $(tests.bin-check): @@ -83,6 +82,11 @@ check-unit: $(tests.bin-check) integration-tests = \ +.PRECIOUS: $(integration-tests) +$(integration-tests): $(NAME).bin +$(integration-tests): ALWAYS + sh $@ + check-integration: $(integration-tests) -- cgit v1.2.3