commit: 917a02043b67de2edfdcf542faf589a23e12c6eb
parent: 34c420a873460447ae42c6d075818cb3c594f53d
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Tue, 7 Jan 2020 08:53:33 +0100
Makefile: add recipes for building test fixtures
Diffstat:
3 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
@@ -5,25 +5,30 @@ BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man
EXE = go-deblob
+BLOBS = test/fixtures/hello test/fixtures/hello.a
+CFLAGS = -Os -s
all: $(EXE)
-$(EXE): *.go go.mod go.sum
- go build -mod=`ls -d vendor 2> /dev/null` -o $(EXE)
+go-deblob: *.go go.mod go.sum
+ go build -mod=`ls -d vendor 2> /dev/null` -o $@
.PHONY: clean
clean:
- rm $(EXE)
+ rm -f $(BLOBS) $(EXE)
+
+test/fixtures/hello.a: test/fixtures/hello
+ $(AR) -rc $@ $<
.PHONY: test
-test:
+test: test/fixtures/hello test/fixtures/hello.a
cp -r test/fixtures test/checkDir-fixtures
go test
- rm -r test/checkDir-fixtures
+ rm -fr test/checkDir-fixtures
.PHONY: install
install:
mkdir -p $(DESTDIR)$(BINDIR)
- cp -p $(EXE) $(DESTDIR)$(BINDIR)/$(EXE)
+ cp -p $(EXE) $(DESTDIR)$(BINDIR)/
mkdir -p $(DESTDIR)$(MANDIR)/man1
cp -p $(EXE).1 $(DESTDIR)$(MANDIR)/man1/
diff --git a/go-deblob_test.go b/go-deblob_test.go
@@ -20,7 +20,7 @@ func TestIsBlob(t *testing.T) {
{"test/fixtures/hello.c", false},
{"test/fixtures/hello", true},
// {"test/fixtures/hello.o", true},
- {"test/fixtures/hello.ar", true},
+ {"test/fixtures/hello.a", true},
{"test/fixtures/empty", false},
// {"test/fixtures/option.rom", true},
}
diff --git a/test/fixtures/hello.ar b/test/fixtures/hello.a
Binary files differ.