2018-08-24 15:45:05 -07:00
|
|
|
ifeq ($(OS),Windows_NT)
|
2019-03-18 16:26:27 -07:00
|
|
|
DIST_BUILD_SCRIPT := dist.bat
|
|
|
|
|
CLEAN_SCRIPT := clean.bat
|
2018-08-24 15:45:05 -07:00
|
|
|
else
|
2019-03-18 16:26:27 -07:00
|
|
|
DIST_BUILD_SCRIPT := ./dist.sh
|
2018-08-24 15:45:05 -07:00
|
|
|
endif
|
|
|
|
|
|
2019-03-14 17:02:18 -07:00
|
|
|
EXECUTABLES = cmake
|
|
|
|
|
build_reqs := $(foreach exec,$(EXECUTABLES),\
|
|
|
|
|
$(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH")))
|
|
|
|
|
|
2019-03-18 14:25:38 -07:00
|
|
|
.PHONY: list
|
|
|
|
|
list:
|
|
|
|
|
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= \
|
|
|
|
|
-F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") \
|
|
|
|
|
{print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
|
|
|
|
|
|
2019-03-08 16:15:05 -08:00
|
|
|
# Pull all submodules
|
|
|
|
|
update:
|
|
|
|
|
git submodule update --init
|
2019-03-12 19:34:41 -07:00
|
|
|
git submodule status
|
2019-03-08 16:15:05 -08:00
|
|
|
|
|
|
|
|
# Patch submodules (issue update first)
|
2019-02-06 22:00:39 -08:00
|
|
|
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
|
|
|
|
2019-03-14 17:02:18 -07:00
|
|
|
# Target-specific clean
|
|
|
|
|
clean_ios:
|
2019-05-06 15:01:19 -07:00
|
|
|
-rm -rf ports/xcode_ios
|
|
|
|
|
-rm -rf ports/xcode_ios_simulator
|
2019-03-14 17:02:18 -07:00
|
|
|
clean_macos:
|
|
|
|
|
-rm -rf ports/xcode_macos
|
|
|
|
|
clean_android:
|
|
|
|
|
-rm -rf ports/android/app/build
|
2019-02-25 14:52:19 -08:00
|
|
|
-find ports -name ".externalNativeBuild" -exec rm -r "{}" \;
|
2019-03-15 15:05:11 -07:00
|
|
|
clean_products:
|
|
|
|
|
-rm -rf products
|
2019-03-14 17:02:18 -07:00
|
|
|
.PHONY: clean
|
|
|
|
|
clean: clean_ios clean_macos clean_android
|
2019-03-18 14:25:38 -07:00
|
|
|
$(DIST_BUILD_SCRIPT) clean
|
2019-03-04 18:04:37 -08:00
|
|
|
|
|
|
|
|
# Use CMake generators to build projects from CMakeLists.txt
|
|
|
|
|
projects:
|
|
|
|
|
$(DIST_BUILD_SCRIPT) generate_projects
|
|
|
|
|
|
|
|
|
|
# Android
|
|
|
|
|
android_debug:
|
|
|
|
|
$(DIST_BUILD_SCRIPT) android "debug"
|
2019-03-18 14:25:38 -07:00
|
|
|
$(DIST_BUILD_SCRIPT) clean_android_project
|
|
|
|
|
$(DIST_BUILD_SCRIPT) prep_android_example "debug"
|
2019-03-04 18:04:37 -08:00
|
|
|
android_release:
|
|
|
|
|
$(DIST_BUILD_SCRIPT) android "release"
|
2019-03-18 14:25:38 -07:00
|
|
|
$(DIST_BUILD_SCRIPT) clean_android_project
|
|
|
|
|
$(DIST_BUILD_SCRIPT) prep_android_example "release"
|
2019-03-04 18:04:37 -08:00
|
|
|
android_clean:
|
|
|
|
|
$(DIST_BUILD_SCRIPT) android "clean"
|
|
|
|
|
android: android_debug android_release
|
2019-03-18 14:25:38 -07:00
|
|
|
prep_android_debug_example:
|
|
|
|
|
$(DIST_BUILD_SCRIPT) prep_android_example "debug"
|
|
|
|
|
prep_android_release_example:
|
|
|
|
|
$(DIST_BUILD_SCRIPT) prep_android_example "release"
|
2019-02-06 22:00:39 -08:00
|
|
|
|
2019-03-04 18:04:37 -08:00
|
|
|
# macOS
|
|
|
|
|
macos_debug:
|
|
|
|
|
$(DIST_BUILD_SCRIPT) macos "debug"
|
|
|
|
|
macos_release:
|
|
|
|
|
$(DIST_BUILD_SCRIPT) macos "release"
|
|
|
|
|
macos: macos_debug macos_release
|
2019-02-06 22:00:39 -08:00
|
|
|
|
2019-03-04 18:04:37 -08:00
|
|
|
# iOS
|
|
|
|
|
ios_debug:
|
|
|
|
|
$(DIST_BUILD_SCRIPT) ios "debug"
|
|
|
|
|
ios_release:
|
|
|
|
|
$(DIST_BUILD_SCRIPT) ios "release"
|
|
|
|
|
ios: ios_debug ios_release
|
2019-02-25 14:52:19 -08:00
|
|
|
|
2019-03-04 18:04:37 -08:00
|
|
|
# Host
|
|
|
|
|
host_release:
|
|
|
|
|
$(DIST_BUILD_SCRIPT) host "release"
|
|
|
|
|
host_debug:
|
|
|
|
|
$(DIST_BUILD_SCRIPT) host "debug"
|
|
|
|
|
host_clean:
|
|
|
|
|
$(DIST_BUILD_SCRIPT) host "clean"
|
|
|
|
|
host_jar_debug:
|
|
|
|
|
$(DIST_BUILD_SCRIPT) host_jar "debug"
|
|
|
|
|
host_jar_release:
|
|
|
|
|
$(DIST_BUILD_SCRIPT) host_jar "release"
|
|
|
|
|
host_jar: host_jar_debug host_jar_release
|
2019-03-08 11:15:45 -08:00
|
|
|
host: host_debug host_release
|
2018-08-22 10:49:21 -07:00
|
|
|
|
2019-03-14 17:02:18 -07:00
|
|
|
# Build every target available on this host
|
2019-03-08 11:15:45 -08:00
|
|
|
all: host host_jar macos ios android
|
2019-03-14 17:02:18 -07:00
|
|
|
$(DIST_BUILD_SCRIPT) display
|
|
|
|
|
|
|
|
|
|
# [For distribution process only] Prepare remote builds
|
|
|
|
|
wrap:
|
|
|
|
|
$(DIST_BUILD_SCRIPT) wrap
|
2019-02-06 22:00:39 -08:00
|
|
|
|
2019-03-14 17:02:18 -07:00
|
|
|
# [For distribution process only] Marge and package everything into a tarball
|
2019-03-04 18:04:37 -08:00
|
|
|
dist:
|
2019-03-14 17:02:18 -07:00
|
|
|
$(DIST_BUILD_SCRIPT) merge
|
2019-03-12 19:34:41 -07:00
|
|
|
$(DIST_BUILD_SCRIPT) dist
|