Permalink
Browse files

Makefile: introduce dist_build target

dist_build builds Makefile.dist and luvit.gyp.dist. These files don't
depend on git.
  • Loading branch information...
1 parent 0a3b668 commit d5a4e924009da5a6e7b1fc85451bb8857d10a410 @philips philips committed Jul 12, 2012
Showing with 14 additions and 11 deletions.
  1. +1 −0 .gitignore
  2. +13 −11 Makefile
View
@@ -9,3 +9,4 @@ options.gypi
*.xcodeproj
out/
*.swp
+*.dist
View
@@ -271,25 +271,27 @@ DIST_DIR?=${HOME}/luvit.io/dist
DIST_NAME=luvit-${VERSION}
DIST_FOLDER=${DIST_DIR}/${VERSION}/${DIST_NAME}
DIST_FILE=${DIST_FOLDER}.tar.gz
-tarball:
- rm -rf ${DIST_FOLDER} ${DIST_FILE}
- mkdir -p ${DIST_DIR}
- git clone . ${DIST_FOLDER}
- cp deps/gitmodules.local ${DIST_FOLDER}/.gitmodules
- cd ${DIST_FOLDER} ; git submodule update --init
- find ${DIST_FOLDER} -name ".git*" | xargs rm -r
+dist_build:
sed -e 's/^VERSION=.*/VERSION=${VERSION}/' \
-e 's/^LUAJIT_VERSION=.*/LUAJIT_VERSION=${LUAJIT_VERSION}/' \
-e 's/^UV_VERSION=.*/UV_VERSION=${UV_VERSION}/' \
-e 's/^HTTP_VERSION=.*/HTTP_VERSION=${HTTP_VERSION}/' \
- -e 's/^YAJL_VERSION=.*/YAJL_VERSION=${YAJL_VERSION}/' < ${DIST_FOLDER}/Makefile > ${DIST_FOLDER}/Makefile.patched
- mv ${DIST_FOLDER}/Makefile.patched ${DIST_FOLDER}/Makefile
+ -e 's/^YAJL_VERSION=.*/YAJL_VERSION=${YAJL_VERSION}/' < Makefile > Makefile.dist
sed -e 's/LUVIT_VERSION=".*/LUVIT_VERSION=\"${VERSION}\"'\'',/' \
-e 's/LUAJIT_VERSION=".*/LUAJIT_VERSION=\"${LUAJIT_VERSION}\"'\'',/' \
-e 's/UV_VERSION=".*/UV_VERSION=\"${UV_VERSION}\"'\'',/' \
-e 's/HTTP_VERSION=".*/HTTP_VERSION=\"${HTTP_VERSION}\"'\'',/' \
- -e 's/YAJL_VERSIONISH=".*/YAJL_VERSIONISH=\"${YAJL_VERSION}\"'\'',/' < ${DIST_FOLDER}/luvit.gyp > ${DIST_FOLDER}/luvit.gyp.patched
- mv ${DIST_FOLDER}/luvit.gyp.patched ${DIST_FOLDER}/luvit.gyp
+ -e 's/YAJL_VERSIONISH=".*/YAJL_VERSIONISH=\"${YAJL_VERSION}\"'\'',/' < luvit.gyp > luvit.gyp.dist
+
+tarball: dist_build
+ rm -rf ${DIST_FOLDER} ${DIST_FILE}
+ mkdir -p ${DIST_DIR}
+ git clone . ${DIST_FOLDER}
+ cp deps/gitmodules.local ${DIST_FOLDER}/.gitmodules
+ cd ${DIST_FOLDER} ; git submodule update --init
+ find ${DIST_FOLDER} -name ".git*" | xargs rm -r
+ mv Makefile.dist ${DIST_FOLDER}/Makefile
+ mv luvit.gyp.dist ${DIST_FOLDER}/luvit.gyp
tar -czf ${DIST_FILE} -C ${DIST_DIR}/${VERSION} ${DIST_NAME}
rm -rf ${DIST_FOLDER}

0 comments on commit d5a4e92

Please sign in to comment.