Skip to content

Commit

Permalink
init version
Browse files Browse the repository at this point in the history
  • Loading branch information
haoel committed Sep 5, 2019
0 parents commit 1ca7285
Show file tree
Hide file tree
Showing 8 changed files with 7,831 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.vscode/
build/
downsampling.code-workspace
glide.lock
pkg/
src/vendor
vendor/
61 changes: 61 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.PHONY: default build clean depend vget vclean glide

MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MKFILE_DIR := $(dir $(MKFILE_PATH))

GOPATH := ${MKFILE_DIR}
export GOPATH
GOBUILD := ${GOPATH}build/
GOBIN := ${GOBUILD}bin
export GOBIN

GLIDE_CONF=${MKFILE_DIR}glide.yaml
GLIDE=${GOBIN}/glide
GLIDE_SYS := $(shell command -v glide)
TARGET=${MKFILE_DIR}build/bin/main
SOURCE=${MKFILE_DIR}src/main/main.go
ALL_SOURCE=$(shell find ${MKFILE_DIR}src -type f -name "*.go")

default: ${TARGET}


${TARGET}: ${ALL_SOURCE}
@echo "-------------- building ---------------"
mkdir -p ${MKFILE_DIR}build/bin/
cd ${MKFILE_DIR} && go build -i -v -ldflags "-s -w" -o ${TARGET} ${SOURCE}
mkdir -p ${GOBUILD}data/ && cp ${MKFILE_DIR}data/* ${GOBUILD}data/

build: default

clean:
@rm -rf ${TARGET} && rm -rf ${MKFILE_DIR}pkg && rm -rf ${GOBUILD}data/ && rm -rf ${GOBUILD}

${GLIDE}:
if [ -f ${GLIDE_SYS} ]; then \
mkdir -p ${GOBIN}; \
ln -s ${GLIDE_SYS} ${GLIDE}; \
fi
if [ ! -f ${GLIDE} ]; then \
GOPATH=${GOBUILD}; \
go get -v github.com/Masterminds/glide; \
rm -rf ${GOBUILD}pkg ${GOBUILD}src; \
fi


vget: ${GLIDE}
if [ ! -f ${GLIDE_CONF} ]; then ${GLIDE} init; fi
${GLIDE} install
ln -s ${MKFILE_DIR}vendor ${MKFILE_DIR}src/vendor

vupd: ${GLIDE}
rm -rf $(HOME)/.glide/cache
${GLIDE} update && ${GLIDE} install
#rm -rf ${MKFILE_DIR}src/vendor ${GLIDE} ${MKFILE_DIR}build/pkg ${MKFILE_DIR}build/src
ln -s ${MKFILE_DIR}vendor ${MKFILE_DIR}src/vendor

vclean:
rm -f ${MKFILE_DIR}glide.lock
rm -rf ${MKFILE_DIR}src/vendor ${GLIDE} ${MKFILE_DIR}build/pkg ${MKFILE_DIR}build/src
rm -dRf ${MKFILE_DIR}src/vendor ${MKFILE_DIR}vendor


Binary file added data/downsampling.chart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1ca7285

Please sign in to comment.