Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
cpp-Networking-Library/make-env-vars.mk at main · finjosh/cpp-Networking-Library · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
finjosh
cpp-Networking-Library
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
cpp-Networking-Library
/
make-env-vars.mk
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
126 lines (107 loc) · 4.19 KB
main
Breadcrumbs
cpp-Networking-Library
/
make-env-vars.mk
Copy path
Top
File metadata and controls
Code
Blame
126 lines (107 loc) · 4.19 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
118
119
120
121
122
123
124
125
126
#
* ALL paths should start with a / and end without one
#
* Try to use COMPILE_OS instead of HOST_OS unless needed
#
Some variables that are accessible at eval
#
HOST_OS: the OS the makefile is running on
#
COMPILE_OS: the OS the code is being compiled for
#
PROJECT_DIRECTORY: the directory where the makefile is being run from
#
MOUNT_POINT: the mount point of the filesystem
#
BUILD_RELEASE: the type of release (debug or release)
#
BUILD_TYPE: the type of build (debug or release)
#
* The following will be evaluated in the order they are listed, if applicable
#
* i.e. executable_config is evaluated after general_config if compiling an executable
#
* First, general_config, then BUILT_TYPE, then BUILD_RELEASE, then OS
define
general_config
MAKEFLAGS:=-j
$$(
NUM_THREADS
)
PROJECT_NAME:=networking
#
empty defaults to ${PROJECT_DIRECTORY}
PROJECT_OUT_DIRECTORY:=
OBJECT_OUT_DIRECTORY:=/bin/$${COMPILE_OS}
ifeq ($${COMPILE_OS}, windows)
ifeq ($${HOST_OS}, linux)
OBJECT_OUT_DIRECTORY:=/bin/windows-via-linux
endif
endif
LINKER_FLAGS:=SET_LATER
INCLUDE_FLAGS:=
EXECUTABLE_EXTENSION:=SET_LATER
LIB_EXTENSION:=SET_LATER
CPP_COMPILER:=g++
C_COMPILER:=gcc
CREATE_LIB:=SET_LATER
CPP_COMPILER_FLAGS:=-std=c++20
C_COMPILER_FLAGS:=-std=c17
#
any other compiler options for both C and CPP (warning flags -Wextra -Wall)
C_CPP_COMPILER_FLAGS:=
PROJECT_FINAL_FLAGS:=
#
Where the source files will be found (recursive)
SOURCE_DIRECTORIES:=/src
#
Where you don't want underlying folders to be included
#
Leave empty for no non-recursive directories
#
just use . for the project directory
NON_RECURSIVE_SOURCE_DIRECTORIES:=.
#
Not required to be defined, but are useful for my environment
LIBRARY_PREFIX:=$${MOUNT_POINT}/dev-env/libraries/$${COMPILE_OS}
GIT_LIB_PREFIX:=
$$(
MOUNT_POINT
)
/dev-env/git-projects
#
-------------------------------------------------------------
INCLUDE_DIRECTORIES=$${LIBRARY_PREFIX}/SFML-3.1.0/include $${LIBRARY_PREFIX}/TGUI-1.13/include\
$${PROJECT_DIRECTORY} $${PROJECT_DIRECTORY}/include $${GIT_LIB_PREFIX}/cpp-Utilities/include
LIB_DIRECTORIES=$${LIBRARY_PREFIX}/SFML-3.1.0/lib $${LIBRARY_PREFIX}/TGUI-1.13/lib $${GIT_LIB_PREFIX}/cpp-Utilities/lib/$${COMPILE_OS}
endef
define
executable_config
PROJECT_NAME:=main
endef
define
lib_config
PROJECT_NAME:=networking
PROJECT_OUT_DIRECTORY:=/lib/$${COMPILE_OS}
NON_RECURSIVE_SOURCE_DIRECTORIES:=
endef
define
debug_config
ifeq ($${BUILD_TYPE},library)
PROJECT_NAME:=$${PROJECT_NAME}-d
endif
C_CPP_COMPILER_FLAGS:=${C_CPP_COMPILER_FLAGS} -g -DDEBUG
OBJECT_OUT_DIRECTORY:=${OBJECT_OUT_DIRECTORY}/debug
endef
define
release_config
C_CPP_COMPILER_FLAGS:=${C_CPP_COMPILER_FLAGS} -O3
OBJECT_OUT_DIRECTORY:=${OBJECT_OUT_DIRECTORY}/release
endef
define
windows_config
EXECUTABLE_EXTENSION:=.exe
LIB_EXTENSION:=.a
CREATE_LIB:=ar rcs
C_CPP_COMPILER_FLAGS:=${C_CPP_COMPILER_FLAGS} -static
INCLUDE_FLAGS:=-D SFML_STATIC
LINKER_FLAGS:=-lutils -ltgui-s \
-lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lopengl32 -lfreetype \
-lsfml-window-s -lsfml-system-s -lopengl32 -lwinmm -lgdi32 \
-lsfml-audio-s -lsfml-system-s -lFLAC -lvorbisenc -lvorbisfile -lvorbis -logg \
-lsfml-network-s -lsfml-system-s -lws2_32 \
-lsfml-system-s -lwinmm \
-lstdc++
endef
#
First windows_config is evaluated, then windows_via_linux_config
define
windows_via_linux_config
CPP_COMPILER:=x86_64-w64-mingw32-g++
C_COMPILER:=x86_64-w64-mingw32-gcc
CREATE_LIB:=x86_64-w64-mingw32-ar rcs
endef
define
linux_config
EXECUTABLE_EXTENSION:=
LIB_EXTENSION:=.so
CREATE_LIB:=g++ ${C_CPP_COMPILER_FLAGS} -shared -o
INCLUDE_DIRECTORIES:=$${INCLUDE_DIRECTORIES} /usr/include
LIB_DIRECTORIES:=$${LIB_DIRECTORIES} /lib
#
LIBS_SEARCH_PATHS is where the program will look for the shared libraries at runtime
#
LIB_DIRECTORIES is added here for simple testing
LIBS_SEARCH_PATHS:=./ ./lib \
$${LIB_DIRECTORIES}
LINKER_FLAGS:=-lutils -ltgui \
-lsfml-graphics -lsfml-window -lsfml-system \
-lsfml-window -lsfml-system \
-lsfml-audio -lsfml-system \
-lsfml-network \
-lsfml-system \
-lstdc++
$$(
patsubst
%
,-Wl$${COMMA}-rpath$${COMMA}
%
,$${LIBS_SEARCH_PATHS})
C_CPP_COMPILER_FLAGS:=$${C_CPP_COMPILER_FLAGS} -fPIC
endef
You can’t perform that action at this time.