atc0005 / todo

A collection of TODO items not specific to any one project
MIT License
0 stars 0 forks source link

Incorporate multi-binary build support in check-mail Makefile to other projects #14

Open atc0005 opened 4 years ago

atc0005 commented 4 years ago

Sample snippets from that Makefile:

# Space-separated list of cmd/BINARY_NAME directories to build
WHAT                    = check_imap_mailbox
.PHONY: linux
## linux: generates assets for Linux distros
linux:
    @echo "Building release assets for linux ..."

    @for target in $(WHAT); do \
        mkdir -p $(OUTPUTDIR)/$$target && \
        echo "Building 386 binaries" && \
        env GOOS=linux GOARCH=386 $(BUILDCMD) -o $(OUTPUTDIR)/$$target/$$target-$(VERSION)-linux-386 ${PWD}/cmd/$$target && \
        echo "Building amd64 binaries" && \
        env GOOS=linux GOARCH=amd64 $(BUILDCMD) -o $(OUTPUTDIR)/$$target/$$target-$(VERSION)-linux-amd64 ${PWD}/cmd/$$target && \
        echo "Generating checksum files" && \
        $(CHECKSUMCMD) $(OUTPUTDIR)/$$target/$$target-$(VERSION)-linux-386 > $(OUTPUTDIR)/$$target/$$target-$(VERSION)-linux-386.sha256 && \
        $(CHECKSUMCMD) $(OUTPUTDIR)/$$target/$$target-$(VERSION)-linux-amd64 > $(OUTPUTDIR)/$$target/$$target-$(VERSION)-linux-amd64.sha256; \
    done

    @echo "Completed build tasks for linux"

Direct link: