docs/contrib/util-makefile.md
Open-IM-Server boasts a robust set of tools encapsulated within its Makefile system, designed to ease development, code formatting, and tool management. This guide aims to familiarize developers with the features and usage of the Makefile toolset provided within the Open-IM-Server project.
Executing make tools ensures verification and installation of the default tools:
The installation path is situated at ./_output/tools/.
The Makefile logically groups tools into different categories for better management:
BUILD_TOOLSANALYSIS_TOOLSGENERATION_TOOLSTEST_TOOLSVERSION_CONTROL_TOOLSUTILITY_TOOLSCOS_TOOLSmake tools.help output above)...tools.install: Installs tools mentioned in the BUILD_TOOLS list.tools.install-all: Installs all tools from the ALL_TOOLS list.tools.install.%: Installs a single tool in the $GOBIN/ directory.tools.install-all.%: Parallelly installs an individual tool located in ./tools/*.tools.verify.%: Checks if a specific tool is installed, and if not, installs it.The following commands serve the purpose of installing particular development tools:
install.golangci-lint: Installs golangci-lint.install.addlicense: Installs addlicense. ... (and so on for every tool as mentioned in the provided Makefile source)...The commands primarily leverage Go's install operation, fetching and installing tools from their respective repositories. This method is especially convenient as it auto-handles dependencies and installation paths. For tools not written directly with Go (like install.coscli), other installation methods like wget or pip are employed.
make tools command.make install.<tool-name> command for individual installations.make tools.verify.% command to guarantee that all necessary tools are present and up-to-date.The Makefile provided by Open-IM-Server presents a centralized approach to manage and install all necessary tools during the development process. It ensures that all developers employ consistent tool versions, reducing potential issues due to version disparities. Whether you're a maintainer or a contributor to the Open-IM-Server project, understanding the workings of this Makefile will significantly enhance your developmental efficiency.