diff --git a/Makefile b/Makefile index 88fb675..13b8ecc 100644 --- a/Makefile +++ b/Makefile @@ -1,39 +1,53 @@ install: - cd backend && dep ensure - cd backend && go install ./... - cd frontend && npm install + @echo "* Installing Go dependencies" + @cd backend && dep ensure + @echo "* Pre-building Go code" + @cd backend && go install ./... + @echo "* Installing JavaScript dependencies" + @cd frontend && npm install &> /dev/null build: assets - go build -tags=binassets -o backend/build/cmdui backend/main.go - @echo Build complete! - @echo Binary is located at backend/build/cmdui + @echo "* Building binary" + @go build -tags=binassets -o backend/build/cmdui backend/main.go + @echo "* Build complete!" + @echo "* Binary is located at backend/build/cmdui" build_linux: assets build_docker build_docker: - cd backend && docker build . -t cmdui:build - cd backend && docker run -i -v ${PWD}/backend/build:/build cmdui:build \ - go build -tags=binassets -o /build/cmdui_linux main.go - gzip -kf backend/build/cmdui_linux - @echo Build complete! - @echo Binary: backend/build/cmdui_linux - @echo GZIP: backend/build/cmdui_linux.gz + @echo "* Preparing Docker image" + @cd backend && docker build . -t cmdui:build &>/dev/null + @echo "* Building Linux binary" + @cd backend && docker run -i -v ${PWD}/backend/build:/build cmdui:build \ + go build -tags=binassets -o /build/cmdui_linux main.go \ + &>/dev/null + @echo "* Creating GZIP archive" + @gzip -kf backend/build/cmdui_linux + @echo "* Build complete!" + @echo "* Binary: backend/build/cmdui_linux" + @echo "* GZIP: backend/build/cmdui_linux.gz" assets: - cd frontend && npm run build - go-bindata-assetfs \ + @echo "* Compiling asset files" + @cd frontend && npm run build &>/dev/null + @echo "* Building embedded assets file" + @go-bindata-assetfs \ -o=backend/api/assets/bindata_assetfs.go \ -pkg=assets \ -prefix=frontend/build \ - frontend/build/... + frontend/build/... \ + &>/dev/null clean: - rm -rf frontend/build - rm -rf backend/build - rm -f backend/api/assets/bindata_assetfs.go + @echo "* Removing build artefacts" + @rm -rf frontend/build + @rm -rf backend/build + @rm -f backend/api/assets/bindata_assetfs.go create_db: - sqlite3 backend/data/cmdui.db < backend/schema_sqlite.sql + @echo "* Creating a blank database" + @sqlite3 backend/data/cmdui.db < backend/schema_sqlite.sql + @echo "* Here it is: backend/data/cmdui.db" cloc: - cloc --exclude-dir=vendor,build,node_modules . + @cloc --exclude-dir=vendor,build,node_modules .