Permalink
Browse files

Added dist target.

  • Loading branch information...
1 parent d3b8061 commit 7958ad3f48eaa3bfb0cbcae59a748f1ab94adc8f taro committed Dec 1, 2009
Showing with 13 additions and 2 deletions.
  1. +13 −2 Makefile
View
@@ -1,6 +1,10 @@
all:
cd src; $(MAKE)
+VERSION=0.0.1
+TARBALL_NAME=mio-$(VERSION)
+DIST_TMP_DIR=tmp
+DIST_TARGET=$(DIST_TMP_DIR)/$(TARBALL_NAME)
check: all
/usr/local/lib/erlang/lib/common_test-1.4.1/priv/bin/run_test -dir . -logdir ./log -cover mio.coverspec -pa $(PWD)/ebin -include $(PWD)/include
@@ -17,8 +21,8 @@ vcheck: all # verbose
@./bin/stop.sh
install: all install_dirs
- @[ -n "$(TARGET_DIR)" ] || (echo "Please set TARGET_DIR. (ex) /usr/local/mio"; false)
- @[ -n "$(SBIN_DIR)" ] || (echo "Please set SBIN_DIR. (ex) /usr/sbin/"; false)
+ @[ -n "$(TARGET_DIR)" ] || (echo "Please set TARGET_DIR. e.g. /usr/local/mio"; false)
+ @[ -n "$(SBIN_DIR)" ] || (echo "Please set SBIN_DIR. e.g. /usr/sbin/"; false)
mkdir -p $(TARGET_DIR)
cp -rp ebin include $(TARGET_DIR)
for script in mio mioctl mio-env; do \
@@ -31,7 +35,14 @@ install_dirs:
mkdir -p $(SBIN_DIR)
mkdir -p $(TARGET_DIR)/sbin
+dist: dist-clean
+ mkdir $(DIST_TARGET)
+ cp -r Makefile ebin src include scripts README test $(DIST_TARGET)
+ chmod 0755 $(DIST_TARGET)/scripts/*
+ tar -zcf $(TARBALL_NAME).tar.gz $(DIST_TARGET)
+ rm -rf $(DIST_TMP_DIR)
+dist-clean: clean
clean:
cd src; $(MAKE) clean

0 comments on commit 7958ad3

Please sign in to comment.