rexforge/Makefile
2025-01-28 11:17:46 +01:00

47 lines
1.3 KiB
Makefile

VERSION_FILE := VERSION.txt
ifeq ($(wildcard $(VERSION_FILE)),)
$(shell bash ./generate_version.sh $VERSION_FILE)
endif
REX_VERSION := $(shell cat $(VERSION_FILE))
RELEASE_NAME := rexforge_$(REX_VERSION)
export REX_VERSION
help:
@echo -e "Makefile for $(RELEASE_NAME)\n"
@echo "Available targets:"
@echo " release - Create a release version and package"
@echo " clean - Clean up build files"
@echo " container - Build an OCI container (requires podman)"
@echo " help - Show this help message"
release: $(RELEASE_NAME)
make -C ./rex_client
make -C ./rex_server
mv ./rex_client/rexclient $(RELEASE_NAME)
mv ./rex_server/rexserver $(RELEASE_NAME)
cp ./LICENSE.txt $(RELEASE_NAME)
cp ./VERSION.txt $(RELEASE_NAME)
cp ./README.md $(RELEASE_NAME)
mkdir -p $(RELEASE_NAME)/source
cp ./VERSION.txt $(RELEASE_NAME)/source
git ls-files | xargs -I{} cp --parents {} $(RELEASE_NAME)/source
date -I > $(RELEASE_NAME)/VERSION.txt
echo $(rev) >> $(RELEASE_NAME)/VERSION.txt
go version >> $(RELEASE_NAME)/VERSION.txt
tar cvzf $(RELEASE_NAME).tar.gz $(RELEASE_NAME)
$(RELEASE_NAME):
mkdir -p $@
container:
podman build -t rexserver -f container/Containerfile .
clean:
make -C ./rex_client clean
make -C ./rex_server clean
rm -rf *.tar.gz
rm -rf rexforge_*
.PHONY: release clean container help