go-paste/Makefile

44 lines
951 B
Makefile
Raw Normal View History

ROUTE_ASSET=routes/bindata.go
ROUTE_FILES=$(wildcard assets/src/*) $(wildcard assets/public/*)
2018-02-15 09:11:52 -07:00
VENDOR_FILES=$(wildcard vendor/*)
SOURCE=./*.go routes/*.go
BINARY=paste
all: $(BINARY)
clean:
rm -f $(BINARY) $(ROUTE_ASSET) $(ROUTE_FILES)
setup:
dep ensure
go get github.com/jteeuwen/go-bindata/...
go get github.com/elazarl/go-bindata-assetfs/...
2018-02-15 08:01:35 -07:00
run: $(BINARY)
./$(BINARY) -vv serve
2017-05-22 11:13:47 -06:00
2018-02-15 09:11:52 -07:00
$(BINARY): $(SOURCE) $(ROUTE_ASSET) $(VENDOR_FILES)
go build
$(ROUTE_ASSET): $(ROUTE_FILES)
cd assets; \
rm -rf build ../public; \
npm run build; \
cp -r build ../public; \
export PATH=$$GOPATH/bin:$$PATH; \
cd ../routes; \
go-bindata-assetfs -pkg routes \
-prefix ../ \
../public/ \
../public/static/css/ \
../public/static/js/ \
../public/static/media/
2017-10-13 16:41:48 -06:00
2018-02-15 09:11:52 -07:00
deploy: $(SOURCE) $(ROUTE_ASSET)
cd debian && make
.PHONEY: all clean deploy run setup