Skip to content

Commit

Permalink
Merge pull request #69 from google/makefile
Browse files Browse the repository at this point in the history
Makefile cleanup
  • Loading branch information
josephlr authored Oct 3, 2017
2 parents a53b68f + 0271445 commit 18e2de7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ MOUNT ?= /mnt/$(NAME)_mount
ifneq ("$(wildcard $(MOUNT))","")
export TEST_FILESYSTEM_ROOT = $(MOUNT)
endif

# The flags code below lets the caller of the makefile change the build flags
# for fscrypt in a familiar manner.
# CFLAGS
Expand Down Expand Up @@ -121,16 +122,16 @@ gen:
# Update the vendored dependencies.
.PHONY: update
update:
@govendor init
@govendor fetch +missing
@govendor add +external
@govendor remove +unused
govendor init
govendor fetch +missing
govendor add +external
govendor remove +unused

# Format all the Go and C code
.PHONY: format format-check
format:
@goimports -l -w $(GO_FILES)
@clang-format -i -style=Google $(C_FILES)
goimports -l -w $(GO_FILES)
clang-format -i -style=Google $(C_FILES)

format-check:
@goimports -d $(GO_FILES) \
Expand Down Expand Up @@ -191,7 +192,7 @@ test-teardown:
travis-install: go-tools test-setup
go get -u github.com/mattn/goveralls

travis-script: lint format-check default
travis-script: lint format-check test default
goveralls -service=travis-ci
@govendor list +missing +external +unused \
| ./input_fail.py "Incorrect vendored dependencies. Run \"make update\"."
5 changes: 3 additions & 2 deletions input_fail.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/usr/bin/env python

# Exit with 1 if any input is provided. Print the input to stdout, unless an
# argument is specified. In that case, also print the argument.
# argument is specified. In that case, print the argument instead.

import sys

input_string = sys.stdin.read()
if input_string != "":
sys.stdout.write(input_string)
if len(sys.argv) >= 2:
print(sys.argv[1])
else:
sys.stdout.write(input_string)
sys.exit(1)

0 comments on commit 18e2de7

Please sign in to comment.