github.com/ggreg80/ketos@v0.0.0-20171109040536-049616f51ddb/Makefile (about)

     1  KETOS_GO_EXEC ?= go
     2  KETOS_DEP_EXEC ?= dep
     3  VERSION ?= $(shell git describe --tags)
     4  
     5  VERSION_PKG = github.com/setekhid/ketos/cmd/version
     6  XCB_PKG = github.com/setekhid/ketos/cmd/xcb
     7  CHR_PKG = github.com/setekhid/ketos/cmd/chr
     8  HOOKROOT_PKG = github.com/setekhid/ketos/libcfs
     9  
    10  
    11  build: xcb chr libketos-hookroot.so
    12  
    13  test:
    14  	go test -short -race $(shell go list ./... | grep -v /vendor/)
    15  
    16  install: build test
    17  	install -d ${DESTDIR}/usr/local/bin/
    18  	install -m 755 ./xcb ${DESTDIR}/usr/local/bin/xcb
    19  	install -m 755 ./bin/keto.sh ${DESTDIR}/usr/local/bin/keto.sh
    20  	install -d ${DESTDIR}/usr/local/lib/
    21  	install -m 755 \
    22  		./libketos-hookroot.so ${DESTDIR}/usr/local/lib/libketos-hookroot.so
    23  
    24  xcb: $(shell find . -name '*.go')
    25  	${KETOS_GO_EXEC} build \
    26  		-ldflags "-X ${VERSION_PKG}.Version=${VERSION}" \
    27  		-o xcb ${XCB_PKG}
    28  
    29  chr: $(shell find . -name '*.go')
    30  	${KETOS_GO_EXEC} build \
    31  		-o chr ${CHR_PKG}
    32  
    33  libketos-hookroot.so: $(shell find . -name '*.go')
    34  	${KETOS_GO_EXEC} build \
    35  		-ldflags "-X ${HOOKROOT_PKG}.ketos_libcfs_version=${VERSION}" \
    36  		-buildmode=c-shared \
    37  		-o libketos-hookroot.so ${HOOKROOT_PKG}
    38  
    39  clean:
    40  	rm -rfv xcb chr libketos-hookroot.so
    41  
    42  vendor: Gopkg.lock Gopkg.toml
    43  	${KETOS_DEP_EXEC} ensure -vendor-only
    44  
    45  .PHONY: build test install clean