47 lines
1.3 KiB
Makefile
47 lines
1.3 KiB
Makefile
# makefile for build package
|
|
|
|
build_root=$(shell pwd)
|
|
project=ems
|
|
# os platform
|
|
platform=ub22
|
|
build_dir=$(build_root)/build
|
|
release_dir=$(build_root)/release
|
|
extra_dir=$(build_root)/extra
|
|
|
|
package_name=$(project)-$(version)-$(platform)
|
|
package_dir=$(package_name)
|
|
package_path=$(build_dir)/$(package_name)
|
|
svc_root=$(build_root)/../svc.ems
|
|
svc_bin=$(svc_root)/bin
|
|
web_root=$(build_root)/../web.ems
|
|
package_file=$(package_name).tgz
|
|
|
|
# 获取当前时间
|
|
current_date=$(shell date "+%Y-%m-%d %H:%M:%S")
|
|
# 文件路径
|
|
vfile=$(extra_dir)/emsVersion
|
|
# 读取版本信息
|
|
version=$(shell grep "Version:" $(vfile) | awk -F' ' '{print $$2}')
|
|
|
|
print-version:
|
|
@echo "Version: $(version)"
|
|
|
|
package:
|
|
# 输出版本信息和更新后的日期
|
|
@echo "Version: $(version)"
|
|
@echo "Release Date: $(current_date)"
|
|
|
|
rm -rf $(package_path)
|
|
mkdir -p $(package_path)
|
|
# cp bin dir
|
|
cp -rf $(svc_bin) $(package_path)
|
|
# cp extra file
|
|
# update release date
|
|
sed -i "s/Release Date:.*/Release Date: $(current_date)/" $(vfile)
|
|
cp -rf $(extra_dir)/* $(package_path)
|
|
# cp web file
|
|
mkdir -p $(package_path)/web
|
|
cp -rf $(web_root)/* $(package_path)/web
|
|
# cd $(build_dir)
|
|
tar cvfz $(build_dir)/$(package_file) -C $(package_path) $(package_name)
|
|
mv -f $(build_dir)/$(package_file) $(release_dir)
|