snappy-java/Makefile.package

88 lines
2.6 KiB
Makefile
Raw Normal View History

2011-03-31 05:23:57 +02:00
# Makefile for building and collecting native libraries in Win/Mac/Linux (32/64bit).
include Makefile.common
RESOURCE_DIR=src/main/resources
NATIVE_DIR=$(RESOURCE_DIR)/native
RSYNC=rsync -av -e ssh --exclude=".hg"
WORK:=work/hg/snappy-java
2011-03-31 05:23:57 +02:00
WIN64_SERVER=localhost
MAC_SERVER=172.16.133.41
MAC_TIGER_SERVER=172.16.133.171
2011-03-31 05:23:57 +02:00
AMD_SERVER=hx02
2011-03-31 05:23:57 +02:00
BUILD_CMD_PREFIX = hg pull -u && make clean-native && make
BUILD_CMD = $(BUILD_CMD_PREFIX) native
2011-03-31 05:23:57 +02:00
TEST_CMD = mvn test
all: compile test
.PHONY: compile test native clean
DLL_DIR=src/main/resources/org/xerial/snappy/native
2011-03-31 05:23:57 +02:00
DLL_WIN=$(DLL_DIR)/Windows/x86/snappyjava.dll
DLL_WIN64=$(DLL_DIR)/Windows/amd64/snappyjava.dll
DLL_MAC=$(DLL_DIR)/Mac/x86_64/libsnappyjava.jnilib
DLL_TIGER_MAC=$(DLL_DIR)/Mac/i386/libsnappyjava.jnilib
DLL_LINUX=$(DLL_DIR)/Linux/i386/libsnappyjava.so
DLL_AMD64=$(DLL_DIR)/Linux/amd64/libsnappyjava.so
2011-03-31 05:23:57 +02:00
$(DLL_WIN):
ssh $(WIN64_SERVER) "source .zprofile && cd $(WORK) && $(BUILD_CMD_PREFIX) win32"
mkdir -p $(dir $(DLL_WIN))
$(RSYNC) $(WIN_SERVER):./$(WORK)/$(DLL_WIN) $(DLL_WIN)
2011-03-31 05:23:57 +02:00
$(DLL_WIN64):
ssh $(WIN64_SERVER) "source .zprofile && cd $(WORK) && $(BUILD_CMD)"
mkdir -p $(dir $(DLL_WIN64))
$(RSYNC) $(WIN64_SERVER):./$(WORK)/$(DLL_WIN64) $(DLL_WIN64)
2011-03-31 05:23:57 +02:00
$(DLL_MAC):
ssh $(MAC_SERVER) "source .zprofile && cd $(WORK) && $(BUILD_CMD)"
mkdir -p $(dir $(DLL_MAC))
$(RSYNC) $(MAC_SERVER):./$(WORK)/$(DLL_MAC) $(DLL_MAC)
2011-03-31 05:23:57 +02:00
$(DLL_TIGER_MAC):
ssh $(MAC_TIGER_SERVER) "source .zprofile && cd $(WORK) && $(BUILD_CMD)"
mkdir -p $(dir $(DLL_TIGER_MAC))
$(RSYNC) $(MAC_TIGER_SERVER):./$(WORK)/$(DLL_TIGER_MAC) $(DLL_TIGER_MAC)
2011-03-31 05:23:57 +02:00
$(DLL_LINUX):
ssh $(AMD_SERVER) "source .zprofile && cd $(WORK) && $(BUILD_CMD_PREFIX) linux32"
mkdir -p $(dir $(DLL_LINUX))
$(RSYNC) $(AMD_SERVER):./$(WORK)/$(DLL_LINUX) $(DLL_LINUX)
2011-03-31 05:23:57 +02:00
$(DLL_AMD64):
ssh $(AMD_SERVER) "source .zprofile && cd $(WORK) && $(BUILD_CMD)"
mkdir -p $(dir $(DLL_AMD64))
$(RSYNC) $(AMD_SERVER):./$(WORK)/$(DLL_AMD64) $(DLL_AMD64)
2011-03-31 05:23:57 +02:00
native: $(DLL_WIN) $(DLL_WIN64) $(DLL_MAC) $(DLL_TIGER_MAC) $(DLL_LINUX) $(DLL_AMD64)
2011-03-31 05:23:57 +02:00
compile: native
cp -r $(DLL_DIR)/ $(RESOURCE_DIR)/native/
test:
ssh $(WIN64_SERVER) "source .zprofile && cd $(WORK) && $(TEST_CMD)"
ssh $(MAC_SERVER) "source .zprofile && cd $(WORK) && $(TEST_CMD)"
ssh $(MAC_TIGER_SERVER) "source .zprofile && cd $(WORK) && $(TEST_CMD)"
ssh $(AMD_SERVER) "source .zprofile && cd $(WORK) && $(TEST_CMD)"
2011-03-31 05:23:57 +02:00
release:
mvn release:prepare
mvn release:perform
release-xerial:
mvn release:perform -Dtag=snappy-java-$(VERSION)
2011-03-31 05:23:57 +02:00
release-sourceforge:
mvn release:perform -Darguments="-P sourceforge" -Dtag=snappy-java-$(VERSION)