2019-02-06 22:00:39 -08:00
|
|
|
#
|
|
|
|
|
# ZeroTier SDK - Network Virtualization Everywhere
|
|
|
|
|
# Copyright (C) 2011-2019 ZeroTier, Inc. https://www.zerotier.com/
|
|
|
|
|
#
|
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
|
# it under the terms of the GNU 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 General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
#
|
|
|
|
|
# --
|
|
|
|
|
#
|
|
|
|
|
# You can be released from the requirements of the license by purchasing
|
|
|
|
|
# a commercial license. Buying such a license is mandatory as soon as you
|
|
|
|
|
# develop commercial closed-source software that incorporates or links
|
|
|
|
|
# directly against ZeroTier software without disclosing the source code
|
|
|
|
|
# of your own application.
|
|
|
|
|
#
|
2018-02-07 14:54:00 -08:00
|
|
|
|
2018-08-24 15:45:05 -07:00
|
|
|
ifeq ($(OS),Windows_NT)
|
2019-02-06 22:00:39 -08:00
|
|
|
DIST_BUILD_SCRIPT := ports\dist.bat
|
|
|
|
|
CLEAN_SCRIPT := ports\clean.bat
|
2018-08-24 15:45:05 -07:00
|
|
|
else
|
2019-02-06 22:00:39 -08:00
|
|
|
DIST_BUILD_SCRIPT := ./ports/dist.sh
|
|
|
|
|
CLEAN_SCRIPT := ./ports/clean.sh
|
|
|
|
|
PACKAGE_SCRIPT := ./ports/package.sh
|
2018-08-24 15:45:05 -07:00
|
|
|
endif
|
|
|
|
|
|
2019-02-25 14:52:19 -08:00
|
|
|
CONCURRENT_BUILD_JOBS=#-j 2
|
2019-02-06 22:00:39 -08:00
|
|
|
|
|
|
|
|
# Patch submodules
|
|
|
|
|
patch:
|
|
|
|
|
-git -C ext/lwip apply ../lwip.patch
|
|
|
|
|
-git -C ext/lwip-contrib apply ../lwip-contrib.patch
|
2019-02-14 19:03:49 -08:00
|
|
|
-git -C ext/ZeroTierOne apply ../ZeroTierOne.patch
|
2019-02-06 22:00:39 -08:00
|
|
|
|
2018-02-07 14:54:00 -08:00
|
|
|
.PHONY: clean
|
|
|
|
|
clean:
|
2019-02-25 14:52:19 -08:00
|
|
|
-rm -rf bin staging generated dist
|
|
|
|
|
-find ports -name ".externalNativeBuild" -exec rm -r "{}" \;
|
2019-02-06 22:00:39 -08:00
|
|
|
|
|
|
|
|
all: debug release
|
|
|
|
|
|
|
|
|
|
release:
|
|
|
|
|
-mkdir generated
|
|
|
|
|
cmake -H. -Bgenerated/release -DCMAKE_BUILD_TYPE=Release
|
2019-02-25 14:52:19 -08:00
|
|
|
cmake --build generated/release $(CONCURRENT_BUILD_JOBS)
|
|
|
|
|
|
2018-08-22 10:49:21 -07:00
|
|
|
|
2019-02-06 22:00:39 -08:00
|
|
|
debug:
|
|
|
|
|
-mkdir generated
|
|
|
|
|
cmake -H. -Bgenerated/debug -DCMAKE_BUILD_TYPE=Debug
|
2019-02-25 14:52:19 -08:00
|
|
|
cmake --build generated/debug $(CONCURRENT_BUILD_JOBS)
|
2019-02-06 22:00:39 -08:00
|
|
|
|
|
|
|
|
# dist:
|
2018-08-22 10:49:21 -07:00
|
|
|
# Build and package everything
|
|
|
|
|
# This command shall be run twice:
|
|
|
|
|
# (1) Generates projects
|
|
|
|
|
# <perform any required modifications>
|
|
|
|
|
# (2) Build products and package everything
|
|
|
|
|
.PHONY: dist
|
|
|
|
|
dist: patch
|
2018-08-24 15:45:05 -07:00
|
|
|
$(DIST_BUILD_SCRIPT)
|