Skip to content

Commit

Permalink
simplify makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
alessio committed Dec 29, 2023
1 parent 5387d0e commit cf6b399
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,14 @@ $(BUILDDIR)/:

check: $(COVERAGE_REPORT_FILENAME)

$(COVERAGE_REPORT_FILENAME): generate
$(COVERAGE_REPORT_FILENAME): version.txt
go test $(VERBOSE) -mod=readonly -race -cover -covermode=atomic -coverprofile=$@ ./...

go.sum: go.mod
deps:
echo "Ensure dependencies have not been modified ..." >&2
go mod verify
go mod tidy
touch $@

generate:
go generate ./...
go mod tidy

distclean: clean
rm -rf dist/
Expand All @@ -68,7 +65,7 @@ clean:
$(COVERAGE_REPORT_FILENAME) \
version.txt

version.txt: generate
version.txt: deps
cp -f version/version.txt version.txt

list:
Expand All @@ -77,17 +74,17 @@ list:
macos-codesign: build
codesign --verbose -s $(CODESIGN_IDENTITY) --options=runtime $(BUILDDIR)/*

unixtools.pkg: version-stamp macos-codesign
unixtools.pkg: version.txt macos-codesign
pkgbuild --identifier io.asscrypto.unixtools \
--install-location ./Library/ --root $(BUILDDIR) $@

unixtools.dmg: version-stamp macos-codesign
VERSION=$(shell cat version-stamp); \
unixtools.dmg: version.txt macos-codesign
VERSION=$(shell cat version.txt); \
mkdir -p dist/unixtools-$${VERSION}/bin ; \
cp -a $(BUILDDIR)/* dist/unixtools-$${VERSION}/bin/ ; \
chmod 0755 dist/unixtools-$${VERSION}/bin/* ; \
create-dmg --volname unixtools --codesign $(CODESIGN_IDENTITY) \
--sandbox-safe --no-internet-enable \
$@ dist/unixtools-$${VERSION}

.PHONY: all clean check distclean build list macos-codesign generate
.PHONY: all clean check distclean build list macos-codesign deps

0 comments on commit cf6b399

Please sign in to comment.