0daf938f [nostalgia/core/studio] Cleanup, make all number keys after num colors jump to last b90ab27a [nostalgia/core/studio] Fix Palette Color Name input to properly take focus c711f435 [nostalgia/core/studio] Fix PaletteEditor 0 key shortcut 84cb03d8 [nostalgia/core/studio] Cleanup 945a55f9 [studio] Fix Project to cut off correct end of OC data 2173b12c [nostalgia/core/studio] Give PaletteEditor keyboard shortcuts aa970b1f [keel,studio] Cleanup 6ad79b30 [ox] Cleanup a7cf2673 [studio] Remove null terminator from OC output 1a9f0d49 [ox] Rename CRString to StringCR a1b5b565 [olympic,nostalgia] Rename CRStringView to StringViewCR 256be6da [glutils] Rename CRStringView to StringViewCR cc10631b [ox] Rename CRStringView to StringViewCR 829dc029 [keel] Fix Linux build e8a1ff06 [ox/oc] Fix Linux build bdfb5e97 [nostalgia/core] Cleanup 396fecab [ox/oc] Add option for writeOC to return a string 5373b63c [keel,studio] Removing null terminator from JSON file output 8b655c40 [ox/std] Add HashMap::values 92d85d11 Merge commit '9f5f3e26efed6cd27f2a8ff0746f018d75986934' 118fef61 [buildcore] Remove python -m prefix from mypy command 8769305d [nostalgia] Allow disabling of BUILD_SHARED_LIBS c5999050 [nostalgia] Add support for partial tilesheet loading da23c930 [ox/std] Add oxModelFwdDecl macro for broken Apple Clang 3ae1d6c8 [ox/std] Make operator[] in Array and Vector nodiscard a7af6c66 [keel] Cleanup 0cc6757c [keel] Add manifest to pack output 3b8eaef3 [keel] Move vald and repair funcs to their own file, make conversion to validation b7990ed2 [keel] Make pack file copy logging nest for dir level 71313ed8 [ox/std] Cleanup 10531b6e [keel] Cleanup dfbc298d [keel] Add pack file copy status to logging 76760daf [ox/std] Cleanup Defer 5834b9c9 [ox/std] Cleanup logging output 2a584905 [ox/fs] More cleanup and bug fix from previous cleanup 702b166b [ox/fs] Cleanup 8dd837b3 [nostalgia/core] Add a valid function for CompactTileSheet 1d262597 [keel] Make default repair return a no repair error 712299fa [studio] Cleanup c45efa60 [ox/std] Make Result copyTo and moveTo able to convert git-subtree-dir: deps/nostalgia git-subtree-split: 0daf938f765b3a3ce8ba7fb292572a6a5a004634
194 lines
5.8 KiB
Makefile
194 lines
5.8 KiB
Makefile
#
|
|
# Copyright 2016 - 2023 gary@drinkingtea.net
|
|
#
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
#
|
|
|
|
ifeq (${OS},Windows_NT)
|
|
SHELL := powershell.exe
|
|
.SHELLFLAGS := -NoProfile -Command
|
|
BC_VAR_OS=windows
|
|
BC_CMD_HOST_PY3=python
|
|
else
|
|
BC_VAR_OS=$(shell uname | tr [:upper:] [:lower:])
|
|
ifneq ($(shell which python3 2> /dev/null),)
|
|
BC_CMD_HOST_PY3=python3
|
|
else
|
|
ifeq ($(shell python -c 'import sys; print(sys.version_info[0])'),3)
|
|
BC_CMD_HOST_PY3=python
|
|
else
|
|
echo 'Please install Python3 on host'
|
|
exit 1
|
|
endif
|
|
endif
|
|
endif
|
|
|
|
|
|
ifdef BC_VAR_USE_DOCKER_DEVENV
|
|
ifneq ($(shell which docker 2> /dev/null),)
|
|
BC_VAR_DEVENV=devenv$(shell pwd | sed 's/\//-/g')
|
|
BC_VAR_DEVENV_IMAGE=${BC_VAR_PROJECT_NAME}-devenv
|
|
ifeq ($(shell docker inspect --format="{{.State.Status}}" ${BC_VAR_DEVENV} 2>&1),running)
|
|
BC_CMD_ENVRUN=docker exec -i -t --user $(shell id -u ${USER}) ${BC_VAR_DEVENV}
|
|
endif
|
|
endif
|
|
ifneq ($(shell ${BC_CMD_ENVRUN} which python3 2> /dev/null),)
|
|
BC_CMD_PY3=${BC_CMD_ENVRUN} python3
|
|
else
|
|
ifeq ($(shell ${BC_CMD_ENVRUN} python -c 'import sys; print(sys.version_info[0])'),3)
|
|
BC_CMD_PY3=${BC_CMD_ENVRUN} python
|
|
else
|
|
echo 'Please install Python3 in devenv'
|
|
exit 1
|
|
endif
|
|
endif
|
|
ifndef BC_VAR_DEVENV_ROOT
|
|
BC_VAR_DEVENV_ROOT="."
|
|
endif
|
|
else
|
|
BC_CMD_PY3=${BC_CMD_HOST_PY3}
|
|
endif
|
|
|
|
BC_VAR_SCRIPTS=${BUILDCORE_PATH}/scripts
|
|
BC_CMD_SETUP_BUILD=${BC_CMD_PY3} ${BC_VAR_SCRIPTS}/setup-build.py
|
|
BC_CMD_PYBB=${BC_CMD_PY3} ${BC_VAR_SCRIPTS}/pybb.py
|
|
BC_CMD_HOST_PYBB=${BC_CMD_HOST_PY3} ${BC_VAR_SCRIPTS}/pybb.py
|
|
BC_CMD_CMAKE_BUILD=${BC_CMD_PYBB} cmake-build
|
|
BC_CMD_GETENV=${BC_CMD_PYBB} getenv
|
|
BC_CMD_CTEST=${BC_CMD_PYBB} ctest-all
|
|
BC_CMD_RM_RF=${BC_CMD_PYBB} rm
|
|
BC_CMD_MKDIR_P=${BC_CMD_PYBB} mkdir
|
|
BC_CMD_CAT=${BC_CMD_PYBB} cat
|
|
BC_CMD_DEBUGGER=${BC_CMD_PYBB} debug
|
|
BC_CMD_HOST_DEBUGGER=${BC_CMD_HOST_PYBB} debug
|
|
BC_VAR_HOSTENV=$(shell ${BC_CMD_ENVRUN} ${BC_CMD_PYBB} hostenv)
|
|
BC_VAR_BUILD_PATH=build
|
|
BC_VAR_CURRENT_BUILD=$(BC_VAR_HOSTENV)-$(shell ${BC_CMD_ENVRUN} ${BC_CMD_CAT} .current_build)
|
|
|
|
ifdef BC_VAR_USE_VCPKG
|
|
ifndef BC_VAR_VCPKG_DIR_BASE
|
|
BC_VAR_VCPKG_DIR_BASE=.vcpkg
|
|
endif
|
|
ifndef BC_VAR_VCPKG_VERSION
|
|
BC_VAR_VCPKG_VERSION=2023.08.09
|
|
endif
|
|
endif
|
|
|
|
.PHONY: build
|
|
build:
|
|
${BC_CMD_CMAKE_BUILD} ${BC_VAR_BUILD_PATH}
|
|
.PHONY: install
|
|
install:
|
|
${BC_CMD_CMAKE_BUILD} ${BC_VAR_BUILD_PATH} install
|
|
.PHONY: clean
|
|
clean:
|
|
${BC_CMD_CMAKE_BUILD} ${BC_VAR_BUILD_PATH} clean
|
|
.PHONY: purge
|
|
purge:
|
|
${BC_CMD_RM_RF} .current_build
|
|
${BC_CMD_RM_RF} ${BC_VAR_BUILD_PATH}
|
|
${BC_CMD_RM_RF} dist
|
|
${BC_CMD_RM_RF} compile_commands.json
|
|
.PHONY: test
|
|
test: build
|
|
${BC_CMD_ENVRUN} mypy ${BC_VAR_SCRIPTS}
|
|
${BC_CMD_CMAKE_BUILD} ${BC_VAR_BUILD_PATH} test
|
|
.PHONY: test-verbose
|
|
test-verbose: build
|
|
${BC_CMD_CTEST} ${BC_VAR_BUILD_PATH} --output-on-failure
|
|
.PHONY: test-rerun-verbose
|
|
test-rerun-verbose: build
|
|
${BC_CMD_CTEST} ${BC_VAR_BUILD_PATH} --rerun-failed --output-on-failure
|
|
|
|
ifdef BC_VAR_USE_DOCKER_DEVENV
|
|
.PHONY: devenv-image
|
|
devenv-image:
|
|
docker build ${BC_VAR_DEVENV_ROOT} -t ${BC_VAR_DEVENV_IMAGE}
|
|
.PHONY: devenv-create
|
|
devenv-create:
|
|
docker run -d \
|
|
-e LOCAL_USER_ID=$(shell id -u ${USER}) \
|
|
-e DISPLAY=$(DISPLAY) \
|
|
-e QT_AUTO_SCREEN_SCALE_FACTOR=1 \
|
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
|
-v /run/dbus/:/run/dbus/ \
|
|
-v $(shell pwd):/usr/src/project \
|
|
-v /dev/shm:/dev/shm \
|
|
--restart=always \
|
|
--name ${BC_VAR_DEVENV} \
|
|
-t ${BC_VAR_DEVENV_IMAGE} bash
|
|
.PHONY: devenv-destroy
|
|
devenv-destroy:
|
|
docker rm -f ${BC_VAR_DEVENV}
|
|
ifdef BC_CMD_ENVRUN
|
|
.PHONY: devenv-shell
|
|
devenv-shell:
|
|
${BC_CMD_ENVRUN} bash
|
|
endif
|
|
endif
|
|
|
|
ifdef BC_VAR_USE_VCPKG
|
|
|
|
BC_VAR_VCPKG_TOOLCHAIN=--toolchain=${BC_VAR_VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake
|
|
BC_VAR_VCPKG_DIR=$(BC_VAR_VCPKG_DIR_BASE)/$(BC_VAR_VCPKG_VERSION)-$(BC_VAR_HOSTENV)
|
|
|
|
.PHONY: vcpkg
|
|
vcpkg: ${BC_VAR_VCPKG_DIR} vcpkg-install
|
|
|
|
${BC_VAR_VCPKG_DIR}:
|
|
${BC_CMD_RM_RF} ${BC_VAR_VCPKG_DIR}
|
|
${BC_CMD_PYBB} mkdir ${BC_VAR_VCPKG_DIR_BASE}
|
|
${BC_CMD_ENVRUN} git clone -b release --depth 1 --branch ${BC_VAR_VCPKG_VERSION} https://github.com/microsoft/vcpkg.git ${BC_VAR_VCPKG_DIR}
|
|
ifneq (${BC_VAR_OS},windows)
|
|
${BC_CMD_ENVRUN} ${BC_VAR_VCPKG_DIR}/bootstrap-vcpkg.sh
|
|
else
|
|
${BC_CMD_ENVRUN} ${BC_VAR_VCPKG_DIR}/bootstrap-vcpkg.bat
|
|
endif
|
|
|
|
.PHONY: vcpkg-install
|
|
vcpkg-install:
|
|
ifneq (${BC_VAR_OS},windows)
|
|
${BC_CMD_ENVRUN} ${BC_VAR_VCPKG_DIR}/vcpkg install ${BC_VAR_VCPKG_PKGS}
|
|
else
|
|
${BC_CMD_ENVRUN} ${BC_VAR_VCPKG_DIR}/vcpkg install --triplet x64-windows ${BC_VAR_VCPKG_PKGS}
|
|
endif
|
|
|
|
else ifdef USE_CONAN # USE_VCPKG / USE_CONAN ####################################
|
|
.PHONY: setup-conan
|
|
conan-config:
|
|
${BC_CMD_ENVRUN} conan profile new ${BC_VAR_PROJECT_NAME} --detect --force
|
|
ifeq ($(BC_VAR_OS),linux)
|
|
${BC_CMD_ENVRUN} conan profile update settings.compiler.libcxx=libstdc++11 ${BC_VAR_PROJECT_NAME}
|
|
else
|
|
${BC_CMD_ENVRUN} conan profile update settings.compiler.cppstd=20 ${BC_VAR_PROJECT_NAME}
|
|
ifeq ($(BC_VAR_OS),windows)
|
|
${BC_CMD_ENVRUN} conan profile update settings.compiler.runtime=static ${BC_VAR_PROJECT_NAME}
|
|
endif
|
|
endif
|
|
|
|
.PHONY: conan
|
|
conan:
|
|
${BC_CMD_PYBB} conan-install ${BC_VAR_PROJECT_NAME}
|
|
endif # USE_CONAN ###############################################
|
|
|
|
ifeq (${BC_VAR_OS},darwin)
|
|
.PHONY: configure-xcode
|
|
configure-xcode:
|
|
${BC_CMD_SETUP_BUILD} ${BC_VAR_VCPKG_TOOLCHAIN} --build_tool=xcode --current_build=0 --build_root=${BC_VAR_BUILD_PATH}
|
|
endif
|
|
|
|
.PHONY: configure-release
|
|
configure-release:
|
|
${BC_CMD_SETUP_BUILD} ${BC_VAR_VCPKG_TOOLCHAIN} --build_type=release --build_root=${BC_VAR_BUILD_PATH}
|
|
|
|
.PHONY: configure-debug
|
|
configure-debug:
|
|
${BC_CMD_SETUP_BUILD} ${BC_VAR_VCPKG_TOOLCHAIN} --build_type=debug --build_root=${BC_VAR_BUILD_PATH}
|
|
|
|
.PHONY: configure-asan
|
|
configure-asan:
|
|
${BC_CMD_SETUP_BUILD} ${BC_VAR_VCPKG_TOOLCHAIN} --build_type=asan --build_root=${BC_VAR_BUILD_PATH}
|
|
|