CORE/Makefile
JeremyStarTM 99703cf03e CORE rewrite (#1)
Reviewed-on: StarOpenSource/core#1

Rewrote CORE and improved the startup process and startup time significantly. The documentation has been beefed up too and is now much better. Existing projects may need major refactoring however.
Co-authored-by: JeremyStarTM <jeremystartm@staropensource.de>
Co-committed-by: JeremyStarTM <jeremystartm@staropensource.de>
2023-08-25 14:34:57 +02:00

64 lines
2.9 KiB
Makefile

#!/bin/make
CORE=$(shell pwd)
ASSETS=$(CORE)/assets
DOCSCONF=$(CORE)/mkdocs.yml
DOCSOUT=$(CORE)/docs_out
TESTPROJECT=$(CORE)/devprj
dist: help
help:
@echo "Available tasks: docs-deps (installs the docs dependencies via pip)"
@echo " docs-deps-paru (install the docs dependencies via paru)"
@echo " docs-serve (starts development server)"
@echo " docs-build (export prod ready documentation as html)"
@echo " docs-clean (removes the built documentation)"
@echo " mkdevprj (creates a dev project for development)"
@echo " rmdevprj (removes the dev project)"
docs-deps:
@echo ":: Installing documentation dependencies"
@echo " This may take a few minutes"
@pip install -r requirements.txt
docs-deps-paru:
@echo ":: Installing documentation dependencies"
@echo " This may take a few minutes"
@paru -Sy --needed python-pyyaml-env-tag python-mergedeep python-six python-smmap python-gitdb python-urllib3 python-idna python-dateutil python-pytz python-babel python-requests python-regex python-pygments python-colorama python-watchdog python-packaging python-ghp-import python-click python-jinja python-yaml python-gitpython python-markupsafe pymdown-extensions mkdocs-material-pymdownx-extras mkdocs-git-revision-date-localized-plugin mkdocs-material mkdocs
docs-serve:
@echo ":: Serving documentation, press CTRL+C to exit"
@bash -c "mkdocs serve --dirtyreload --config-file "$(DOCSCONF)";exit 0"
docs-build:
@make docs-clean
@echo ":: Building documentation"
@mkdocs build --site-dir "$(DOCSOUT)" --config-file "$(DOCSCONF)"
docs-clean:
@echo ":: Removing built documentation"
@rm -rf "$(DOCSOUT)"
mkdevprj:
@echo ":: Creating development project"
@cp -r $(ASSETS)/testproject $(TESTPROJECT)
@ln -s $(CORE) $(TESTPROJECT)/CORE
@mv $(TESTPROJECT)/config.gd $(TESTPROJECT)/CORE/config.gd
@echo ":: Development project created."
@echo " You can now launch Godot and open '$(TESTPROJECT)'."
@echo " If you want to submit your changes, remember to execute 'make rmdevprj' first!"
rmdevprj:
@echo ":: Removing development project"
@echo ":: !!!!!!!!!!!!!!!!!!!!!!!!!!!!"
@echo ":: ! IMPORTANT WARNING !"
@echo ":: !!!!!!!!!!!!!!!!!!!!!!!!!!!!"
@echo ":: ! Please remove the CORE !"
@echo ":: ! development project from !"
@echo ":: ! your project list or you !"
@echo ":: ! will experience bugs if !"
@echo ":: ! you edit the dev project !"
@echo ":: ! again in the future! !"
@echo ":: !!!!!!!!!!!!!!!!!!!!!!!!!!!!"
@echo ":: If you have done that, press [ENTER]."
@read -rs
@echo ":: Removing directory"
@rm -rf $(TESTPROJECT)
@rm -rf config.gd
@echo ":: Removing 'uid://' strings"
@#bash -c "for file in *.tscn; do cat \"\$$file\"|sed -E 's/\ uid=\"[^\"]*\"//g'|tee \$$file;done &> /dev/null"
@echo ":: Please open all .tscn files and remove all 'uid=uid://' strings"
@echo ":: If you have done that, press [ENTER]."
@read -rs