Skip to content

Commit

Permalink
Makefile: introduce dist_build target
Browse files Browse the repository at this point in the history
dist_build builds Makefile.dist and luvit.gyp.dist. These files don't
depend on git.
  • Loading branch information
philips committed Jul 12, 2012
1 parent 0a3b668 commit d5a4e92
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -9,3 +9,4 @@ options.gypi
*.xcodeproj
out/
*.swp
*.dist
24 changes: 13 additions & 11 deletions Makefile
Expand Up @@ -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}

Expand Down

0 comments on commit d5a4e92

Please sign in to comment.