Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I’m...talking about using make for its intended purpose, which is selectively building artifacts whose dependencies have changed, e.g. compile executable A if source code files X Y or Z have changed and leave it alone if not.

What exactly are you talking about? Are you upset that make isn't a cross-platform package management system?

You don't know what alternative there is to Make and then in the next breath you say the only arguments for it are personal preference?



Oh excellent, then better (and more portable!) tools are available:

http://pants.build

https://ninja-build.org

https://buck.build

and, if you hate yourself: https://bazel.build

> What exactly are you talking about? Are you upset that make isn't a cross-platform package management system?

Ok, so you were serious with your claims of portability, that is concerning.

The majority of times I've seen Make used it's primarily been as a task runner.

For example:

    TAG=some-service

    SVC=website.com/$(TAG)
    BUILDER=golang:1.19-alpine
    export REVISION_ID?=unknown
    export BUILD_DATE?=unknown

    RUN=docker run --rm \
     -v $(CURDIR):/opt/go/src/$(SVC) \
     -w /opt/go/src/$(SVC) \
     -e GO111MODULE=on

    build:
    ifeq ($(OS),Windows_NT)
    # Workaround on Windows for https://github.com/golang/dep/issues/1407
     $(RUN) $(BUILDER) rm -rf vendor vendor.orig
     $(RUN) $(BUILDER) rm -rf vendor vendor.orig
    endif
     $(RUN) -e CGO_ENABLED=0 -e GOOS=linux $(BUILDER) \
      go build -o service -ldflags "-s -X main.revisionID=$(REVISION_ID) -X main.buildDate=$(BUILD_DATE)" \
      ./cmd/some-service/...

    # $(RUN) $(BUILDER) rhash --sha256 service -o service.sha256
     docker build --tag="$(TAG):$(REVISION_ID)" --tag="$(TAG):latest" .

    run:
     docker-compose up

    serve:
     go run ./cmd/some-service/...

    dev:
     ulimit -n 1000 #increase the file watch limit, might required on MacOS
     reflex -s -r '\.go$$' make serve
^ the only thing this is "using" of Make is the name "Make" and it's so much worse to actually debug than a bash script, it's even got workarounds for various platforms inside of it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: