github.com/uvalib/orcid-access-ws@v0.0.0-20250612130209-7d062dbabf9d/Makefile (about)

     1  #
     2  # Standard makefile for go projects
     3  #
     4  
     5  # standard definitions
     6  GOCMD=go
     7  GOBUILD=$(GOCMD) build
     8  GOCLEAN=$(GOCMD) clean
     9  GOTEST=$(GOCMD) test
    10  GOVET=$(GOCMD) vet
    11  GOFMT=$(GOCMD) fmt
    12  GOGET=$(GOCMD) get
    13  GOMOD=$(GOCMD) mod
    14  BIN=bin
    15  
    16  # project specific definitions
    17  BASE_NAME=orcid-access-ws
    18  SRC_TREE=orcidaccessws
    19  RUNNER=scripts/entry.sh
    20  PACKAGE=github.com/uvalib/$(BASE_NAME)
    21  
    22  all: build-darwin build-linux
    23  
    24  build-darwin:
    25  	GOOS=darwin GOARCH=amd64 $(GOBUILD) -a -o $(BIN)/$(BASE_NAME).darwin $(PACKAGE)/$(SRC_TREE)
    26  
    27  build-linux:
    28  	CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -a -installsuffix cgo -o $(BIN)/$(BASE_NAME).linux $(PACKAGE)/$(SRC_TREE)
    29  
    30  test:
    31  	$(GOCLEAN) -testcache $(PACKAGE)/...
    32  	$(GOTEST) -v $(PACKAGE)/$(SRC_TREE)/tests $(if $(TEST),-run $(TEST),)
    33  
    34  fmt:
    35  	$(GOFMT) $(PACKAGE)/...
    36  
    37  vet:
    38  	$(GOVET) $(PACKAGE)/...
    39  
    40  clean:
    41  	$(GOCLEAN) $(PACKAGE)/...
    42  	rm -f $(BIN)/$(BASE_NAME).*
    43  
    44  run:
    45  	cd $(BIN); rm -f $(BASE_NAME)
    46  	cd $(BIN); ln -s $(BASE_NAME).darwin $(BASE_NAME)
    47  	$(RUNNER)
    48  
    49  dep:
    50  	cd $(SRC_TREE); $(GOGET) -u
    51  	$(GOMOD) tidy
    52  	$(GOMOD) verify
    53  
    54  #
    55  # end of file
    56  #