myx/Makefile
2022-10-05 11:35:08 +03:00

36 lines
1.1 KiB
Makefile

V:=$(shell cat VERSION)
TOP_DIR:=$(shell pwd)
BUILD_DIR:=$(TOP_DIR)/build
DEB_DIR:=$(BUILD_DIR)/deb/myx-cmake-$(V)
PACK_DIR:=$(BUILD_DIR)/pack/myx-cmake-$(V)
all: update_version deb pack
update_version:
sed -i "s/CMake.*REQUIRED/CMake $V REQUIRED/" $(TOP_DIR)/README.md $(TOP_DIR)/myx_setup.cmake
sed -i "s/VERSION \".*\"/VERSION \"$V\"/" $(TOP_DIR)/MyxCMake/MyxCMakeConfigVersion.cmake
sed -i "s/VERSION .* LANG/VERSION $V LANG/" $(TOP_DIR)/debian/CMakeLists.txt
sed -i "s/(.*)/($(V))/" $(TOP_DIR)/debian/changelog
deb:
rm -rf $(DEB_DIR)
mkdir -p $(DEB_DIR)
cp -ap "$(TOP_DIR)/MyxCMake" "$(TOP_DIR)/debian" "$(DEB_DIR)"
cd $(DEB_DIR); debuild
mv $(BUILD_DIR)/deb/*deb $(BUILD_DIR)
mv $(BUILD_DIR)/deb/*dsc $(BUILD_DIR)
mv $(BUILD_DIR)/deb/*xz $(BUILD_DIR)
pack:
rm -rf $(PACK_DIR)
mkdir -p $(PACK_DIR)
cp -ap $(TOP_DIR)/MyxCMake $(PACK_DIR)/myx
cp -ap $(TOP_DIR)/myx_setup.cmake $(PACK_DIR)
cd $(PACK_DIR); tar acf $(BUILD_DIR)/myx-cmake-local-$(V).tar.xz *
#cp -ap *.cmake lib backports "$D/myx-cmake-$V/MyxCMake"
#pushd "$D"
#tar Jcf "myx-cmake_${V}.orig.tar.xz" "myx-cmake-$V"
#popd