Add a function to the `sb:☁️:HTTP` class that sends session data collected by a `sb::progress::Progress` object to a configured URL. Add a PHP script for receiving the session data, intended to be installed separately on a remote server. Add a randomly generated ID when writing new save files. Do not overwrite existing IDs, so the ID will persist for the life of the file. Store the ID in the play session data. Add a string identifying the program's build, either "windows", "linux", "macos", "wasm", or "android". Add function for accessing requests in the HTTP queue. Add the `sb::math` namespace for functions in math.hpp. Add open source SHA256 hash library to the project. Use the library to hash the player's Steam username before saving it to the session data. Add documentation for `sb:☁️:http::post_session` to README. Add a function for getting a string representing the current date up to the minute to `sb::time`. This function is used to store the start time of the play session. Add test of session transfer to HTTP test case.
684 lines
30 KiB
Makefile
684 lines
30 KiB
Makefile
# /\ +=======================================================+
|
|
# ____/ \____ /: Open source game framework licensed to freely use, :
|
|
# \ / / : copy, and modify - created for dank.game :
|
|
# +==\ ^__^ /==+ : :
|
|
# : ~/ \~ : : Download at https://open.shampoo.ooo/shampoo/spacebox :
|
|
# : ~~~~~~~~~~~~ : +=======================================================+
|
|
# : SPACE ~~~~~ : /
|
|
# : ~~~~~~~ BOX :/
|
|
# +==============+
|
|
#
|
|
# These targets are for building the SPACE🪐BOX test program on each platform.
|
|
#
|
|
# The resulting program should be run from the current directory.
|
|
#
|
|
# $ build/x64/SPACEBOX_test-linux.x64
|
|
# <Catch2 output...>
|
|
|
|
# Default flags
|
|
CFLAGS += -Wall -Wextra
|
|
CXXFLAGS += $(CFLAGS) --std=c++17
|
|
|
|
# Program name will appear in all final build target names
|
|
NAME = SPACEBOX_test
|
|
|
|
# Print a success message
|
|
define success_message
|
|
@echo "\n✨ $@ succeeded"
|
|
endef
|
|
|
|
#########
|
|
# Paths #
|
|
#########
|
|
|
|
# Location of testing-specific source files
|
|
SRC_DIR := .
|
|
|
|
# Locations of [SPACEBOX] source and its packaged dependencies
|
|
SB_DIR := ../..
|
|
SB_SRC_DIR := $(SB_DIR)/src
|
|
SB_LIB_DIR := $(SB_DIR)/lib
|
|
SDLGFX2_DIR := $(SB_LIB_DIR)/sdl2-gfx
|
|
GLEW_DIR := $(SB_LIB_DIR)/glew
|
|
CATCH2_DIR := $(SB_LIB_DIR)/catch2
|
|
SHA256_DIR := $(SB_LIB_DIR)/sha
|
|
|
|
# C and C++ compiler commands
|
|
CC = clang
|
|
CXX = clang++
|
|
|
|
# Location of SDL config program. See README.md for how to compile the SDL library and this utility. Define SDL_BIN_DIR
|
|
# when invoking make to use an alternate SDL installation location.
|
|
SDLCONFIG := $(SDL_BIN_DIR)sdl2-config
|
|
|
|
# Override these to use Steamworks SDK from a custom location
|
|
STEAM_INC := "lib/steam/include/"
|
|
STEAM_LIB := "lib/steam/lib/"
|
|
|
|
#############################
|
|
# Based on above parameters #
|
|
#############################
|
|
|
|
# Use SDL's utility program to get compilation and linker flags
|
|
SDL_CFLAGS := $(shell $(SDLCONFIG) --cflags)
|
|
SDL_LFLAGS := $(shell $(SDLCONFIG) --libs)
|
|
|
|
# Get all SPACEBOX header files, and get a list of object targets by replacing the .cpp suffix with .o
|
|
SB_H_FILES := $(wildcard $(addprefix $(SB_SRC_DIR)/,*.hpp))
|
|
SB_O_FILES := $(notdir $(patsubst %.cpp, %.o, $(wildcard $(addprefix $(SB_SRC_DIR)/,*.cpp))))
|
|
|
|
# Get all main test program header and object file targets, leaving out the wasm_http_test/main.cpp which is compiled
|
|
# separately
|
|
SRC_H_FILES := $(wildcard $(addprefix $(SRC_DIR)/,*.hpp))
|
|
SRC_O_FILES := $(notdir $(patsubst %.cpp, %.o, $(wildcard $(addprefix $(SRC_DIR)/,*.cpp))))
|
|
|
|
##########################################################
|
|
# Build directories where object targets will be written #
|
|
##########################################################
|
|
|
|
BUILD_ROOT := build
|
|
X64_BUILD_DIR := $(BUILD_ROOT)/x64
|
|
X64_DEBUG_BUILD_DIR := $(BUILD_ROOT)/x64_debug
|
|
WASM_BUILD_DIR := $(BUILD_ROOT)/wasm
|
|
WASM_HTTP_BUILD_DIR := $(BUILD_ROOT)/wasm_http
|
|
WIN32_BUILD_DIR := $(BUILD_ROOT)/win32
|
|
WIN64_BUILD_DIR := $(BUILD_ROOT)/win64
|
|
UBUNTU18_BUILD_DIR := $(BUILD_ROOT)/ubuntu18
|
|
MACOS_BUILD_DIR := $(BUILD_ROOT)/macos
|
|
BUILD_DIRS := $(X64_BUILD_DIR) $(X64_DEBUG_BUILD_DIR) $(WASM_BUILD_DIR) $(WASM_HTTP_BUILD_DIR) $(WIN32_BUILD_DIR) \
|
|
$(WIN64_BUILD_DIR) $(UBUNTU_BUILD_DIR) $(MACOS_BUILD_DIR)
|
|
|
|
$(BUILD_DIRS):
|
|
mkdir -p $@
|
|
|
|
###################
|
|
# Auto-versioning #
|
|
###################
|
|
|
|
# Generate a header file which contains the version string as determined by Git. The file should be listed as a
|
|
# pre-requisite for any target which needs to access the version string. If the version string is identical to what is
|
|
# already written in the file, the file will not be overwritten. Therefore, the file modification date will not be
|
|
# updated, and the target will not need to be rebuilt.
|
|
#
|
|
# See https://stackoverflow.com/q/3236145 and https://stackoverflow.com/q/1704907
|
|
#
|
|
# The GIT_DIR should be set to the location of the .git/ folder. In most cases, the .git/ folder is in the root of the
|
|
# project, but the SPACE🪐BOX test program is in a subfolder of the overall framework project.
|
|
#
|
|
# The version can also be passed directly with the make command. This can be useful in the case of the Docker build
|
|
# when the project is being compiled from within a Git submodule. The .git directory of a Git submodule refers to
|
|
# another folder within the main project which can be complex to link the Docker contain to, so the version can be
|
|
# obtained and passed to the Docker target before launching the container.
|
|
|
|
GIT_DIR = ../../.git
|
|
VERSION = "$(shell git --git-dir=$(GIT_DIR) describe --abbrev=4 --dirty --always --tags)"
|
|
VERSION_CONTENTS = "// This file is auto-generated and will be overwritten when the project is built\
|
|
\n\#pragma once\n\#include <string>\n\nnamespace $(PROJECT) {\nconst std::string version = \"$(VERSION)\";\n}"
|
|
|
|
.PHONY : force
|
|
$(SB_SRC_DIR)/version.hpp : PROJECT = sb
|
|
$(SB_SRC_DIR)/version.hpp : force
|
|
echo $(VERSION_CONTENTS) | cmp -s - $@ || echo $(VERSION_CONTENTS) > $@
|
|
|
|
##################################################################
|
|
# Object files for [SPACEBOX], its dependencies, and the project #
|
|
##################################################################
|
|
|
|
## SDL2-gfx ##
|
|
|
|
$(addsuffix /SDL2_framerate.o, $(BUILD_DIRS)): $(SDLGFX2_DIR)/SDL2_framerate.c $(wildcard $(SDLGFX2_DIR)/*.h) \
|
|
| $(BUILD_DIRS)
|
|
$(CC) $< $(CFLAGS) -c -o $@
|
|
|
|
$(addsuffix /SDL2_gfxPrimitives.o, $(BUILD_DIRS)): $(SDLGFX2_DIR)/SDL2_gfxPrimitives.c $(wildcard $(SDLGFX2_DIR)/*.h) \
|
|
| $(BUILD_DIRS)
|
|
$(CC) $< $(CFLAGS) -c -o $@
|
|
|
|
$(addsuffix /SDL2_imageFilter.o, $(BUILD_DIRS)): $(SDLGFX2_DIR)/SDL2_imageFilter.c $(wildcard $(SDLGFX2_DIR)/*.h) \
|
|
| $(BUILD_DIRS)
|
|
$(CC) $< $(CFLAGS) -c -o $@
|
|
|
|
$(addsuffix /SDL2_rotozoom.o, $(BUILD_DIRS)): $(SDLGFX2_DIR)/SDL2_rotozoom.c $(wildcard $(SDLGFX2_DIR)/*.h) \
|
|
| $(BUILD_DIRS)
|
|
$(CC) $< $(CFLAGS) -c -o $@
|
|
|
|
## GLEW ##
|
|
|
|
$(addsuffix /glew.o, $(BUILD_DIRS)): $(GLEW_DIR)/glew.c $(wildcard $(GLEW_DIR)/*.h) | $(BUILD_DIRS)
|
|
$(CC) $< $(CFLAGS) -c -o $@
|
|
|
|
## Catch2 ##
|
|
|
|
$(addsuffix /catch_amalgamated.o, $(BUILD_DIRS)): \
|
|
$(addprefix $(CATCH2_DIR)/, catch_amalgamated.cpp catch_amalgamated.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $< $(CXXFLAGS) -c -o $@
|
|
|
|
## SHA256 ##
|
|
|
|
$(addsuffix /SHA256.o, $(BUILD_DIRS)): $(addprefix $(SHA256_DIR)/, SHA256.cpp SHA256.h) | $(BUILD_DIRS)
|
|
$(CXX) $< $(CXXFLAGS) -c -o $@
|
|
|
|
## SPACE🪐BOX ##
|
|
|
|
$(addsuffix /extension.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, extension.cpp extension.hpp Box.hpp Segment.hpp \
|
|
Color.hpp filesystem.hpp Pixels.hpp Log.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Node.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Node.cpp Node.hpp Game.hpp Configuration.hpp \
|
|
Delegate.hpp Display.hpp Input.hpp Box.hpp Audio.hpp Log.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Game.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Game.cpp Game.hpp extension.hpp Node.hpp Recorder.hpp \
|
|
Input.hpp Configuration.hpp Delegate.hpp Audio.hpp Log.hpp version.hpp progress.hpp) \
|
|
| $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Animation.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Animation.cpp Animation.hpp Node.hpp Timer.hpp) \
|
|
| $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Recorder.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Recorder.cpp Recorder.hpp Node.hpp Game.hpp \
|
|
Configuration.hpp Delegate.hpp Animation.hpp extension.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Input.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Input.cpp Input.hpp Node.hpp Animation.hpp \
|
|
Configuration.hpp Delegate.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Configuration.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Configuration.cpp Configuration.hpp \
|
|
Animation.hpp Log.hpp extension.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Delegate.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Delegate.cpp Delegate.hpp Node.hpp Game.hpp \
|
|
Input.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Display.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Display.cpp Display.hpp Node.hpp Game.hpp Box.hpp \
|
|
Configuration.hpp Delegate.hpp Log.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Box.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Box.cpp Box.hpp extension.hpp Segment.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Segment.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Segment.cpp Segment.hpp extension.hpp Box.hpp) \
|
|
| $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Pixels.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Pixels.cpp Pixels.hpp Box.hpp extension.hpp Log.hpp \
|
|
math.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Audio.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Audio.cpp Audio.hpp Node.hpp filesystem.hpp) \
|
|
| $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /GLObject.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, GLObject.cpp GLObject.hpp Log.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Texture.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Texture.cpp Texture.hpp GLObject.hpp filesystem.hpp \
|
|
Log.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /VBO.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, VBO.cpp VBO.hpp Log.hpp GLObject.hpp Attributes.hpp \
|
|
extension.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Attributes.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Attributes.cpp Attributes.hpp Log.hpp \
|
|
extension.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Model.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Model.cpp Model.hpp extension.hpp Attributes.hpp \
|
|
Texture.hpp Carousel.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Text.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Text.cpp Text.hpp Model.hpp Color.hpp Log.hpp \
|
|
Texture.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Color.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Color.cpp Color.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Log.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Log.cpp Log.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /math.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, math.cpp math.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /Timer.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, Timer.cpp Timer.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /cloud.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, cloud.cpp cloud.hpp Log.hpp progress.hpp \
|
|
version.hpp sb.hpp) $(SHA256_DIR)/SHA256.h | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /progress.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, progress.cpp progress.hpp sb.hpp filesystem.hpp \
|
|
Sprite.hpp Configuration.hpp extension.hpp cloud.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
$(addsuffix /sb.o, $(BUILD_DIRS)): $(addprefix $(SB_SRC_DIR)/, sb.cpp sb.hpp filesystem.hpp extension.hpp cloud.hpp) \
|
|
| $(BUILD_DIRS)
|
|
$(CXX) $(CXXFLAGS) $< -c -o $@
|
|
|
|
## Test suite ##
|
|
|
|
$(addsuffix /test.o, $(BUILD_DIRS)): $(addprefix $(SRC_DIR)/, test.cpp setup.hpp) $(addprefix $(SB_SRC_DIR)/, sb.hpp \
|
|
Game.hpp Log.hpp progress.hpp extension.hpp version.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $< $(CXXFLAGS) -c -o $@
|
|
|
|
$(addsuffix /wasm_http_test.o, $(BUILD_DIRS)): $(SRC_DIR)/wasm_http_test/wasm_http_test.cpp \
|
|
$(addprefix $(SB_SRC_DIR)/, sb.hpp Game.hpp) | $(BUILD_DIRS)
|
|
$(CXX) $< $(CXXFLAGS) -c -o $@
|
|
|
|
#############################
|
|
# Compiler and linker flags #
|
|
#############################
|
|
|
|
LINUX_CFLAGS = -c -I$(SB_LIB_DIR) -I$(SB_SRC_DIR) $(SDL_CFLAGS) -DGLEW_STATIC -DGLEW_NO_GLU \
|
|
-DCATCH_AMALGAMATED_CUSTOM_MAIN
|
|
LINUX_LFLAGS = $(SDL_LFLAGS) -lpthread -lGL -lGLESv2 -lSDL2_image -lSDL2_ttf -lSDL2_mixer -lstdc++fs -static-libstdc++ \
|
|
-static-libgcc
|
|
|
|
EMSCRIPTEN_CFLAGS = -Oz -sUSE_SDL=2 -sUSE_SDL_IMAGE=2 -sSDL2_IMAGE_FORMATS="['png', 'jpg']" -sUSE_SDL_TTF=2 \
|
|
-sUSE_SDL_MIXER=2 -I $(SB_LIB_DIR) -I $(SB_SRC_DIR) -fexceptions
|
|
EMSCRIPTEN_LFLAGS = -sMIN_WEBGL_VERSION=2 -sEXPORTED_FUNCTIONS="['_main']" -sLLD_REPORT_UNDEFINED \
|
|
-fexceptions -sFULL_ES3=1 -lidbfs.js -sALLOW_MEMORY_GROWTH=1 -sUSE_SDL=2 -sUSE_SDL_IMAGE=2 \
|
|
-sSDL2_IMAGE_FORMATS="['png', 'jpg']" -sUSE_SDL_TTF=2 -sUSE_SDL_MIXER=2 --pre-js "pre_js.js" \
|
|
|
|
MACOS_CFLAGS = -Oz -c -I$(SB_LIB_DIR) -I$(SB_SRC_DIR) -DGLEW_STATIC -DGLEW_NO_GLU -F$(MACOS_CROSS_FW) \
|
|
-I$(MACOS_CROSS_FW)/SDL2.framework/Headers -I$(MACOS_CROSS_FW)/SDL2_image.framework/Headers \
|
|
-I$(MACOS_CROSS_FW)/SDL2_ttf.framework/Headers -I$(MACOS_CROSS_FW)/SDL2_mixer.framework/Headers \
|
|
-DCATCH_AMALGAMATED_CUSTOM_MAIN
|
|
MACOS_LFLAGS = -Wl,-rpath,@executable_path/../Frameworks -pthread -F$(MACOS_CROSS_FW) -framework SDL2 \
|
|
-framework SDL2_image -framework SDL2_ttf -framework SDL2_mixer -framework OpenGL
|
|
|
|
WIN_CFLAGS = -Oz -c -I$(SB_LIB_DIR) -I$(SB_SRC_DIR) -DGLEW_STATIC -DGLEW_NO_GLU \
|
|
-I$(SDL_MINGW)/include/SDL2 -I$(SDL_IMG_MINGW)/include/SDL2 -I$(SDL_TTF_MINGW)/include/SDL2 \
|
|
-I$(SDL_MIXER_MINGW)/include/SDL2 -DCATCH_AMALGAMATED_CUSTOM_MAIN -DSDL_MAIN_HANDLED
|
|
WIN_LFLAGS = -lpthread -lstdc++fs -L$(SDL_MINGW)/lib -L$(SDL_IMG_MINGW)/lib -L$(SDL_TTF_MINGW)/lib \
|
|
-L$(SDL_MIXER_MINGW)/lib -lmingw32 -lSDL2_image -lSDL2_ttf -lSDL2_mixer -lSDL2main -lSDL2 -lopengl32 \
|
|
-static-libstdc++ -static-libgcc -mwindows
|
|
|
|
########
|
|
# cURL #
|
|
########
|
|
|
|
# Including cURL headers and linking to cURL
|
|
# ==========================================
|
|
#
|
|
# For Linux and macOS builds, cURL needs to be installed before building, with the headers and library files in
|
|
# standard locations.
|
|
#
|
|
# For Linux builds, installation can be done on the host system with the package manager. For example,
|
|
#
|
|
# sudo apt install libcurl4-openssl-dev
|
|
#
|
|
# For macOS builds with osxcross, libcurl is expected to be installed with the macOS SDK.
|
|
#
|
|
# For Windows builds with MinGW, if using the official binaries from https://curl.se/windows/, CURL_WIN_MINGW should be
|
|
# set to the root of the extracted archive.
|
|
#
|
|
# Including cURL in the distributable
|
|
# ===================================
|
|
#
|
|
# For Linux, the shared object files for libcurl, libssl, and libcrypto will be automatically copied from the host
|
|
# system into the lib/ folder of the distributable.
|
|
#
|
|
# For macOS, libcurl, libssl, and libcrypto are assumed to be installed on the remote system already because that is
|
|
# standard for macOS.
|
|
#
|
|
# For Windows, the CURL_WINXX_DLL parameters below should be set to the location of a libcurl DLL. The DLL is copied
|
|
# into the root folder of the distributable. cURL is also included with recent versions of Windows, so that step can be
|
|
# skipped if support for older systems isn't necessary.
|
|
|
|
ifeq ($(CURL),yes)
|
|
CURL_WIN_MINGW = $(HOME)/ext/software/curl-8.12.1_4-$(CURL_WIN_MINGW_ARCH)-mingw
|
|
|
|
CURL_WIN32_DLL = $(CURL_WIN_MINGW)/bin/libcurl.dll
|
|
CURL_WIN64_DLL = $(CURL_WIN_MINGW)/bin/libcurl-x64.dll
|
|
|
|
CURL_WIN_INC = $(CURL_WIN_MINGW)/include
|
|
CURL_WIN_LIB = $(CURL_WIN_MINGW)/lib
|
|
|
|
LINUX_CFLAGS += -D__CURL__
|
|
LINUX_LFLAGS += -lcurl
|
|
|
|
WIN_CFLAGS += -D__CURL__ -I$(CURL_WIN_INC)
|
|
WIN_LFLAGS += -L$(CURL_WIN_LIB) -lcurl
|
|
|
|
MACOS_CFLAGS += -D__CURL__
|
|
MACOS_LFLAGS += -lcurl
|
|
endif
|
|
|
|
#######################
|
|
# Steam API Extension #
|
|
#######################
|
|
|
|
# Include Steamworks macro and headers if Steam is enabled. There are additional clauses defined per build target in
|
|
# later sections, such as extra files to include in the distributable.
|
|
|
|
ifeq ($(STEAM),yes)
|
|
LINUX_CFLAGS += -D__STEAM__ -I$(STEAM_INC)
|
|
LINUX_LFLAGS += -L$(STEAM_LIB)/linux64/ -Wl,-rpath,$(STEAM_LIB)/linux64/ -lsteam_api
|
|
|
|
WIN_CFLAGS += -D__STEAM__ -I$(STEAM_INC)
|
|
# WIN_LFLAGS are set separately for 32-bit and 64-bit in the Windows build section below
|
|
|
|
MACOS_CFLAGS += -D__STEAM__ -I$(STEAM_INC)
|
|
MACOS_LFLAGS += -L$(STEAM_LIB)/osx/ -lsteam_api
|
|
endif
|
|
|
|
###############
|
|
# Linux build #
|
|
###############
|
|
|
|
LINUX_OBJ = glew.o SDL2_rotozoom.o SDL2_gfxPrimitives.o catch_amalgamated.o SHA256.o $(SB_O_FILES) $(SRC_O_FILES)
|
|
LINUX_RESOURCES = config.json config/ malformed.json Simulacra_and_Simulation.json BPmono.ttf steam_appid.txt
|
|
LINUX_DISTRIBUTABLE_LIB_DIR = lib/
|
|
|
|
# EXTRA_PLATFORM_FLAGS refers to extra preprocessor definitions, for example -D__UBUNTU18__, to trigger code blocks
|
|
# specific to that platform or architecture. These extra flags can be passed in when building using the Linux target on
|
|
# a specialized platform that needs different behavior in the code (for example, Ubuntu 18, which only supports the
|
|
# experimental C++ STL filesystem library).
|
|
#
|
|
# The Linux build takes an -rpath so that the distributable can be packaged with a "lib/" folder containing necessary
|
|
# libraries for running the project on another system (see Linux Distributable in the SPACE🪐BOX README).
|
|
|
|
$(NAME)-linux.x64 : CFLAGS += $(LINUX_CFLAGS) -Oz $(EXTRA_PLATFORM_FLAGS)
|
|
$(NAME)-linux_debug.x64 : CFLAGS += $(LINUX_CFLAGS) -g -O0 $(EXTRA_PLATFORM_FLAGS)
|
|
$(NAME)-linux.x64 : BUILD_DIR = $(X64_BUILD_DIR)
|
|
$(NAME)-linux_debug.x64 : BUILD_DIR = $(X64_DEBUG_BUILD_DIR)
|
|
$(NAME)-linux.x64 : $(addprefix $(X64_BUILD_DIR)/, $(LINUX_OBJ))
|
|
$(NAME)-linux_debug.x64 : $(addprefix $(X64_DEBUG_BUILD_DIR)/, $(LINUX_OBJ))
|
|
$(NAME)-linux.x64 $(NAME)-linux_debug.x64 : LFLAGS += $(LINUX_LFLAGS) -Wl,-rpath $(LINUX_DISTRIBUTABLE_LIB_DIR)
|
|
$(NAME)-linux.x64 $(NAME)-linux_debug.x64 :
|
|
$(CXX) $^ $(LFLAGS) -o $(BUILD_DIR)/$@
|
|
|
|
# Pack into a ZIP
|
|
|
|
mkdir -p ${basename $@}/$(LINUX_DISTRIBUTABLE_LIB_DIR)
|
|
cp $$(ldd $(BUILD_DIR)/$@ | grep libSDL2-2.0 | cut -d" " -f3) \
|
|
$$(ldd $(BUILD_DIR)/$@ | grep libSDL2_image | cut -d" " -f3) \
|
|
$$(ldd $(BUILD_DIR)/$@ | grep libSDL2_ttf | cut -d" " -f3) \
|
|
$$(ldd $(BUILD_DIR)/$@ | grep libsteam_api | cut -d" " -f3) \
|
|
$$(ldd $(BUILD_DIR)/$@ | grep libSDL2_mixer | cut -d" " -f3) \
|
|
$$(ldd $(BUILD_DIR)/$@ | grep libssl | cut -d" " -f3) \
|
|
$$(ldd $(BUILD_DIR)/$@ | grep libcrypto | cut -d" " -f3) \
|
|
${basename $@}/$(LINUX_DISTRIBUTABLE_LIB_DIR)
|
|
rsync -arRL $(LINUX_RESOURCES) ${basename $@}
|
|
cp $(BUILD_DIR)/$@ ${basename $@}
|
|
zip -r ${@:x64=zip} ${basename $@}
|
|
mv ${@:x64=zip} $(BUILD_DIR)
|
|
mv ${basename $@} /tmp
|
|
rm -r /tmp/${basename $@}
|
|
$(success_message)
|
|
|
|
# Launch a Docker container and build on Ubuntu 18.04.
|
|
#
|
|
# This Linux build target requires Docker to be installed locally, along with an Ubuntu-18 image with the SPACE🪐BOX
|
|
# prerequisites installed. It also requires that the user has `sudo` access to run docker. The image can be created
|
|
# using the Dockerfile at `ubuntu18/Dockerfile`.
|
|
#
|
|
# sudo docker build -t [DOCKER_IMAGE_TAG] ubuntu18/
|
|
#
|
|
# The project files are mapped onto the container to include all necessary files for the build. The local Ubuntu-18 build
|
|
# directory is mapped to sync automatically with the Linux/X64 build directory on the container.
|
|
#
|
|
# On the container, build the Linux/X64 version using clang-8. Set permissions so that the local user owns the output
|
|
# build files.
|
|
#
|
|
# To just build the executable and sync it to the host machine, use the "Ubuntu-18" target. To also run the executable
|
|
# at the end of the build on the container and get standard output on the host, run the "Ubuntu-18-launch" target.
|
|
#
|
|
# The version string is taken from the host and passed into the make command that runs on the container.
|
|
#
|
|
# Note that there are some useful overrides. For example, GIT_DIR can point to a submodule's .git directory, and
|
|
# DOCKER_BUILD_TARGET can be overridden to run the debug build instead of the regular one.
|
|
#
|
|
# > make -j3 GIT_DIR=../../../../.git/modules/lib/sb/ SDL_BIN_DIR=~/local/sdl/bin/ \
|
|
# DOCKER_BUILD_TARGET=SPACEBOX_test-linux_debug.x64 STEAM=yes CURL=yes Ubuntu-18
|
|
|
|
DOCKER_REMOTE_DIR=/spacebox-test
|
|
DOCKER_IMAGE_TAG=spacebox-ubuntu18
|
|
DOCKER_BUILD_TARGET=$(NAME)-linux.x64
|
|
DOCKER_NAME=spacebox-test
|
|
|
|
Ubuntu-18 : DOCKER_RUN_TEST = no
|
|
Ubuntu-18-launch : DOCKER_RUN_TEST = yes
|
|
Ubuntu-18 Ubuntu-18-launch : EXTRA_PLATFORM_FLAGS += -D__UBUNTU18__
|
|
Ubuntu-18 Ubuntu-18-launch :
|
|
mkdir -p $(BUILD_ROOT)
|
|
xhost "+local:"
|
|
sudo docker run --pid=host -e DISPLAY=$(DISPLAY) --name $(DOCKER_NAME) --rm \
|
|
-v "/tmp/.X11-unix:/tmp/.X11-unix:rw" \
|
|
-v "$(shell pwd)/../../lib:$(DOCKER_REMOTE_DIR)/lib" \
|
|
-v "$(shell pwd)/../../src:$(DOCKER_REMOTE_DIR)/src" \
|
|
-v "$(shell pwd)/../../config:$(DOCKER_REMOTE_DIR)/config" \
|
|
-v "$(shell pwd)/../../BPmono.ttf:$(DOCKER_REMOTE_DIR)/BPmono.ttf" \
|
|
-v "$(shell pwd)/$(UBUNTU18_BUILD_DIR):$(DOCKER_REMOTE_DIR)/src/test/$(X64_BUILD_DIR)" \
|
|
$(DOCKER_IMAGE_TAG) bash -c \
|
|
"useradd $(USER) && chgrp $(USER) $(DOCKER_REMOTE_DIR) -R && chown $(USER) $(DOCKER_REMOTE_DIR) -R &&\
|
|
su - $(USER) && cd $(DOCKER_REMOTE_DIR)/src/test/ &&\
|
|
make CC=clang-8 CXX=clang++-8 STEAM=$(STEAM) CURL=$(CURL) VERSION=$(VERSION)\
|
|
EXTRA_PLATFORM_FLAGS='$(EXTRA_PLATFORM_FLAGS)' -j7 $(DOCKER_BUILD_TARGET) &&\
|
|
if [ '$(DOCKER_RUN_TEST)' == 'yes' ]; \
|
|
then 'build/x64/$(DOCKER_BUILD_TARGET)' '~Steam*' -s --no-default-reporters; fi;"
|
|
|
|
#############
|
|
# Web build #
|
|
#############
|
|
|
|
# Use Emscripten to output WASM and JavaScript.
|
|
#
|
|
# There are two targets: one for the main test program which runs all tests, and another for the HTTP test. This is
|
|
# because the main tests require Asyncify to be enabled in Emscripten. However, the HTTP test cannot use Asyncify
|
|
# because it breaks the Fetch API (more info at https://github.com/emscripten-core/emscripten/issues/12255).
|
|
#
|
|
# In the resources list, the '@' operator is used with BPmono.ttf because Emscripten reads BPmono.ttf as being in another
|
|
# directory because it is a symbolic link and tries to put it in another directory. The '@' operator instructs Emscripten
|
|
# to put BPmono.ttf in the root of the project.
|
|
|
|
EMSCRIPTENHOME = $(HOME)/ext/software/emsdk/upstream/emscripten
|
|
EMSCRIPTEN_OBJ = SDL2_rotozoom.o SDL2_gfxPrimitives.o SHA256.o $(SB_O_FILES)
|
|
EMSCRIPTEN_RESOURCES = malformed.json Simulacra_and_Simulation.json config.json config/ BPmono.ttf@BPmono.ttf
|
|
EMSCRIPTEN_DEPENDENCIES = $(filter-out BPmono.ttf@BPmono.ttf, $(EMSCRIPTEN_RESOURCES)) pre_js.js
|
|
EMSCRIPTEN_PRELOADS = $(addprefix --preload-file , $(EMSCRIPTEN_RESOURCES))
|
|
|
|
$(NAME).html $(NAME)-http.html : CC = $(EMSCRIPTENHOME)/emcc
|
|
$(NAME).html $(NAME)-http.html : CXX = $(EMSCRIPTENHOME)/em++
|
|
|
|
# Use Asyncify only in main test program
|
|
$(NAME).html : EMSCRIPTEN_CFLAGS += -D__ASYNCIFY__ -DCATCH_AMALGAMATED_CUSTOM_MAIN
|
|
$(NAME).html $(NAME)-http.html : CFLAGS += $(EMSCRIPTEN_CFLAGS)
|
|
|
|
# Use Asyncify only in main test program, and use the Fetch API only in the HTTP test
|
|
$(NAME).html : EMSCRIPTEN_LFLAGS += -sASYNCIFY -sASYNCIFY_STACK_SIZE=65536
|
|
$(NAME)-http.html : EMSCRIPTEN_LFLAGS += -sFETCH --bind
|
|
|
|
# Use separate build directories for each test
|
|
$(NAME).html : BUILD_DIR = $(WASM_BUILD_DIR)
|
|
$(NAME)-http.html : BUILD_DIR = $(WASM_HTTP_BUILD_DIR)
|
|
|
|
# Use different objects for each test
|
|
$(NAME).html : $(addprefix $(WASM_BUILD_DIR)/, $(EMSCRIPTEN_OBJ) $(SRC_O_FILES) catch_amalgamated.o) \
|
|
$(EMSCRIPTEN_DEPENDENCIES)
|
|
$(NAME)-http.html : $(addprefix $(WASM_HTTP_BUILD_DIR)/, $(EMSCRIPTEN_OBJ) wasm_http_test.o) $(EMSCRIPTEN_DEPENDENCIES)
|
|
|
|
# Use the same basic compilation rule for both tests
|
|
$(NAME).html $(NAME)-http.html :
|
|
$(CXX) $(filter-out $(EMSCRIPTEN_DEPENDENCIES), $^) $(EMSCRIPTEN_LFLAGS) $(EMSCRIPTEN_PRELOADS) \
|
|
-o $(BUILD_DIR)/$@
|
|
$(success_message)
|
|
|
|
###############
|
|
# MacOS build #
|
|
###############
|
|
|
|
# This target builds a signed MacOS universal (x86_64 and arm64 in one) application bundle (.app).
|
|
#
|
|
# It uses the osxcross toolchain (https://github.com/tpoechtrager/osxcross). See instructions at /README.md#MacOS for
|
|
# setting up osxcross.
|
|
|
|
MACOS_CROSS_ROOT = /media/unionsine/osxcross
|
|
MACOS_CROSS_FW = $(MACOS_CROSS_ROOT)/local/Frameworks
|
|
MACOS_OBJ = $(addprefix $(MACOS_BUILD_DIR)/, glew.o SDL2_rotozoom.o SDL2_gfxPrimitives.o catch_amalgamated.o SHA256.o \
|
|
$(SB_O_FILES) $(SRC_O_FILES))
|
|
MACOS_BUNDLE = $(MACOS_BUILD_DIR)/dmg/$@
|
|
MACOS_BUNDLE_CONTENTS = $(MACOS_BUILD_DIR)/dmg/$@/Contents
|
|
MACOS_CROSS_BIN = $(MACOS_CROSS_ROOT)/target/bin
|
|
MACOS_RESOURCES = Simulacra_and_Simulation.json malformed.json icon.png config.json config/ BPmono.ttf
|
|
MACOS_APP_CONFIG = Info.plist
|
|
MACOS_APP_LIBS = $(MACOS_CROSS_FW)/SDL2*.framework
|
|
|
|
# The entitlements file includes a special permission for the Steam API dylib
|
|
ifeq ($(STEAM),yes)
|
|
MACOS_APP_CONFIG += $(NAME).entitlements
|
|
endif
|
|
|
|
$(NAME).app : CC = MACOSX_DEPLOYMENT_TARGET=11.3 PATH=$(PATH):$(MACOS_CROSS_BIN) o64-clang -arch arm64 -arch x86_64
|
|
$(NAME).app : CXX = MACOSX_DEPLOYMENT_TARGET=11.3 PATH=$(PATH):$(MACOS_CROSS_BIN) o64-clang++ -arch arm64 -arch x86_64
|
|
$(NAME).app : CFLAGS += $(MACOS_CFLAGS)
|
|
$(NAME).app : LFLAGS += $(MACOS_LFLAGS)
|
|
$(NAME).app : $(MACOS_OBJ)
|
|
mkdir -p $(MACOS_BUNDLE_CONTENTS)/MacOS $(MACOS_BUNDLE_CONTENTS)/Frameworks $(MACOS_BUNDLE_CONTENTS)/Resources
|
|
cp $(MACOS_APP_CONFIG) $(MACOS_BUNDLE_CONTENTS)
|
|
cp -r $(MACOS_APP_LIBS) $(MACOS_BUNDLE_CONTENTS)/Frameworks
|
|
LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(MACOS_CROSS_ROOT)/target/lib $(CXX) -v $^ $(LFLAGS) \
|
|
-o $(MACOS_BUNDLE_CONTENTS)/MacOS/$(basename $@)
|
|
rsync -arRL $(MACOS_RESOURCES) $(MACOS_BUNDLE_CONTENTS)/Resources
|
|
$(success_message)
|
|
|
|
# The Steam API requires the dylib file to be in the MacOS directory (the same directory as the executable). The Steam
|
|
# app ID file is also included in the app bundle because this app is only used for testing.
|
|
ifeq ($(STEAM),yes)
|
|
rsync -a $(STEAM_LIB)/osx/libsteam_api.dylib $(MACOS_BUNDLE_CONTENTS)/MacOS/
|
|
-cp steam_appid.txt $(MACOS_BUNDLE_CONTENTS)/Resources/
|
|
endif
|
|
|
|
MACOS_EMU_PORT = 50922
|
|
MACOS_EMU_HOST = localhost
|
|
MACOS_EMU_USER = frank
|
|
|
|
macos-transfer :
|
|
rsync -Wav -e "ssh -p $(MACOS_EMU_PORT)" --progress $(MACOS_BUILD_DIR)/dmg/*.app \
|
|
"$(MACOS_EMU_USER)@$(MACOS_EMU_HOST):/Users/$(MACOS_EMU_USER)"
|
|
|
|
###########
|
|
# Windows #
|
|
###########
|
|
|
|
# Set the paths to the directories for the SDL MinGW libraries
|
|
|
|
SDL_MINGW_ROOT := $(HOME)/ext/software/SDL2/SDL2-mingw
|
|
SDL_MINGW = $(SDL_MINGW_ROOT)/SDL2-2.24.2/$(WIN_ARCH)-w64-mingw32
|
|
SDL_IMG_MINGW = $(SDL_MINGW_ROOT)/SDL2_image-2.5.2/$(WIN_ARCH)-w64-mingw32
|
|
SDL_TTF_MINGW = $(SDL_MINGW_ROOT)/SDL2_ttf-2.20.2/$(WIN_ARCH)-w64-mingw32
|
|
SDL_MIXER_MINGW = $(SDL_MINGW_ROOT)/SDL2_mixer-2.5.2/$(WIN_ARCH)-w64-mingw32
|
|
WIN_RESOURCES = malformed.json Simulacra_and_Simulation.json config.json config/ BPmono.ttf
|
|
WIN_OBJ = glew.o SDL2_rotozoom.o SDL2_gfxPrimitives.o catch_amalgamated.o SHA256.o $(SB_O_FILES) $(SRC_O_FILES)
|
|
WIN_DLLS = $(SDL_MINGW)/bin/*.dll $(SDL_IMG_MINGW)/bin/*.dll $(SDL_TTF_MINGW)/bin/*.dll $(SDL_MIXER_MINGW)/bin/*.dll \
|
|
/usr/$(WIN_ARCH)-w64-mingw32/lib/libwinpthread-1.dll
|
|
|
|
# If the Steam API is enabled, link to the Steam API library and include the DLL in the distributable, using separate
|
|
# files for 32-bit and 64-bit builds
|
|
|
|
ifeq ($(STEAM),yes)
|
|
$(NAME)-win32.exe : LFLAGS += -L$(STEAM_LIB)/ -lsteam_api
|
|
$(NAME)-win64.exe : LFLAGS += -L$(STEAM_LIB)/win64/ -lsteam_api64
|
|
$(NAME)-win32.exe : WIN_DLLS += $(STEAM_LIB)/steam_api.dll
|
|
$(NAME)-win64.exe : WIN_DLLS += $(STEAM_LIB)/win64/steam_api64.dll
|
|
endif
|
|
|
|
# Add the DLL to the distributable
|
|
|
|
ifeq ($(CURL),yes)
|
|
$(NAME)-win32.exe : CURL_WIN_MINGW_ARCH := win32
|
|
$(NAME)-win64.exe : CURL_WIN_MINGW_ARCH := win64
|
|
$(NAME)-win32.exe : WIN_DLLS += $(CURL_WIN32_DLL)
|
|
$(NAME)-win64.exe : WIN_DLLS += $(CURL_WIN64_DLL)
|
|
endif
|
|
|
|
# Set the compiler to the MinGW compilers
|
|
|
|
$(NAME)-win32.exe: WIN_ARCH = i686
|
|
$(NAME)-win64.exe: WIN_ARCH = x86_64
|
|
$(NAME)-win32.exe: WIN_BUILD_DIR := $(WIN32_BUILD_DIR)
|
|
$(NAME)-win64.exe: WIN_BUILD_DIR := $(WIN64_BUILD_DIR)
|
|
$(NAME)-win32.exe $(NAME)-win64.exe: CC = $(WIN_ARCH)-w64-mingw32-gcc-posix
|
|
$(NAME)-win32.exe $(NAME)-win64.exe: CXX = $(WIN_ARCH)-w64-mingw32-g++-posix
|
|
$(NAME)-win32.exe $(NAME)-win64.exe: CFLAGS += $(WIN_CFLAGS)
|
|
$(NAME)-win32.exe $(NAME)-win64.exe: LFLAGS += $(WIN_LFLAGS)
|
|
|
|
# In the following rules, it doesn't seem possible to use WIN_BUILD_DIR for both, not sure why
|
|
|
|
$(NAME)-win32.exe: $(addprefix $(WIN32_BUILD_DIR)/, $(WIN_OBJ)) $(WIN_RESOURCES)
|
|
$(NAME)-win64.exe: $(addprefix $(WIN64_BUILD_DIR)/, $(WIN_OBJ)) $(WIN_RESOURCES)
|
|
$(NAME)-win32.exe $(NAME)-win64.exe:
|
|
$(CXX) $(filter-out $(WIN_RESOURCES), $^) $(LFLAGS) -o $(WIN_BUILD_DIR)/$@
|
|
mkdir ${basename $@}
|
|
cp $(WIN_DLLS) ${basename $@}
|
|
-cp steam_appid.txt ${basename $@}
|
|
rsync -arRL $(WIN_RESOURCES) ${basename $@}
|
|
cp $(WIN_BUILD_DIR)/$@ ${basename $@}
|
|
zip -r ${@:exe=zip} ${basename $@}
|
|
mv ${basename $@} /tmp
|
|
rm -rf /tmp/${basename $@}
|
|
mv ${@:exe=zip} $(WIN_BUILD_DIR)
|
|
$(success_message)
|
|
|
|
# Transfer Windows builds to a Windows PC and unzip them. The Windows PC must have OpenSSH server installed and running.
|
|
# This is intended for transferring the test program for automated testing. After this is run, the test could be
|
|
# triggered remotely.
|
|
|
|
WIN_PORT = 2222
|
|
WIN_HOST = localhost
|
|
WIN_USER = ohsqueezy
|
|
WIN_DEST = /Users/$(WIN_USER)/Desktop
|
|
|
|
win-transfer :
|
|
scp -P $(WIN_PORT) $(WIN64_BUILD_DIR)/*.zip $(WIN32_BUILD_DIR)/*.zip "$(WIN_USER)@$(WIN_HOST):$(WIN_DEST)"
|
|
ssh -p $(WIN_PORT) $(WIN_USER)@$(WIN_HOST) -x \
|
|
"cd $(WIN_DEST) && (for %I in (*.zip) do tar.exe -xf %I) && del *.zip"
|
|
|
|
########################
|
|
# Make multiple builds #
|
|
########################
|
|
|
|
# Builds that can be built just using the local hard drive
|
|
|
|
local : $(NAME)-linux.x64 $(NAME).html $(NAME)-win32.exe $(NAME)-win64.exe
|
|
|
|
# Builds that require SDKs on an external hard drive
|
|
|
|
external : $(NAME).app Ubuntu-18
|
|
|
|
# Debug builds
|
|
|
|
debug : $(NAME)-linux_debug.x64
|
|
|
|
# Balls to the wall
|
|
|
|
all : local debug external
|
|
|
|
################################
|
|
# Clean up all generated files #
|
|
################################
|
|
|
|
clean :
|
|
-rm -rf build/
|
|
-rm -f Test_Result*
|
|
-rm -f space_box*_log.txt
|
|
|
|
#############
|
|
# compiledb #
|
|
#############
|
|
|
|
# Generate a clang JSON compilation database file. This can be useful for example for code completion. It requires a
|
|
# compiledb binary (https://pypi.org/project/compiledb/). It should be generated manually every time a file is added,
|
|
# renamed, or the compilation flags change. The generated database is based on the Linux build.
|
|
|
|
PATH_TO_COMPILEDB = $(HOME)/ext/software/compiledb/bin/compiledb
|
|
compiledb: CC = clang-19
|
|
compiledb: CXX = clang++-19
|
|
compiledb :
|
|
-$(PATH_TO_COMPILEDB) -n make $(NAME)-linux.x64 -k
|