From 3a6703a947b36168e29fc927d4362c558d8f2af3 Mon Sep 17 00:00:00 2001 From: Paul Marks Date: Sat, 26 Aug 2017 15:30:00 -0700 Subject: [PATCH] Makefile: Implement chrome target, and extract the version number. --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9474d14..9ce39f8 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ BUILDDIR := build/ NAME := ipvfoo +VERSION := $(shell cat src/manifest.json | \ + sed -n 's/^ *"version": *"\([0-9.]\+\)".*/\1/p' | \ + head -n1) all: prepare firefox chrome @@ -7,11 +10,12 @@ prepare: mkdir -p build firefox: prepare - rm -f ${BUILDDIR}${NAME}.xpi - cd src && zip -9r ../${BUILDDIR}${NAME}.xpi * + rm -f ${BUILDDIR}${NAME}-${VERSION}.xpi + cd src && zip -9r ../${BUILDDIR}${NAME}-${VERSION}.xpi * chrome: - echo "Chrome build not implemented, package manually" + rm -f ${BUILDDIR}${NAME}-${VERSION}.zip + zip -9r ${BUILDDIR}${NAME}-${VERSION}.zip src clean: rm -rf ${BUILDDIR}