github.com/holochain/holochain-proto@v0.1.0-alpha-26.0.20200915073418-5c83169c9b5b/Makefile (about)

     1  ifndef GOPATH
     2  $(error GOPATH *must* be defined)
     3  endif
     4  
     5  GOBIN = $(value GOPATH)/bin
     6  
     7  ifeq ($(OS),Windows_NT)
     8  $(warning using hardcoded repo of github.com/holochain/holochain-proto)
     9  REPO = github.com/holochain/holochain-proto
    10  else
    11  REPO = $(CURDIR:$(GOPATH)/src/%=%)
    12  endif
    13  # Remove a $(GOPATH)/src/ from the beginning of the current directory.
    14  # Likely to be github.com/holochain/holochain-proto
    15  
    16  go_packages = . ./ui ./apptest $(sort $(dir $(wildcard ./cmd/*/)))
    17  # List of directories containing go packages
    18  
    19  ifndef HOME
    20  # Is probably a windows machine
    21  ifdef USERPROFILE
    22  HOME = $(USERPROFILE)
    23  # Windows variable for home is USERPROFILE
    24  else
    25  $(error unable to get home directory)
    26  endif
    27  endif
    28  
    29  HOLOPATH ?= $(HOME)/.holochain
    30  # Default .holochain location
    31  
    32  TEST_FLAGS = -v
    33  
    34  define new_line
    35  
    36  
    37  endef
    38  
    39  .PHONY: hcd hcdev hcadmin bs test deps work pub
    40  # Anything which requires deps should end with: gx-go rewrite --undo
    41  
    42  all: deps
    43  	$(foreach pkg_path,$(go_packages),go get $(pkg_path) ${new_line})
    44  	gx-go rewrite --undo
    45  hcd: deps
    46  	go get $(REPO)/cmd/hcd
    47  	gx-go rewrite --undo
    48  hcdev: deps
    49  	go get $(REPO)/cmd/hcdev
    50  	gx-go rewrite --undo
    51  hcadmin: deps
    52  	go get $(REPO)/cmd/hcadmin
    53  	gx-go rewrite --undo
    54  bs: deps
    55  	go get $(REPO)/cmd/bs
    56  	gx-go rewrite --undo
    57  test: deps
    58  	$(foreach pkg_path,$(go_packages),go get -d -t $(pkg_path) && go test $(TEST_FLAGS) $(pkg_path)${new_line})
    59  	gx-go rewrite --undo
    60  deps: $(GOBIN)/gx $(GOBIN)/gx-go
    61  	gx-go get $(REPO)
    62  $(GOBIN)/gx:
    63  	go get -u github.com/whyrusleeping/gx
    64  $(GOBIN)/gx-go:
    65  	go get -u github.com/whyrusleeping/gx-go
    66  work: $(GOBIN)/gx-go
    67  	gx-go rewrite
    68  pub: $(GOBIN)/gx-go
    69  	gx-go rewrite --undo