Skip to content

Commit

Permalink
Transitioning from regression_test.py to Makefile
Browse files Browse the repository at this point in the history
Note: Depends upon picking up new jrpcclient/regression_test.py option
      [i.e. be sure to "git submodule update"

TODO: Need to check on test_middleware() step (if it's still needed)
      Need to handle non-CentOS case (i.e. Ubuntu)
      Need to handle "--deb-builder" case (no "sudo -E" on install steps)
  • Loading branch information
Ed McClanahan committed Dec 24, 2017
1 parent 5fdc503 commit 5f908d7
Show file tree
Hide file tree
Showing 31 changed files with 211 additions and 1 deletion.
29 changes: 29 additions & 0 deletions GoMakefile
@@ -0,0 +1,29 @@
# GoMakefile is a template to be included by Go package Makefile's in this repo

all: fmt install generate test vet

.PHONY: all bench clean cover fmt generate install test vet

bench:
go test -bench $(gosubdir)

clean:
go clean -i $(gosubdir)

cover:
go test -cover $(gosubdir)

fmt:
go fmt $(gosubdir)

generate:
go generate $(gosubdir)

install:
go install -gcflags "-N -l" $(gosubdir)

test:
go test $(gosubdir)

vet:
go vet $(gosubdir)
97 changes: 97 additions & 0 deletions Makefile
@@ -0,0 +1,97 @@
gosubdirs = \
blunder \
cleanproxyfs \
conf \
dlm \
fs \
fsworkout \
fuse \
headhunter \
httpserver \
inode \
inodeworkout \
jrpcfs \
logger \
mkproxyfs mkproxyfs/mkproxyfs \
pfs-stress \
pfsconfjson pfsconfjsonpacked \
pfsworkout \
platform \
proxyfsd proxyfsd/proxyfsd \
ramswift ramswift/ramswift \
stats \
statslogger \
swiftclient \
utils

uname := $(shell uname)

ifeq ($(uname),Linux)
all: fmt install stringer generate test vet c-clean c-build c-install c-test
else
all: fmt install stringer generate test vet
endif

.PHONY: all bench c-build c-clean c-install c-test clean cover fmt generate install stringer test vet

bench:
@for gosubdir in $(gosubdirs); do \
$(MAKE) --no-print-directory -C $$gosubdir bench; \
done

c-build:
$(MAKE) --no-print-directory -C jrpcclient all
$(MAKE) --no-print-directory -C vfs

c-clean:
$(MAKE) --no-print-directory -C jrpcclient clean
$(MAKE) --no-print-directory -C vfs clean

c-install:
# TODO: For both jrpcclient & vfs:
# Need to handle deb-builder case that doesn't want to use "sudo -E" to invoke $(MAKE)
# Need to handle non-CentOS case that wants to just do $(MAKE) install
sudo -E $(MAKE) --no-print-directory -C jrpcclient installcentos
sudo -E $(MAKE) --no-print-directory -C vfs installcentos

c-test:
cd jrpcclient ; ./regression_test.py --just-test-libs ; cd -

clean:
rm -f $(GOPATH)/bin/stringer
@for gosubdir in $(gosubdirs); do \
$(MAKE) --no-print-directory -C $$gosubdir clean; \
done

cover:
@for gosubdir in $(gosubdirs); do \
$(MAKE) --no-print-directory -C $$gosubdir cover; \
done

fmt:
@for gosubdir in $(gosubdirs); do \
$(MAKE) --no-print-directory -C $$gosubdir fmt; \
done

generate:
@for gosubdir in $(gosubdirs); do \
$(MAKE) --no-print-directory -C $$gosubdir generate; \
done

install:
@for gosubdir in $(gosubdirs); do \
$(MAKE) --no-print-directory -C $$gosubdir install; \
done

stringer:
go install github.com/swiftstack/ProxyFS/vendor/golang.org/x/tools/cmd/stringer

test:
@for gosubdir in $(gosubdirs); do \
$(MAKE) --no-print-directory -C $$gosubdir test; \
done

vet:
@for gosubdir in $(gosubdirs); do \
$(MAKE) --no-print-directory -C $$gosubdir vet; \
done
3 changes: 3 additions & 0 deletions blunder/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/blunder

include ../GoMakefile
3 changes: 3 additions & 0 deletions cleanproxyfs/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/cleanproxyfs

include ../GoMakefile
3 changes: 3 additions & 0 deletions conf/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/conf

include ../GoMakefile
3 changes: 3 additions & 0 deletions dlm/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/dlm

include ../GoMakefile
3 changes: 3 additions & 0 deletions fs/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/fs

include ../GoMakefile
3 changes: 3 additions & 0 deletions fsworkout/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/fsworkout

include ../GoMakefile
3 changes: 3 additions & 0 deletions fuse/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/fuse

include ../GoMakefile
3 changes: 3 additions & 0 deletions headhunter/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/headhunter

include ../GoMakefile
3 changes: 3 additions & 0 deletions httpserver/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/httpserver

include ../GoMakefile
3 changes: 3 additions & 0 deletions inode/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/inode

include ../GoMakefile
3 changes: 3 additions & 0 deletions inodeworkout/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/inodeworkout

include ../GoMakefile
2 changes: 1 addition & 1 deletion jrpcclient
3 changes: 3 additions & 0 deletions jrpcfs/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/jrpcfs

include ../GoMakefile
3 changes: 3 additions & 0 deletions logger/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/logger

include ../GoMakefile
3 changes: 3 additions & 0 deletions mkproxyfs/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/mkproxyfs

include ../GoMakefile
3 changes: 3 additions & 0 deletions mkproxyfs/mkproxyfs/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/mkproxyfs/mkproxyfs

include ../../GoMakefile
3 changes: 3 additions & 0 deletions pfs-stress/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/pfs-stress

include ../GoMakefile
3 changes: 3 additions & 0 deletions pfsconfjson/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/pfsconfjson

include ../GoMakefile
3 changes: 3 additions & 0 deletions pfsconfjsonpacked/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/pfsconfjsonpacked

include ../GoMakefile
3 changes: 3 additions & 0 deletions pfsworkout/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/pfsworkout

include ../GoMakefile
3 changes: 3 additions & 0 deletions platform/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/platform

include ../GoMakefile
3 changes: 3 additions & 0 deletions proxyfsd/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/proxyfsd

include ../GoMakefile
3 changes: 3 additions & 0 deletions proxyfsd/proxyfsd/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/proxyfsd/proxyfsd

include ../../GoMakefile
3 changes: 3 additions & 0 deletions ramswift/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/ramswift

include ../GoMakefile
3 changes: 3 additions & 0 deletions ramswift/ramswift/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/ramswift/ramswift

include ../../GoMakefile
3 changes: 3 additions & 0 deletions stats/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/stats

include ../GoMakefile
3 changes: 3 additions & 0 deletions statslogger/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/statslogger

include ../GoMakefile
3 changes: 3 additions & 0 deletions swiftclient/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/swiftclient

include ../GoMakefile
3 changes: 3 additions & 0 deletions utils/Makefile
@@ -0,0 +1,3 @@
gosubdir := github.com/swiftstack/ProxyFS/utils

include ../GoMakefile

0 comments on commit 5f908d7

Please sign in to comment.