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
This commit is contained in:
Clayton Craft
2023-02-09 13:37:00 -08:00
parent 690d008643
commit f714f110a1
4 changed files with 8 additions and 11 deletions

2
.gitignore vendored
View File

@@ -1 +1 @@
/postmarketos-mkinitfs /mkinitfs

View File

@@ -13,10 +13,10 @@ GOTEST=go test -count=1 -race
GOSRC!=find * -name '*.go' GOSRC!=find * -name '*.go'
GOSRC+=go.mod go.sum GOSRC+=go.mod go.sum
all: postmarketos-mkinitfs all: mkinitfs
postmarketos-mkinitfs: $(GOSRC) mkinitfs: $(GOSRC)
$(GO) build $(GOFLAGS) -ldflags "$(LDFLAGS)" -o postmarketos-mkinitfs $(GO) build $(GOFLAGS) -ldflags "$(LDFLAGS)" -o mkinitfs ./cmd/mkinitfs
.PHONY: fmt .PHONY: fmt
fmt: fmt:
@@ -33,21 +33,18 @@ test:
@$(GOTEST) ./... @$(GOTEST) ./...
clean: clean:
$(RM) postmarketos-mkinitfs $(RM) mkinitfs
install: $(DOCS) postmarketos-mkinitfs install: $(DOCS) mkinitfs
install -Dm755 postmarketos-mkinitfs -t $(DESTDIR)$(BINDIR)/ install -Dm755 mkinitfs -t $(DESTDIR)$(BINDIR)/
ln -sf postmarketos-mkinitfs $(DESTDIR)$(BINDIR)/mkinitfs
.PHONY: checkinstall .PHONY: checkinstall
checkinstall: checkinstall:
test -e $(DESTDIR)$(BINDIR)/postmarketos-mkinitfs test -e $(DESTDIR)$(BINDIR)/mkinitfs
test -L $(DESTDIR)$(BINDIR)/mkinitfs
RMDIR_IF_EMPTY:=sh -c '! [ -d $$0 ] || ls -1qA $$0 | grep -q . || rmdir $$0' RMDIR_IF_EMPTY:=sh -c '! [ -d $$0 ] || ls -1qA $$0 | grep -q . || rmdir $$0'
uninstall: uninstall:
$(RM) $(DESTDIR)$(BINDIR)/postmarketos-mkinitfs
$(RM) $(DESTDIR)$(BINDIR)/mkinitfs $(RM) $(DESTDIR)$(BINDIR)/mkinitfs
${RMDIR_IF_EMPTY} $(DESTDIR)$(BINDIR) ${RMDIR_IF_EMPTY} $(DESTDIR)$(BINDIR)