Skip to content
Snippets Groups Projects
Select Git revision
  • 24a0ee6885542c0c63925115b6889c2ed44c0ec0
  • main default protected
  • f-sss4grpc
  • dev
  • 108-implement-rpc-call-for-server-side-scripting
  • f-windows-conan-create
  • f-to-string
  • f-update-requirements
  • f-related-projects
  • f-role
  • f-remote-path
  • f-rel-path
  • f-consol-message
  • v0.3.0
  • v0.2.2
  • v0.2.1
  • v0.2.0
  • v0.1.2
  • v0.1.1
  • v0.1
  • v0.0.19
  • v0.0.18
  • v0.0.16
  • v0.0.15
  • v0.0.10
  • v0.0.9
  • v0.0.8
  • v0.0.7
  • v0.0.6
  • v0.0.5
  • v0.0.4
  • v0.0.3
  • v0.0.2
33 results

Makefile

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Makefile 3.14 KiB
    # ** header v3.0
    # This file is a part of the CaosDB Project.
    #
    # Copyright (C) 2021 IndiScale GmbH <info@indiscale.com>
    # Copyright (C) 2021 Daniel Hornung <d.hornung@indiscale.com>
    #
    # This program is free software: you can redistribute it and/or modify
    # it under the terms of the GNU Affero General Public License as
    # published by the Free Software Foundation, either version 3 of the
    # License, or (at your option) any later version.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    # GNU Affero General Public License for more details.
    #
    # You should have received a copy of the GNU Affero General Public License
    # along with this program. If not, see <https://www.gnu.org/licenses/>.
    #
    # ** end header
    
    # This Makefile is a wrapper for several other scripts.
    
    
    CLANG_FORMAT ?= clang-format-11
    CONAN_SETTINGS = "compiler.libcxx=libstdc++11"
    
    # OS specific handling, with code by Ken Jackson and oHo,
    # from https://stackoverflow.com/a/52062069/232888 and
    # https://stackoverflow.com/a/14777895/232888
    ifeq '$(findstring ;,$(PATH))' ';'
    	DETECTED_OS := Windows
    else
    	DETECTED_OS := $(shell uname 2>/dev/null || echo Unknown)
    	DETECTED_OS := $(patsubst CYGWIN%,Cygwin,$(DETECTED_OS))
    	DETECTED_OS := $(patsubst MSYS%,MSYS,$(DETECTED_OS))
    	DETECTED_OS := $(patsubst MINGW%,MSYS,$(DETECTED_OS))
    endif
    ifeq ($(DETECTED_OS),Darwin)  # Test if we are on MacOS
    	CONAN_SETTINGS := "compiler.cppstd=17"
    endif
    
    
    .PHONY: help
    help:
    	@echo "Targets:"
    	@echo "    style - auto-format the source files."
    	@echo "    conan-install-deps - Install dependencies locally with Conan."
    	@echo -e "    conan-create - Create Conan binary package in the local conan\n"\
    	"                   repostory."
    	@echo "    conan - Install dependencies, then build and install package."
    
    style:
    	$(CLANG_FORMAT) -i --verbose \
    	 $$(find test/ src/ include/ -type f -iname "*.cpp" -o -iname "*.h" -o -iname "*.h.in")
    .PHONY: style
    
    conan-install-deps:
    	conan install . -s $(CONAN_SETTINGS) || \
    	  (echo "'conan install' failed, trying to build from sources..."; \
    	   conan install . -s $(CONAN_SETTINGS) --build=missing)
    .PHONY: conan-install-deps
    
    conan-install-debug:
    	conan install . -s $(CONAN_SETTINGS) -s build_type=Debug || \
    	  (echo "'conan install' failed, trying to build from sources..."; \
    	   conan install . -s $(CONAN_SETTINGS) -s build_type=Debug --build=missing)
    .PHONY: conan-install-debug
    
    conan-create:
    	conan create -s $(CONAN_SETTINGS) -o caosdb:build_acm=True . "caosdb/$$(conan inspect --raw version .)@_/_"
    .PHONY: conan-create
    
    conan-create-debug:
    	conan create -s $(CONAN_SETTINGS) -s build_type=Debug -o caosdb:build_acm=True . "caosdb/$$(conan inspect --raw version .)@_/_"
    
    .PHONY: conan-create-debug
    
    conan: conan-install-deps conan-create
    .PHONY: conan
    
    doc:
    	mkdir -p build && cd build && conan install .. --build=missing -s $(CONAN_SETTINGS) \
    	  && cmake .. && cmake --build . --target doc-sphinx \
    	  && echo "The documentation starts at build/doc/sphinx_out/index.html ."
    .PHONY: doc
    
    conan-debug: conan-install-debug conan-create-debug
    .PHONY: conan-debug