carnetdejeu-crystal/Makefile

40 lines
860 B
Makefile
Raw Permalink Normal View History

APP := $(shell head -n 1 "shard.yml"|cut -d ':' -f 2|tr -d ' ')
VERSION := $(shell sed '2!d' "shard.yml"|cut -d ':' -f 2|tr -d ' ')
DEST = /tmp/${APP}
all: build
bin:
mkdir -p bin
bin/${APP}:
crystal build src/${APP}.cr -o bin/${APP} --release --stats
bin/amber:
crystal build lib/amber/src/amber/cli.cr -o bin/amber --stats
build: bin bin/${APP} bin/amber
dependencies:
shards install
${DEST}:
mkdir -p ${DEST}
${APP}-${VERSION}.tar.gz: build ${DEST}
mkdir -p ${DEST}/config/environments/ ${DEST}/src/locales
cp -r bin/ ${DEST}/
cp -r db/ ${DEST}/
cp -r public/ ${DEST}/
cp -r src/locales ${DEST}/src/locales
cp config/environments/.production.enc ${DEST}/config/environments/
tar cvfJ "${APP}-${VERSION}.tar.xz" -C /tmp/ ${APP}
rm -rf ${DEST}
extract: ${APP}-${VERSION}.tar.gz
clean:
rm -f bin/amber
rm -f bin/${APP}
rm -rf ${DEST}