Skip to content

Commit

Permalink
Merge pull request #414 from skycoin/fix/fix-build-and-test-makefile-…
Browse files Browse the repository at this point in the history
…target

Fix test and build targets in makefile
  • Loading branch information
jdknives committed Feb 28, 2021
2 parents 0614ff3 + 2fe3f0a commit 07abdec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 25 deletions.
11 changes: 2 additions & 9 deletions .travis.yml
Expand Up @@ -17,18 +17,11 @@ matrix:
dist: xenial
- os: osx

# Install necessaries go packages
install:
- make install
- make install-gfx-deps
- make install-linters

# Build, test & run cx test
script:
- make build-full
- make build
- make install
- make test
- make test-full
- make lint

# Notifications to Telegram channel
notifications:
Expand Down
22 changes: 6 additions & 16 deletions Makefile
@@ -1,8 +1,8 @@
export GO111MODULE=on

.DEFAULT_GOAL := help
.PHONY: build-parser build build-full test test-full
.PHONY: install-deps install install-full
.PHONY: build-parser build test
.PHONY: install
.PHONY: dep

PWD := $(shell pwd)
Expand Down Expand Up @@ -65,42 +65,32 @@ ifeq ($(UNAME_S), Linux)
endif

build: ## Build CX from sources
go build $(GO_OPTS) -tags="base" -o ./bin/cx github.com/skycoin/cx/cxgo/
go build $(GO_OPTS) -tags="base" -o ./bin/cx github.com/skycoin/cx/cmd/cx
chmod +x ./bin/cx

clean: ## Removes binaries.
rm -r ./bin/cx

build-full: install-full ## Build CX from sources with all build tags
go build $(GO_OPTS) -tags="base cxfx" -o ./bin/cx github.com/skycoin/cx/cxgo/
chmod +x ./bin/cx

token-fuzzer:
go build $(GO_OPTS) -o ./bin/cx-token-fuzzer $(PWD)/development/token-fuzzer/main.go
chmod +x ${GOPATH}/bin/cx-token-fuzzer

build-parser: install-deps ## Generate lexer and parser for CX grammar
build-parser: ## Generate lexer and parser for CX grammar
./bin/goyacc -o cxgo/cxgo0/cxgo0.go cxgo/cxgo0/cxgo0.y
./bin/goyacc -o cxgo/parser/cxgo.go cxgo/parser/cxgo.y

install: install-deps build configure-workspace ## Install CX from sources. Build dependencies
install: configure-workspace ## Install CX from sources. Build dependencies
@echo 'NOTE:\tWe recommend you to test your CX installation by running "cx ./tests"'
./bin/cx -v

install-full: configure-workspace

test: ## Run CX test suite.
ifndef CXVERSION
@echo "cx not found in $(PWD)/bin, please run make install first"
else
# go test $(GO_OPTS) -race -tags base github.com/skycoin/cx/cxgo/
./bin/cx ./lib/args.cx ./tests/main.cx ++wdir=./tests ++disable-tests=gui,issue
./bin/cx ./lib/args.cx ./tests/main.cx ++wdir=./tests ++disable-tests=gui,issue ++cxpath=$(PWD)/bin/cx
endif

test-full: build ## Run CX test suite with all build tags
# go test $(GO_OPTS) -race -tags="base cxfx" github.com/skycoin/cx/cxgo/
./bin/cx ./lib/args.cx ./tests/main.cx ++wdir=./tests ++disable-tests=gui,issue

configure-workspace: ## Configure CX workspace environment
mkdir -p $(CX_PATH)/src $(CX_PATH)/bin $(CX_PATH)/pkg
@echo "NOTE:\tCX workspace at $(CX_PATH)"
Expand Down

0 comments on commit 07abdec

Please sign in to comment.