File indexing completed on 2024-04-21 05:40:47

0001 # Copyright (c) 2018, Michal Policht. This file is dually licensed under terms
0002 # of either WTFPL or BEER-WARE LICENSE. You may obtain the copy of WTFPL or
0003 # BEER-WARE LICENSE by googling, binging, yahooing or downloading it from pirate
0004 # bay. NO WARRANTY.
0005 
0006 # This Makefile defines various project-specific variables.
0007 
0008 HELP_MESSAGE = Use Qbs if you wish to build the project itself.
0009 
0010 # C compiler (GCC-compatible is required in many cases).
0011 CC = gcc
0012 
0013 INCLUDE_GUARD_PREFIX = 'H_'
0014 
0015 # Project directory (without trailing slash).
0016 PROJECT_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
0017 
0018 # Root directory of external artifacts.
0019 EXTERNAL_ROOT = $(PROJECT_DIR)/external
0020 
0021 # Directory for temporaries.
0022 TEMP_DIR = $(EXTERNAL_ROOT)/_temp/$(TARGET_MACHINE)
0023 
0024 # A place where external source code archives are stored.
0025 ARCHIVE_DIR = $(TEMP_DIR)/archive
0026 
0027 # Sources directory.
0028 SOURCE_DIR = $(TEMP_DIR)/source
0029 
0030 # Port directory.
0031 PORT_DIR = $(TEMP_DIR)/port
0032 
0033 # Build directory.
0034 BUILD_DIR = $(TEMP_DIR)/build
0035 
0036 # Installation directory.
0037 INSTALL_DIR = $(TEMP_DIR)/install
0038 
0039 # Root directory for deployments.
0040 DEPLOY_DIR = $(EXTERNAL_ROOT)/deploy
0041 
0042 # Recipes directory.
0043 RECIPES_DIR = $(EXTERNAL_ROOT)/recipes/$(TARGET_MACHINE)
0044 
0045 LICENSE_DSLASH_DIRS = extensions qbs tools
0046 
0047 INCLUDE_GUARDS_DIRS = extensions tools
0048 
0049 DOXYGEN_INPUT_DIRS = Doxyfile extensions tools doc/Doxyfile external/Doxyfile external/recipes
0050 
0051 DOXYGEN_OUTPUT_DIR = doc/Doxygen/docs
0052 
0053 DOC_PROJECT_TARGETS = $(DOC_EXTENSIONS_LIST_FILE) $(DOC_TOOLS_LIST_FILE) \
0054                                           doc_subdirs doc_project_doxyqml
0055 
0056 # Directory for autogenerated files.
0057 MAKEFILE_PROJECT_AUTOGEN_DIR = $(PROJECT_DIR)/doc/_temp/Makefile.project
0058 
0059 # File containing list of tools.
0060 DOC_TOOLS_LIST_FILE = $(MAKEFILE_PROJECT_AUTOGEN_DIR)/ToolsList.inc.dox
0061 
0062 # File containing list of extensions.
0063 DOC_EXTENSIONS_LIST_FILE = $(MAKEFILE_PROJECT_AUTOGEN_DIR)/ExtensionsList.inc.dox
0064 
0065 # Product entry print script.
0066 DOCPRODENTRY = awkgward/docprodentry.sh
0067 
0068 INCLUDE_GUARDS_EXCLUDE = ! -path 'extensions/templates_*'
0069 
0070 # URL of l10n-kf5 repository.
0071 L10N-KF5_URL = svn://anonsvn.kde.org/home/kde/trunk/l10n-kf5/scripts
0072 
0073 
0074 
0075 include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))Makefile.toolchain 
0076 
0077 
0078 # Add directory with doxyqml to the PATH, so that it can be seen by Doxygen.
0079 PATH := $(PATH):$(abspath $(DOXYQML_DIR))
0080 
0081 
0082 .PHONY: doc_project_doxyqml doc_subdirs
0083 
0084 $(DOC_TOOLS_LIST_FILE): tools $(MAKEFILE_PROJECT_AUTOGEN_DIR) $(DOCPRODENTRY) | $(SH) $(FIND) $(XARGS) $(SORT) $(BASENAME) $(DIRNAME) $(ECHO)
0085                 @$(ECHO) Generating "$@" file...
0086                 @$(ECHO) '<!-- This file has been autogenerated by Makefile.project. -->' > $@
0087                 @$(FIND) tools -mindepth 2 \( -name 'Doxyfile' -o -name '*.Doxyfile' \) \
0088                 | $(SORT) | $(XARGS) -I {} $(SH) $(DOCPRODENTRY) {} >> $@
0089                 @$(ECHO) '.' >> $@
0090 
0091 $(DOC_EXTENSIONS_LIST_FILE): extensions $(MAKEFILE_PROJECT_AUTOGEN_DIR) $(DOCPRODENTRY) | $(SH) $(FIND) $(XARGS) $(SORT) $(SED) $(DIRNAME) $(ECHO)
0092                 @$(ECHO) Generating "$@" file...
0093                 @$(ECHO) '<!-- This file has been autogenerated by Makefile.project. -->' > $@
0094                 @$(FIND) extensions -mindepth 2 \( -name 'Doxyfile' -o -name '*.Doxyfile' \) \
0095                 | $(SORT) | $(XARGS) -I {} $(SH) $(DOCPRODENTRY) {} >> $@
0096                 @$(ECHO) '.' >> $@
0097 
0098 # Doxygen is not able to create output subdirectories (e.g. extensions/CuteHMI/Test.0)
0099 # recursively (like mkidr -p does) and quits with error, so they have to be created.
0100 doc_subdirs: | $(SH) $(FIND) $(XARGS) $(BASENAME) $(DIRNAME) $(ECHO) $(MKDIR)
0101                 @$(ECHO) Creating documentation output subdirectories...
0102                 @$(FIND) extensions -mindepth 2 \( -name 'Doxyfile' -o -name '*.Doxyfile' \) \
0103                 | $(XARGS) -I {} $(DIRNAME) {} | $(XARGS) -I {} $(MKDIR) -p $(DOXYGEN_OUTPUT_DIR)/{}
0104                 @$(FIND) tools -mindepth 2 \( -name 'Doxyfile' -o -name '*.Doxyfile' \) \
0105                 | $(XARGS) -I {} $(DIRNAME) {} | $(XARGS) -I {} $(MKDIR) -p $(DOXYGEN_OUTPUT_DIR)/{}
0106 
0107 doc_project_doxyqml: $(DOXYQML_PY)
0108                 @$(ECHO) Doxyqml path: "$(DOXYQML)"
0109                 @$(ECHO) Python path: "$(PYTHON)"
0110                 @$(ECHO) Doxyqml version: $(shell $(DOXYQML) --version)
0111 
0112 $(MAKEFILE_PROJECT_AUTOGEN_DIR): | $(MKDIR)
0113                 @$(ECHO) Creating "$@" directory...
0114                 @$(MKDIR) -p "$@"
0115