Rules.inc: Restored 'release' target for Supermodel3.com-hosted builds and added some comments

This commit is contained in:
Bart Trzynadlowski 2024-08-09 21:39:14 -07:00 committed by Bart Trzynadlowski
parent cf8a61fd9d
commit a0341cd1a4

View file

@ -220,29 +220,39 @@ INCLUDE_DIRS = $(sort $(foreach file,$(SRC_FILES),$(dir $(file))))
all: $(BIN_DIR)/$(OUTFILE) all: $(BIN_DIR)/$(OUTFILE)
# #
# Release targets: used only to create official builds stamped with the Git # Supermodel3.com release targets: used only to create official builds stamped
# version number. Double-colon rules should force ordered execution. # with the Git version number. Double-colon rules should force ordered
# The automated build script relies on these -- don't modify their output! # execution. The automated build script relies on these -- don't modify their
# output!
# #
.PHONY: clean .PHONY: clean
.PHONY: set_version .PHONY: set_version
.PHONY: print_message .PHONY: print_message
.PHONY: version .PHONY: version
release:: clean release:: set_version
release:: print_message release:: print_message
release:: clean
release:: all release:: all
#
# Github release flow (not yet used).
#
PKG_FILES += $(BIN_DIR)/$(OUTFILE) Docs/README.txt Docs/LICENSE.txt Config Assets PKG_FILES += $(BIN_DIR)/$(OUTFILE) Docs/README.txt Docs/LICENSE.txt Config Assets
pkg: pkg/$(PKG_TYPE) pkg: pkg/$(PKG_TYPE)
$(info Cleaning up : $(PKG_STAGE_PATH)) $(info Cleaning up : $(PKG_STAGE_PATH))
$(SILENT)cd pkg && rm -r $(notdir $(PKG_STAGE_PATH)) $(SILENT)cd pkg && rm -r $(notdir $(PKG_STAGE_PATH))
pkg/tgz: pkg/stage pkg/tgz: pkg/stage
$(info Creating package : $(PKG_PATH)) $(info Creating package : $(PKG_PATH))
$(SILENT)tar -C pkg -czf $(PKG_PATH) $(notdir $(PKG_STAGE_PATH)) $(SILENT)tar -C pkg -czf $(PKG_PATH) $(notdir $(PKG_STAGE_PATH))
pkg/zip: pkg/stage pkg/zip: pkg/stage
$(info Creating package : $(PKG_STAGE_PATH).zip) $(info Creating package : $(PKG_STAGE_PATH).zip)
$(SILENT)cd pkg && zip -r $(notdir $(PKG_PATH)) $(notdir $(PKG_STAGE_PATH)) $(SILENT)cd pkg && zip -r $(notdir $(PKG_PATH)) $(notdir $(PKG_STAGE_PATH))
pkg/stage:: all pkg/stage:: all
pkg/stage:: pkg/path pkg/stage:: pkg/path
$(info Staging package : $(PKG_STAGE_PATH)) $(info Staging package : $(PKG_STAGE_PATH))
$(SILENT)rm -rf $(PKG_PATH) $(PKG_STAGE_PATH) ; mkdir -p $(PKG_STAGE_PATH) $(SILENT)rm -rf $(PKG_PATH) $(PKG_STAGE_PATH) ; mkdir -p $(PKG_STAGE_PATH)
@ -256,29 +266,52 @@ pkg/stage:: pkg/path
mv Docs//* . && rmdir Docs mv Docs//* . && rmdir Docs
$(info Generating : $(PKG_STAGE_PATH)/CHANGES.txt) $(info Generating : $(PKG_STAGE_PATH)/CHANGES.txt)
$(SILENT)OUTPUT=$(PKG_STAGE_PATH)/CHANGES.txt ./Scripts/changelog.sh $(SILENT)OUTPUT=$(PKG_STAGE_PATH)/CHANGES.txt ./Scripts/changelog.sh
pkg/path: set_version pkg/path: set_version
$(eval PKG_STAGE_PATH = pkg/supermodel-$(VERSION)) $(eval PKG_STAGE_PATH = pkg/supermodel-$(VERSION))
$(eval PKG_PATH = pkg/supermodel-$(VERSION).$(PKG_TYPE)) $(eval PKG_PATH = pkg/supermodel-$(VERSION).$(PKG_TYPE))
@echo $(PKG_PATH) @echo $(PKG_PATH)
#
# Sets a VERSION variable based on the git sha.
#
set_version: set_version:
$(eval VERSION = $(strip $(subst ',,0.3a-git-$(shell git rev-parse --short HEAD --sq)))) $(eval VERSION = $(strip $(subst ',,0.3a-git-$(shell git rev-parse --short HEAD --sq))))
$(eval SUPERMODEL_BUILD_FLAGS += -DSUPERMODEL_VERSION=\"$(VERSION)\") $(eval SUPERMODEL_BUILD_FLAGS += -DSUPERMODEL_VERSION=\"$(VERSION)\")
#
# Prints a message containing the version number to stdout for informational
# purposes only.
#
print_message: set_version print_message: set_version
$(info Building Supermodel Version $(VERSION)) $(info Building Supermodel Version $(VERSION))
#
# Print *only* the version directly.
#
version: set_version version: set_version
@echo $(VERSION) @echo $(VERSION)
#
# Supermodel binary
#
$(BIN_DIR)/$(OUTFILE): $(BIN_DIR) $(OBJ_FILES) $(BIN_DIR)/$(OUTFILE): $(BIN_DIR) $(OBJ_FILES)
$(info --------------------------------------------------------------------------------) $(info --------------------------------------------------------------------------------)
$(info Linking Supermodel : $(BIN_DIR)/$(OUTFILE)) $(info Linking Supermodel : $(BIN_DIR)/$(OUTFILE))
$(SILENT)$(LD) $(OBJ_FILES) $(LDFLAGS) $(SILENT)$(LD) $(OBJ_FILES) $(LDFLAGS)
$(info --------------------------------------------------------------------------------) $(info --------------------------------------------------------------------------------)
#
# Directory to which binary will be written. Note that Supermodel is never
# packaged with this directory.
#
$(BIN_DIR): $(BIN_DIR):
$(info Creating directory : $(BIN_DIR)) $(info Creating directory : $(BIN_DIR))
$(SILENT)mkdir $(BIN_DIR) $(SILENT)mkdir $(BIN_DIR)
#
# Object directory
#
$(OBJ_DIR): | $(PLATFORM_DIRS) $(OBJ_DIR): | $(PLATFORM_DIRS)
$(info Creating directory : $(OBJ_DIR)) $(info Creating directory : $(OBJ_DIR))
$(SILENT)mkdir $(OBJ_DIR) $(SILENT)mkdir $(OBJ_DIR)