forked from aregtech/areg-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser.mk
117 lines (94 loc) · 4.39 KB
/
user.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# ###########################################################################
# This file is part of AREG SDK
# Copyright (c) 2017-2021, Aregtech UG
# Contact: info[at]aregtech.com
# ###########################################################################
# ###########################################################################
# These parameters already should be set either from command line or by extracting from other params
#
# MakefileRoot -- indicates the path of the root Makefile, should be extracted from $(abspath $(lastword $(MAKEFILE_LIST)))
# Toolset -- gcc, g++, clang++13, etc., the default is g++
# Config -- 'Debug' or 'Release'. Parameters are either passed in the command line or extracted. The default is 'Release'
# Platform -- x86, x64, arm, etc. Parameters are either passed in the command line or extracted. The default is current system
# OpSystem -- Windows, Linux, Darvin, etc. Parameters are either passed in the command line, or extracted. The default is current system
#
# The following is a list of preprocessor directives, depending on the settings above:
# 1. -DDEBUG or -DNDEBUG, depending whether Config name is "Debug" or not, default is -DNDEBUG ("Release")
# 2. -DBIT64 or -DBIT32, depending whether Platform is x64 or not, default is -DBIT32
# 3. -DWINDOWS or -DPOSIX, depending whether OpSystesm is Windows or not, the default is -DPOSIX
#
# ###########################################################################
# ###########################################################################
# Toolchain
# ###########################################################################
# Modify the 'Toolset' to change compiler
# Example:
# Toolset := clang++-13
Toolset := g++
CrossCompile :=
# ###########################################################################
# Settings
# ###########################################################################
# taget settings
# Modify 'areg' to the compile target
# Example:
# areg := static
areg := shared
bit :=
# Modify the 'Config' to change the Configuration
# Example:
# Config := Debug
Config := Release
# host settings, can leave them blank in case host's OS is Linux.
Platform :=
OpSystem :=
ifeq ($(Platform),)
Platform := $(shell uname -p)
endif
ifeq ($(OpSystem),)
OpSystem := $(shell uname -s)
endif
# ###########################################################################
# AERG SDK globals
# These AREG SDK variables are fixed and should not be changed
# ###########################################################################
# AREG SDK root directory without '/'
AregRoot := $(AREG_SDK_ROOT)
# The source codes of AREG SDK
AregInclude := $(AREG_BASE)
# ###########################################################################
# USER DEFINED VARIABLES
# These are user specific settings to apply to all projects.
# The user must be able to change the target output folder
# ###########################################################################
# User can set specific preprocessor directives
UserDefines := -DENABLE_TRACES
# User can set specific include paths, must be prefixed with '-I' if used
UserDefIncludes :=
# User can set the specific library paths to search libraries
UserDefLibPaths :=
# User can set specific libraries to link.
UserDefLibs :=
# User output folder
UserDefOutput := product
# ###########################################################################
# PROJECT VARIABLES
# Change these variables only if indeed there is a need.
# ###########################################################################
# The source code build relative path
ProjBuildPath := $(shell echo build/$(CrossCompile)$(Toolset)/$(OpSystem)-$(Platform)-$(Config) | tr '[:upper:]' '[:lower:]')
# The project output directory
ProjOutputDir := $(AregRoot)/$(UserDefOutput)/$(ProjBuildPath)
# The project generated files directory
ProjGendDir := $(AregRoot)/$(UserDefOutput)/generate
# The common object directory, projects can have their own sub-directories
ProjObjDir := $(ProjOutputDir)/obj
# The project static library directory
ProjLibDir := $(ProjOutputDir)/lib
# The project binary output directory
ProjBinDir := $(ProjOutputDir)/bin
# The project include directories
ProjIncludes :=
ProjIncludes += -I$(AregInclude)
ProjIncludes += -I$(ProjGendDir)
ProjIncludes += $(UserDefIncludes)