minio/pkg/contentdb/Makefile

27 lines
721 B
Makefile
Raw Normal View History

# Generate db.go from db.json downloaded nodejs mime-db project.
# NOTE: Autogenerated db.go needs to be vet proofed. \
Manually edit json -> JSON for all variable names
all: checkdeps download build
# go-bindata generates go source from any data file.
checkdeps:
@go get -u github.com/jteeuwen/go-bindata/...
# Download db.json from NodeJS's mime-db project. It is under MIT license.
download: checkdeps
@mkdir db
@wget -nv https://cdn.rawgit.com/jshttp/mime-db/master/db.json -O db/db.json
# After generating db.go, clean up downloaded db.json.
build: download
@go-bindata -pkg contentdb -o db.go db
@rm -fv db/db.json
@rm -rfv db
# Clean auto-generated files and backups.
clean:
@rm -rf db.go
@rm -f *~