From f714f110a151759fa2d2e375f527b66e0dea2fc4 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Thu, 9 Feb 2023 13:37:00 -0800 Subject: [PATCH] cmd/mkinitfs: rename binary and move This moves the main package to cmd/mkinitfs, and configures the compiled binary to be named 'mkinitfs'. calling the full name 'postmarketos-mkinitfs' was unlikely to be used by anyone... This move makes the project source layout more consistent with other Go projects, and allows for adding more cmd/* things with their own main packages later if we want --- .gitignore | 2 +- Makefile | 17 +++++++---------- main.go => cmd/mkinitfs/main.go | 0 main_test.go => cmd/mkinitfs/main_test.go | 0 4 files changed, 8 insertions(+), 11 deletions(-) rename main.go => cmd/mkinitfs/main.go (100%) rename main_test.go => cmd/mkinitfs/main_test.go (100%) diff --git a/.gitignore b/.gitignore index 52a0554..6baa194 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/postmarketos-mkinitfs +/mkinitfs diff --git a/Makefile b/Makefile index 7318b78..5e2d77d 100644 --- a/Makefile +++ b/Makefile @@ -13,10 +13,10 @@ GOTEST=go test -count=1 -race GOSRC!=find * -name '*.go' GOSRC+=go.mod go.sum -all: postmarketos-mkinitfs +all: mkinitfs -postmarketos-mkinitfs: $(GOSRC) - $(GO) build $(GOFLAGS) -ldflags "$(LDFLAGS)" -o postmarketos-mkinitfs +mkinitfs: $(GOSRC) + $(GO) build $(GOFLAGS) -ldflags "$(LDFLAGS)" -o mkinitfs ./cmd/mkinitfs .PHONY: fmt fmt: @@ -33,21 +33,18 @@ test: @$(GOTEST) ./... clean: - $(RM) postmarketos-mkinitfs + $(RM) mkinitfs -install: $(DOCS) postmarketos-mkinitfs - install -Dm755 postmarketos-mkinitfs -t $(DESTDIR)$(BINDIR)/ - ln -sf postmarketos-mkinitfs $(DESTDIR)$(BINDIR)/mkinitfs +install: $(DOCS) mkinitfs + install -Dm755 mkinitfs -t $(DESTDIR)$(BINDIR)/ .PHONY: checkinstall checkinstall: - test -e $(DESTDIR)$(BINDIR)/postmarketos-mkinitfs - test -L $(DESTDIR)$(BINDIR)/mkinitfs + test -e $(DESTDIR)$(BINDIR)/mkinitfs RMDIR_IF_EMPTY:=sh -c '! [ -d $$0 ] || ls -1qA $$0 | grep -q . || rmdir $$0' uninstall: - $(RM) $(DESTDIR)$(BINDIR)/postmarketos-mkinitfs $(RM) $(DESTDIR)$(BINDIR)/mkinitfs ${RMDIR_IF_EMPTY} $(DESTDIR)$(BINDIR) diff --git a/main.go b/cmd/mkinitfs/main.go similarity index 100% rename from main.go rename to cmd/mkinitfs/main.go diff --git a/main_test.go b/cmd/mkinitfs/main_test.go similarity index 100% rename from main_test.go rename to cmd/mkinitfs/main_test.go