2022-08-21 13:17:23 -04:00
|
|
|
.ONESHELL:
|
|
|
|
.DELETE_ON_ERROR:
|
|
|
|
MAKEFLAGS += --warn-undefined-variables
|
|
|
|
MAKEFLAGS += --no-builtin-rules
|
|
|
|
|
2024-11-27 09:28:14 -05:00
|
|
|
## == Tilde Friends build. ==
|
2024-11-25 21:11:36 -05:00
|
|
|
##
|
|
|
|
## This is a list of all supported build targets.
|
|
|
|
##
|
2024-11-26 22:55:01 -05:00
|
|
|
## Consider passing -j$(nproc) or adding it to your $MAKEFLAGS to build in
|
|
|
|
## parallel (faster).
|
2024-11-25 21:11:36 -05:00
|
|
|
##
|
|
|
|
## Useful variables to override:
|
2024-11-27 09:28:14 -05:00
|
|
|
## CC := Compiler.
|
|
|
|
## AS := Assembler.
|
|
|
|
## LD := Linker.
|
|
|
|
## ANDROID_SDK := Path to the Android SDK.
|
2024-11-25 21:11:36 -05:00
|
|
|
|
2024-11-27 12:24:42 -05:00
|
|
|
VERSION_CODE := 31
|
|
|
|
VERSION_NUMBER := 0.0.26-wip
|
2024-11-06 20:42:49 -05:00
|
|
|
VERSION_NAME := This program kills fascists.
|
2023-06-28 19:23:29 -04:00
|
|
|
|
2024-11-25 13:16:20 -05:00
|
|
|
SQLITE_URL := https://www.sqlite.org/2024/sqlite-amalgamation-3470100.zip
|
2024-06-30 13:32:17 -04:00
|
|
|
BUNDLETOOL_URL := https://github.com/google/bundletool/releases/download/1.17.0/bundletool-all-1.17.0.jar
|
2024-09-27 21:19:18 -04:00
|
|
|
APPIMAGETOOL_URL := https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
|
|
|
|
APPIMAGETOOL_MD5 := e989fadfc4d685fd3d6aeeb9b525d74d out/appimagetool
|
2024-03-13 12:30:14 -04:00
|
|
|
|
2023-06-28 19:23:29 -04:00
|
|
|
PROJECT = tildefriends
|
2021-01-02 13:10:00 -05:00
|
|
|
BUILD_DIR ?= out
|
2023-10-04 19:38:42 -04:00
|
|
|
UNAME_S := $(shell uname -s)
|
2022-01-22 15:20:21 -05:00
|
|
|
UNAME_M := $(shell uname -m)
|
2023-10-18 10:24:44 -04:00
|
|
|
|
|
|
|
ANDROID_SDK ?= ~/Android/Sdk
|
2024-06-30 13:32:17 -04:00
|
|
|
BUNDLETOOL = out/bundletool.jar
|
2023-10-18 10:24:44 -04:00
|
|
|
|
2024-04-17 20:16:07 -04:00
|
|
|
HAVE_WIN := 0
|
|
|
|
|
2024-08-04 12:16:46 -04:00
|
|
|
export SOURCE_DATE_EPOCH=1
|
|
|
|
export TZ=UTC
|
2024-08-04 09:36:46 -04:00
|
|
|
|
2023-10-04 19:41:30 -04:00
|
|
|
ifeq ($(UNAME_S),Darwin)
|
2023-10-13 21:56:40 -04:00
|
|
|
BUILD_TYPES := macosdebug macosrelease iosdebug iosrelease iossimdebug iossimrelease
|
2023-10-17 18:25:31 -04:00
|
|
|
else ifeq ($(UNAME_S),Linux)
|
|
|
|
BUILD_TYPES := debug release
|
2023-10-18 10:24:44 -04:00
|
|
|
HAVE_ANDROID = $(if $(shell which $(ANDROID_SDK)/platform-tools/adb),1,0)
|
|
|
|
HAVE_LINUX_IOS = $(if $(shell which deps/ios_toolchain/target/bin deps/ios_toolchain/target/bin/arm-apple-darwin11-clang),1,0)
|
|
|
|
HAVE_WIN = $(if $(shell which x86_64-w64-mingw32-gcc-win32),1,0)
|
2023-10-25 22:56:33 -04:00
|
|
|
else ifeq ($(UNAME_S),Haiku)
|
|
|
|
BUILD_TYPES := debug release
|
|
|
|
CFLAGS += -Dstatic_assert=_Static_assert
|
|
|
|
LDFLAGS += \
|
|
|
|
-lbsd \
|
2024-09-15 12:52:28 -04:00
|
|
|
-lnetwork \
|
|
|
|
-Wno-stringop-overflow
|
2023-11-07 22:36:08 -05:00
|
|
|
else ifeq ($(UNAME_S),OpenBSD)
|
|
|
|
BUILD_TYPES := debug release
|
|
|
|
CFLAGS += \
|
|
|
|
-Wno-unknown-warning-option
|
|
|
|
LDFLAGS += \
|
|
|
|
-lexecinfo \
|
|
|
|
-lc++abi
|
|
|
|
HAVE_ANDROID := 0
|
|
|
|
HAVE_LINUX_IOS := 0
|
2023-10-18 10:24:44 -04:00
|
|
|
else
|
|
|
|
$(error Unexpected host platform $(UNAME_S).)
|
2023-10-04 19:38:42 -04:00
|
|
|
endif
|
2021-01-02 13:10:00 -05:00
|
|
|
|
2021-10-03 18:14:06 -04:00
|
|
|
CFLAGS += \
|
2023-12-09 19:49:53 -05:00
|
|
|
-std=gnu11 \
|
2021-01-02 13:10:00 -05:00
|
|
|
-Wall \
|
|
|
|
-Wextra \
|
|
|
|
-Wno-unused-parameter \
|
2024-08-25 10:07:44 -04:00
|
|
|
-Wno-unknown-warning-option \
|
2021-01-02 13:10:00 -05:00
|
|
|
-MMD \
|
2024-02-15 22:27:41 -05:00
|
|
|
-MP \
|
2021-01-02 13:10:00 -05:00
|
|
|
-ffunction-sections \
|
2022-09-24 16:54:54 -04:00
|
|
|
-fdata-sections \
|
2023-03-19 20:29:46 -04:00
|
|
|
-fno-exceptions \
|
2024-08-14 19:40:20 -04:00
|
|
|
-g
|
2024-07-25 16:02:14 -04:00
|
|
|
LDFLAGS += \
|
2024-08-14 19:40:20 -04:00
|
|
|
-Wno-attributes \
|
2024-10-23 12:02:41 -04:00
|
|
|
-Wno-aggressive-loop-optimizations \
|
2024-08-14 19:40:20 -04:00
|
|
|
-flto=auto
|
2021-10-03 18:14:06 -04:00
|
|
|
|
2023-10-22 13:51:16 -04:00
|
|
|
ANDROID_MIN_SDK_VERSION := 24
|
2023-10-22 14:52:20 -04:00
|
|
|
ANDROID_TARGET_SDK_VERSION := 34
|
2024-04-26 18:10:22 -04:00
|
|
|
ANDROID_BUILD_TOOLS := $(ANDROID_SDK)/build-tools/34.0.0
|
|
|
|
ANDROID_PLATFORM := $(ANDROID_SDK)/platforms/android-$(ANDROID_TARGET_SDK_VERSION)
|
2024-08-04 10:21:04 -04:00
|
|
|
ANDROID_NDK ?= $(ANDROID_SDK)/ndk/26.3.11579264
|
2022-12-29 16:58:54 -05:00
|
|
|
|
2023-09-28 20:07:34 -04:00
|
|
|
ANDROID_ARMV7A_TARGETS := \
|
|
|
|
out/androiddebug-armv7a/tildefriends \
|
|
|
|
out/androidrelease-armv7a/tildefriends
|
2023-03-13 23:17:01 -04:00
|
|
|
ANDROID_ARM64_TARGETS := \
|
2023-03-06 22:02:16 -05:00
|
|
|
out/androiddebug/tildefriends \
|
2023-03-10 22:47:01 -05:00
|
|
|
out/androidrelease/tildefriends
|
2023-09-28 20:07:34 -04:00
|
|
|
ANDROID_X86_TARGETS := \
|
|
|
|
out/androiddebug-x86/tildefriends \
|
|
|
|
out/androidrelease-x86/tildefriends
|
2023-03-13 23:17:01 -04:00
|
|
|
ANDROID_X86_64_TARGETS := \
|
|
|
|
out/androiddebug-x86_64/tildefriends \
|
|
|
|
out/androidrelease-x86_64/tildefriends
|
|
|
|
ANDROID_TARGETS := \
|
2023-09-28 20:07:34 -04:00
|
|
|
$(ANDROID_X86_TARGETS) \
|
2023-03-13 23:17:01 -04:00
|
|
|
$(ANDROID_X86_64_TARGETS) \
|
2023-09-28 20:07:34 -04:00
|
|
|
$(ANDROID_ARMV7A_TARGETS) \
|
2023-03-13 23:17:01 -04:00
|
|
|
$(ANDROID_ARM64_TARGETS)
|
2023-10-18 10:24:44 -04:00
|
|
|
ifeq ($(HAVE_ANDROID),1)
|
2023-10-18 10:39:20 -04:00
|
|
|
BUILD_TYPES += \
|
|
|
|
androiddebug \
|
|
|
|
androidrelease \
|
|
|
|
androiddebug-armv7a \
|
|
|
|
androidrelease-armv7a \
|
|
|
|
androiddebug-x86 \
|
|
|
|
androidrelease-x86 \
|
|
|
|
androiddebug-x86_64 \
|
|
|
|
androidrelease-x86_64
|
2024-07-14 16:18:47 -04:00
|
|
|
all: out/TildeFriends-arm-debug.apk out/TildeFriends-arm-release.apk out/TildeFriends-x86-debug.apk out/TildeFriends-x86-release.apk out/TildeFriends-release.fdroid.apk
|
2023-10-18 10:24:44 -04:00
|
|
|
endif
|
|
|
|
|
2023-10-04 19:38:42 -04:00
|
|
|
WINDOWS_TARGETS := \
|
|
|
|
out/windebug/tildefriends.exe \
|
|
|
|
out/winrelease/tildefriends.exe
|
2023-10-18 10:24:44 -04:00
|
|
|
ifeq ($(HAVE_WIN),1)
|
|
|
|
BUILD_TYPES += windebug winrelease
|
|
|
|
endif
|
|
|
|
|
|
|
|
LINUX_TARGETS := \
|
|
|
|
out/debug/tildefriends \
|
|
|
|
out/release/tildefriends
|
2023-10-04 19:20:57 -04:00
|
|
|
MACOS_TARGETS := \
|
|
|
|
out/macosdebug/tildefriends \
|
|
|
|
out/macosrelease/tildefriends
|
2023-10-11 20:29:17 -04:00
|
|
|
IOS_TARGETS := \
|
|
|
|
out/iosdebug/tildefriends \
|
|
|
|
out/iosrelease/tildefriends
|
2023-10-13 21:56:40 -04:00
|
|
|
IOSSIM_TARGETS := \
|
|
|
|
out/iossimdebug/tildefriends \
|
|
|
|
out/iossimrelease/tildefriends
|
2023-10-18 10:24:44 -04:00
|
|
|
IOS_APPS = \
|
|
|
|
out/tildefriends-iosdebug.app/tildefriends \
|
|
|
|
out/tildefriends-iosrelease.app/tildefriends
|
|
|
|
ifeq ($(HAVE_LINUX_IOS),1)
|
|
|
|
BUILD_TYPES += iosdebug iosrelease
|
|
|
|
all: $(IOS_APPS)
|
|
|
|
endif
|
|
|
|
ifeq ($(UNAME_S),Darwin)
|
|
|
|
all: $(IOS_APPS) \
|
|
|
|
out/tildefriends-iossimdebug.app/tildefriends \
|
|
|
|
out/tildefriends-iossimrelease.app/tildefriends
|
|
|
|
endif
|
2023-03-13 23:17:01 -04:00
|
|
|
|
2023-03-15 19:55:22 -04:00
|
|
|
DEBUG_TARGETS := \
|
|
|
|
out/debug/tildefriends \
|
2023-10-04 19:38:42 -04:00
|
|
|
out/windebug/tildefriends.exe \
|
2023-10-11 20:29:17 -04:00
|
|
|
out/iosdebug/tildefriends \
|
2023-10-13 21:56:40 -04:00
|
|
|
out/iossimdebug/tildefriends \
|
2023-10-04 19:20:57 -04:00
|
|
|
out/macosdebug/tildefriends \
|
2023-03-15 19:55:22 -04:00
|
|
|
out/androiddebug/tildefriends \
|
2023-09-28 20:07:34 -04:00
|
|
|
out/androiddebug-armv7a/tildefriends \
|
|
|
|
out/androiddebug-x86_64/tildefriends \
|
|
|
|
out/androiddebug-x86/tildefriends
|
2023-03-15 19:55:22 -04:00
|
|
|
RELEASE_TARGETS := \
|
|
|
|
out/release/tildefriends \
|
2023-10-04 19:38:42 -04:00
|
|
|
out/winrelease/tildefriends.exe \
|
2023-10-11 20:29:17 -04:00
|
|
|
out/iosrelease/tildefriends \
|
2023-10-13 21:56:40 -04:00
|
|
|
out/iossimrelease/tildefriends \
|
2023-10-04 19:20:57 -04:00
|
|
|
out/macosrelease/tildefriends \
|
2023-03-15 19:55:22 -04:00
|
|
|
out/androidrelease/tildefriends \
|
2023-09-28 20:07:34 -04:00
|
|
|
out/androidrelease-armv7a/tildefriends \
|
|
|
|
out/androidrelease-x86_64/tildefriends \
|
|
|
|
out/androidrelease-x86/tildefriends
|
2023-10-17 18:25:31 -04:00
|
|
|
ALL_TARGETS = $(DEBUG_TARGETS) $(RELEASE_TARGETS)
|
2023-03-19 16:25:50 -04:00
|
|
|
ANDROID_RELEASE_TARGETS := $(filter-out $(DEBUG_TARGETS),$(ANDROID_TARGETS))
|
|
|
|
NONANDROID_RELEASE_TARGETS := $(filter-out $(ANDROID_ARM64_TARGETS),$(RELEASE_TARGETS))
|
2023-10-17 18:25:31 -04:00
|
|
|
NONANDROID_TARGETS := $(filter-out $(ANDROID_TARGETS),$(ALL_TARGETS))
|
|
|
|
NONMACOS_TARGETS := $(filter-out $(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS),$(ALL_TARGETS))
|
2024-06-30 13:32:17 -04:00
|
|
|
DEADSTRIP_TARGETS := $(filter-out $(ANDROID_TARGETS),$(NONMACOS_TARGETS))
|
2024-10-11 19:04:49 -04:00
|
|
|
ifneq ($(UNAME_S),OpenBSD)
|
2024-08-25 09:39:05 -04:00
|
|
|
$(NONMACOS_TARGETS): LDFLAGS += -static-libgcc
|
2024-10-11 19:04:49 -04:00
|
|
|
endif
|
2023-03-15 19:55:22 -04:00
|
|
|
|
2023-03-19 20:29:46 -04:00
|
|
|
$(NONANDROID_TARGETS): CFLAGS += -fno-omit-frame-pointer
|
2024-06-30 13:32:17 -04:00
|
|
|
$(filter-out $(WINDOWS_TARGETS),$(ALL_TARGETS)): LDFLAGS += -rdynamic
|
2023-03-19 20:29:46 -04:00
|
|
|
$(ANDROID_TARGETS): CFLAGS += \
|
|
|
|
--sysroot $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/sysroot \
|
2023-05-09 21:47:20 -04:00
|
|
|
-fPIC \
|
2023-05-03 20:44:32 -04:00
|
|
|
-fdebug-compilation-dir . \
|
2023-03-19 20:29:46 -04:00
|
|
|
-fomit-frame-pointer \
|
2023-08-04 23:10:24 -04:00
|
|
|
-fno-asynchronous-unwind-tables \
|
2024-08-21 20:27:43 -04:00
|
|
|
-funwind-tables \
|
|
|
|
-Wno-unknown-warning-option
|
2023-05-09 21:47:20 -04:00
|
|
|
$(ANDROID_TARGETS): LDFLAGS += --sysroot $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/sysroot -fPIC
|
2023-03-15 19:55:22 -04:00
|
|
|
$(DEBUG_TARGETS): CFLAGS += -DDEBUG -Og
|
2024-08-14 19:40:20 -04:00
|
|
|
$(RELEASE_TARGETS): CFLAGS += \
|
|
|
|
-DNDEBUG \
|
|
|
|
-flto
|
2023-03-19 16:25:50 -04:00
|
|
|
$(NONANDROID_RELEASE_TARGETS): CFLAGS += -O3
|
2024-01-28 08:54:51 -05:00
|
|
|
$(ANDROID_RELEASE_TARGETS): CFLAGS += -Oz
|
2023-10-04 19:38:42 -04:00
|
|
|
$(WINDOWS_TARGETS): CC = x86_64-w64-mingw32-gcc-win32
|
|
|
|
$(WINDOWS_TARGETS): AS = $(CC)
|
|
|
|
$(WINDOWS_TARGETS): CFLAGS += \
|
2022-12-29 18:55:49 -05:00
|
|
|
-D_WIN32_WINNT=0x0A00 \
|
|
|
|
-DWINVER=0x0A00 \
|
|
|
|
-DNTDDI_VERSION=NTDDI_WIN10 \
|
2024-07-25 16:02:14 -04:00
|
|
|
-Ideps/openssl/mingw64/usr/local/include
|
2023-10-04 19:38:42 -04:00
|
|
|
$(WINDOWS_TARGETS): LDFLAGS += \
|
2022-12-29 18:55:49 -05:00
|
|
|
-static \
|
|
|
|
-lm \
|
2024-07-25 16:02:14 -04:00
|
|
|
-Ldeps/openssl/mingw64/usr/local/lib
|
2023-10-12 21:13:35 -04:00
|
|
|
ifeq ($(UNAME_S),Darwin)
|
2023-10-04 19:20:57 -04:00
|
|
|
$(MACOS_TARGETS): CC = xcrun clang
|
2023-10-11 21:33:49 -04:00
|
|
|
$(IOS_TARGETS): IOS_SYSROOT := $(shell xcrun --sdk iphoneos --show-sdk-path)
|
2023-10-19 14:06:32 -04:00
|
|
|
$(IOS_TARGETS): CC = xcrun --sdk iphoneos clang -isysroot $(IOS_SYSROOT) -arch arm64
|
2023-10-13 21:56:40 -04:00
|
|
|
$(IOSSIM_TARGETS): IOSSIM_SYSROOT := $(shell xcrun --sdk iphonesimulator --show-sdk-path)
|
|
|
|
$(IOSSIM_TARGETS): CC = xcrun --sdk iphonesimulator clang -isysroot $(IOSSIM_SYSROOT) -arch x86_64
|
2023-10-17 18:25:31 -04:00
|
|
|
else ifeq ($(UNAME_S),Linux)
|
|
|
|
$(IOS_TARGETS): IOS_SYSROOT := deps/iPhoneOS17.0.sdk
|
|
|
|
$(IOS_TARGETS): CC = PATH=$$PATH:deps/ios_toolchain/target/bin deps/ios_toolchain/target/bin/arm-apple-darwin11-clang
|
2023-10-12 21:13:35 -04:00
|
|
|
endif
|
2023-03-13 23:17:01 -04:00
|
|
|
$(ANDROID_X86_64_TARGETS): ANDROID_NDK_TARGET_TRIPLE := x86_64-linux-android
|
2023-09-28 20:07:34 -04:00
|
|
|
$(ANDROID_X86_TARGETS): ANDROID_NDK_TARGET_TRIPLE := i686-linux-android
|
|
|
|
$(ANDROID_ARMV7A_TARGETS): ANDROID_NDK_TARGET_TRIPLE := armv7a-linux-androideabi
|
2023-03-13 23:17:01 -04:00
|
|
|
$(ANDROID_ARM64_TARGETS): ANDROID_NDK_TARGET_TRIPLE := aarch64-linux-android
|
2023-08-23 17:37:23 -04:00
|
|
|
$(ANDROID_TARGETS): CC = $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/$(ANDROID_NDK_TARGET_TRIPLE)$(ANDROID_MIN_SDK_VERSION)-clang
|
2023-03-06 22:02:16 -05:00
|
|
|
$(ANDROID_TARGETS): AS = $(CC)
|
|
|
|
$(ANDROID_TARGETS): CFLAGS += \
|
2023-08-23 17:37:23 -04:00
|
|
|
-target $(ANDROID_NDK_TARGET_TRIPLE)$(ANDROID_MIN_SDK_VERSION) \
|
2022-12-29 16:58:54 -05:00
|
|
|
-Wno-unknown-warning-option
|
2023-09-28 20:07:34 -04:00
|
|
|
$(ANDROID_ARMV7A_TARGETS): CFLAGS += -Ideps/openssl/android/armeabi-v7a/usr/local/include
|
|
|
|
$(ANDROID_ARMV7A_TARGETS): LDFLAGS += -Ldeps/openssl/android/armeabi-v7a/usr/local/lib
|
2023-03-13 23:17:01 -04:00
|
|
|
$(ANDROID_ARM64_TARGETS): CFLAGS += -Ideps/openssl/android/arm64-v8a/usr/local/include
|
|
|
|
$(ANDROID_ARM64_TARGETS): LDFLAGS += -Ldeps/openssl/android/arm64-v8a/usr/local/lib
|
2023-09-28 20:07:34 -04:00
|
|
|
$(ANDROID_X86_TARGETS): CFLAGS += -Ideps/openssl/android/x86/usr/local/include
|
|
|
|
$(ANDROID_X86_TARGETS): CFLAGS += -Wno-atomic-alignment
|
|
|
|
$(ANDROID_X86_TARGETS): LDFLAGS += -Ldeps/openssl/android/x86/usr/local/lib
|
2023-03-13 23:17:01 -04:00
|
|
|
$(ANDROID_X86_64_TARGETS): CFLAGS += -Ideps/openssl/android/x86_64/usr/local/include
|
|
|
|
$(ANDROID_X86_64_TARGETS): LDFLAGS += -Ldeps/openssl/android/x86_64/usr/local/lib
|
2023-10-04 19:38:42 -04:00
|
|
|
$(NONMACOS_TARGETS): CFLAGS += -Wno-cast-function-type
|
2024-06-30 13:32:17 -04:00
|
|
|
$(DEADSTRIP_TARGETS): LDFLAGS += -Wl,--gc-sections
|
2024-10-23 12:02:41 -04:00
|
|
|
$(IOS_TARGETS): CFLAGS += -miphoneos-version-min=9.0 -Ideps/openssl/ios/ios64-xcrun/usr/local/include
|
|
|
|
$(IOS_TARGETS): LDFLAGS += -miphoneos-version-min=9.0 -Ldeps/openssl/ios/ios64-xcrun/usr/local/lib
|
2023-10-13 21:56:40 -04:00
|
|
|
$(IOSSIM_TARGETS): CFLAGS += -Ideps/openssl/ios/iossimulator-xcrun/usr/local/include
|
|
|
|
$(IOSSIM_TARGETS): LDFLAGS += -Ldeps/openssl/ios/iossimulator-xcrun/usr/local/lib
|
2021-10-03 18:14:06 -04:00
|
|
|
|
2024-03-25 13:50:17 -04:00
|
|
|
ifeq ($(UNAME_M),x86_64)
|
2024-10-05 20:44:01 -04:00
|
|
|
ifeq ($(UNAME_S),Linux)
|
|
|
|
all: appimage
|
|
|
|
endif
|
2024-03-25 13:50:17 -04:00
|
|
|
ifneq ($(UNAME_S),Haiku)
|
|
|
|
out/debug/tildefriends: CFLAGS += -fsanitize=address -fsanitize=undefined -fno-common
|
|
|
|
out/debug/tildefriends: LDFLAGS += -fsanitize=address -fsanitize=undefined
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(UNAME_M),aarch64)
|
|
|
|
out/debug/tildefriends: CFLAGS += -fsanitize=address -fsanitize=undefined -fno-common
|
|
|
|
out/debug/tildefriends: LDFLAGS += -fsanitize=address -fsanitize=undefined
|
|
|
|
endif
|
|
|
|
|
2022-05-25 20:47:36 -04:00
|
|
|
get_objs = \
|
2023-10-18 10:24:44 -04:00
|
|
|
$(foreach build_type,$(BUILD_TYPES),$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)))))) \
|
2022-05-30 13:24:42 -04:00
|
|
|
$(foreach build_type,debug release,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_unix))))) \
|
2022-12-29 16:58:54 -05:00
|
|
|
$(foreach build_type,windebug winrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_win))))) \
|
2023-09-28 20:07:34 -04:00
|
|
|
$(foreach build_type,androiddebug androidrelease androiddebug-x86 androidrelease-x86 androiddebug-x86_64 androidrelease-x86_64 androiddebug-armv7a androiddebug-armv7a,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_android))))) \
|
|
|
|
$(foreach build_type,androiddebug androidrelease androiddebug-x86 androidrelease-x86 androiddebug-x86_64 androidrelease-x86_64 androiddebug-armv7a androidrelease-armv7a,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_unix))))) \
|
2023-10-13 21:56:40 -04:00
|
|
|
$(foreach build_type,macosdebug macosrelease iosdebug iosrelease iossimdebug iossimrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_macos))))) \
|
2023-10-13 22:11:20 -04:00
|
|
|
$(foreach build_type,iosdebug iosrelease iossimdebug iossimrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_ios))))) \
|
2023-09-28 20:07:34 -04:00
|
|
|
$(foreach build_type,androiddebug-x86 androidrelease-x86,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_x86)))))
|
2022-05-25 20:47:36 -04:00
|
|
|
|
|
|
|
APP_SOURCES := $(wildcard src/*.c)
|
2023-10-13 22:11:20 -04:00
|
|
|
APP_SOURCES_ios := $(wildcard src/*.m)
|
2022-05-25 20:47:36 -04:00
|
|
|
APP_OBJS := $(call get_objs,APP_SOURCES)
|
2021-01-02 13:10:00 -05:00
|
|
|
$(APP_OBJS): CFLAGS += \
|
|
|
|
-Ideps/base64c/include \
|
2024-08-07 20:21:39 -04:00
|
|
|
-Ideps/c-ares/include \
|
|
|
|
-Ideps/c-ares_config \
|
2021-01-02 13:10:00 -05:00
|
|
|
-Ideps/crypt_blowfish \
|
2022-09-24 17:10:23 -04:00
|
|
|
-Ideps/libbacktrace \
|
2022-03-07 22:42:47 -05:00
|
|
|
-Ideps/libsodium \
|
2022-05-16 18:30:14 -04:00
|
|
|
-Ideps/libsodium/src/libsodium/include \
|
2022-09-24 17:10:23 -04:00
|
|
|
-Ideps/libuv/include \
|
2023-03-08 18:59:11 -05:00
|
|
|
-Ideps/zlib \
|
|
|
|
-Ideps/zlib/contrib/minizip \
|
2022-12-31 11:47:10 -05:00
|
|
|
-Ideps/picohttpparser \
|
2022-09-24 17:10:23 -04:00
|
|
|
-Ideps/quickjs \
|
|
|
|
-Ideps/sqlite \
|
2022-07-09 10:50:27 -04:00
|
|
|
-Ideps/valgrind \
|
2023-04-29 23:00:57 -04:00
|
|
|
-Wdouble-promotion \
|
2021-01-03 20:58:50 -05:00
|
|
|
-Werror
|
2023-08-30 19:58:01 -04:00
|
|
|
ifeq ($(UNAME_M),x86_64)
|
2023-10-11 20:29:17 -04:00
|
|
|
$(filter-out $(BUILD_DIR)/android% $(BUILD_DIR)/macos% $(BUILD_DIR)/ios%,$(APP_OBJS)): CFLAGS += \
|
2024-01-07 16:08:37 -05:00
|
|
|
-fanalyzer
|
2023-08-30 19:58:01 -04:00
|
|
|
endif
|
2021-01-02 13:10:00 -05:00
|
|
|
|
2024-08-07 20:21:39 -04:00
|
|
|
ARES_SOURCES := \
|
2024-10-11 18:25:09 -04:00
|
|
|
deps/c-ares/src/lib/ares_addrinfo2hostent.c \
|
|
|
|
deps/c-ares/src/lib/ares_addrinfo_localhost.c \
|
|
|
|
deps/c-ares/src/lib/ares_android.c \
|
2024-08-07 20:21:39 -04:00
|
|
|
deps/c-ares/src/lib/ares_cancel.c \
|
2024-10-11 18:25:09 -04:00
|
|
|
deps/c-ares/src/lib/ares_close_sockets.c \
|
|
|
|
deps/c-ares/src/lib/ares_conn.c \
|
|
|
|
deps/c-ares/src/lib/ares_cookie.c \
|
|
|
|
deps/c-ares/src/lib/ares_data.c \
|
|
|
|
deps/c-ares/src/lib/ares_destroy.c \
|
|
|
|
deps/c-ares/src/lib/ares_free_hostent.c \
|
|
|
|
deps/c-ares/src/lib/ares_free_string.c \
|
|
|
|
deps/c-ares/src/lib/ares_freeaddrinfo.c \
|
|
|
|
deps/c-ares/src/lib/ares_getaddrinfo.c \
|
2024-08-07 20:21:39 -04:00
|
|
|
deps/c-ares/src/lib/ares_getenv.c \
|
2024-10-11 18:25:09 -04:00
|
|
|
deps/c-ares/src/lib/ares_gethostbyaddr.c \
|
2024-08-07 20:21:39 -04:00
|
|
|
deps/c-ares/src/lib/ares_gethostbyname.c \
|
2024-10-11 18:25:09 -04:00
|
|
|
deps/c-ares/src/lib/ares_getnameinfo.c \
|
|
|
|
deps/c-ares/src/lib/ares_hosts_file.c \
|
|
|
|
deps/c-ares/src/lib/ares_init.c \
|
|
|
|
deps/c-ares/src/lib/ares_library_init.c \
|
|
|
|
deps/c-ares/src/lib/ares_metrics.c \
|
|
|
|
deps/c-ares/src/lib/ares_options.c \
|
|
|
|
deps/c-ares/src/lib/ares_parse_into_addrinfo.c \
|
|
|
|
deps/c-ares/src/lib/ares_process.c \
|
|
|
|
deps/c-ares/src/lib/ares_qcache.c \
|
|
|
|
deps/c-ares/src/lib/ares_query.c \
|
|
|
|
deps/c-ares/src/lib/ares_search.c \
|
2024-08-07 20:21:39 -04:00
|
|
|
deps/c-ares/src/lib/ares_send.c \
|
2024-10-11 18:25:09 -04:00
|
|
|
deps/c-ares/src/lib/ares_set_socket_functions.c \
|
|
|
|
deps/c-ares/src/lib/ares_socket.c \
|
|
|
|
deps/c-ares/src/lib/ares_sortaddrinfo.c \
|
|
|
|
deps/c-ares/src/lib/ares_strerror.c \
|
|
|
|
deps/c-ares/src/lib/ares_sysconfig.c \
|
|
|
|
deps/c-ares/src/lib/ares_sysconfig_files.c \
|
|
|
|
deps/c-ares/src/lib/ares_sysconfig_mac.c \
|
|
|
|
deps/c-ares/src/lib/ares_sysconfig_win.c \
|
|
|
|
deps/c-ares/src/lib/ares_update_servers.c \
|
|
|
|
deps/c-ares/src/lib/ares_version.c \
|
|
|
|
deps/c-ares/src/lib/dsa/ares_array.c \
|
|
|
|
deps/c-ares/src/lib/dsa/ares_htable.c \
|
|
|
|
deps/c-ares/src/lib/dsa/ares_htable_asvp.c \
|
|
|
|
deps/c-ares/src/lib/dsa/ares_htable_dict.c \
|
|
|
|
deps/c-ares/src/lib/dsa/ares_htable_strvp.c \
|
|
|
|
deps/c-ares/src/lib/dsa/ares_htable_szvp.c \
|
|
|
|
deps/c-ares/src/lib/dsa/ares_htable_vpvp.c \
|
|
|
|
deps/c-ares/src/lib/dsa/ares_llist.c \
|
|
|
|
deps/c-ares/src/lib/dsa/ares_slist.c \
|
2024-08-07 20:21:39 -04:00
|
|
|
deps/c-ares/src/lib/event/ares_event_configchg.c \
|
|
|
|
deps/c-ares/src/lib/event/ares_event_epoll.c \
|
2024-10-11 18:25:09 -04:00
|
|
|
deps/c-ares/src/lib/event/ares_event_kqueue.c \
|
|
|
|
deps/c-ares/src/lib/event/ares_event_poll.c \
|
|
|
|
deps/c-ares/src/lib/event/ares_event_select.c \
|
|
|
|
deps/c-ares/src/lib/event/ares_event_thread.c \
|
2024-08-07 20:21:39 -04:00
|
|
|
deps/c-ares/src/lib/event/ares_event_wake_pipe.c \
|
|
|
|
deps/c-ares/src/lib/event/ares_event_win32.c \
|
2024-10-11 18:25:09 -04:00
|
|
|
deps/c-ares/src/lib/inet_net_pton.c \
|
|
|
|
deps/c-ares/src/lib/inet_ntop.c \
|
|
|
|
deps/c-ares/src/lib/legacy/ares_create_query.c \
|
|
|
|
deps/c-ares/src/lib/legacy/ares_expand_name.c \
|
|
|
|
deps/c-ares/src/lib/legacy/ares_expand_string.c \
|
|
|
|
deps/c-ares/src/lib/legacy/ares_fds.c \
|
|
|
|
deps/c-ares/src/lib/legacy/ares_getsock.c \
|
|
|
|
deps/c-ares/src/lib/legacy/ares_parse_a_reply.c \
|
|
|
|
deps/c-ares/src/lib/legacy/ares_parse_aaaa_reply.c \
|
|
|
|
deps/c-ares/src/lib/legacy/ares_parse_caa_reply.c \
|
|
|
|
deps/c-ares/src/lib/legacy/ares_parse_mx_reply.c \
|
|
|
|
deps/c-ares/src/lib/legacy/ares_parse_naptr_reply.c \
|
|
|
|
deps/c-ares/src/lib/legacy/ares_parse_ns_reply.c \
|
|
|
|
deps/c-ares/src/lib/legacy/ares_parse_ptr_reply.c \
|
|
|
|
deps/c-ares/src/lib/legacy/ares_parse_soa_reply.c \
|
|
|
|
deps/c-ares/src/lib/legacy/ares_parse_srv_reply.c \
|
|
|
|
deps/c-ares/src/lib/legacy/ares_parse_txt_reply.c \
|
|
|
|
deps/c-ares/src/lib/legacy/ares_parse_uri_reply.c \
|
|
|
|
deps/c-ares/src/lib/record/ares_dns_mapping.c \
|
|
|
|
deps/c-ares/src/lib/record/ares_dns_multistring.c \
|
|
|
|
deps/c-ares/src/lib/record/ares_dns_name.c \
|
|
|
|
deps/c-ares/src/lib/record/ares_dns_parse.c \
|
|
|
|
deps/c-ares/src/lib/record/ares_dns_record.c \
|
|
|
|
deps/c-ares/src/lib/record/ares_dns_write.c \
|
|
|
|
deps/c-ares/src/lib/str/ares_buf.c \
|
2024-08-07 20:21:39 -04:00
|
|
|
deps/c-ares/src/lib/str/ares_str.c \
|
2024-10-11 18:25:09 -04:00
|
|
|
deps/c-ares/src/lib/str/ares_strsplit.c \
|
|
|
|
deps/c-ares/src/lib/util/ares_iface_ips.c \
|
2024-08-07 20:21:39 -04:00
|
|
|
deps/c-ares/src/lib/util/ares_math.c \
|
|
|
|
deps/c-ares/src/lib/util/ares_rand.c \
|
2024-10-11 18:25:09 -04:00
|
|
|
deps/c-ares/src/lib/util/ares_threads.c \
|
|
|
|
deps/c-ares/src/lib/util/ares_timeval.c \
|
|
|
|
deps/c-ares/src/lib/util/ares_uri.c \
|
|
|
|
deps/c-ares/src/lib/windows_port.c \
|
2024-08-07 20:21:39 -04:00
|
|
|
deps/c-ares/src/lib/ares_timeout.c
|
|
|
|
ARES_OBJS := $(call get_objs,ARES_SOURCES)
|
|
|
|
$(ARES_OBJS): CFLAGS += \
|
|
|
|
-Ideps/c-ares/include \
|
|
|
|
-Ideps/c-ares/src/lib \
|
2024-10-11 18:25:09 -04:00
|
|
|
-Ideps/c-ares/src/lib/include \
|
2024-08-07 20:21:39 -04:00
|
|
|
-Ideps/c-ares_config/ \
|
|
|
|
-D_GNU_SOURCE \
|
|
|
|
-Wno-unused-function \
|
|
|
|
-Wno-deprecated-declarations \
|
|
|
|
-Wno-unused-result
|
|
|
|
|
2022-05-25 20:47:36 -04:00
|
|
|
BLOWFISH_SOURCES := \
|
2021-01-02 13:10:00 -05:00
|
|
|
deps/crypt_blowfish/crypt_blowfish.c \
|
|
|
|
deps/crypt_blowfish/crypt_gensalt.c \
|
|
|
|
deps/crypt_blowfish/wrapper.c
|
2023-09-28 20:07:34 -04:00
|
|
|
BLOWFISH_SOURCES_win := \
|
|
|
|
deps/crypt_blowfish/x86.S
|
|
|
|
BLOWFISH_SOURCES_x86 := \
|
2022-05-16 18:30:14 -04:00
|
|
|
deps/crypt_blowfish/x86.S
|
2022-05-25 20:47:36 -04:00
|
|
|
BLOWFISH_OBJS := $(call get_objs,BLOWFISH_SOURCES)
|
2021-01-02 13:10:00 -05:00
|
|
|
|
2022-05-25 20:47:36 -04:00
|
|
|
UV_SOURCES := \
|
2021-01-02 13:10:00 -05:00
|
|
|
deps/libuv/src/fs-poll.c \
|
|
|
|
deps/libuv/src/idna.c \
|
|
|
|
deps/libuv/src/inet.c \
|
|
|
|
deps/libuv/src/random.c \
|
|
|
|
deps/libuv/src/strscpy.c \
|
2022-09-21 20:38:26 -04:00
|
|
|
deps/libuv/src/strtok.c \
|
2021-01-02 13:10:00 -05:00
|
|
|
deps/libuv/src/threadpool.c \
|
|
|
|
deps/libuv/src/timer.c \
|
2022-05-16 18:30:14 -04:00
|
|
|
deps/libuv/src/uv-common.c \
|
|
|
|
deps/libuv/src/uv-data-getter-setters.c \
|
|
|
|
deps/libuv/src/version.c
|
2022-05-25 20:47:36 -04:00
|
|
|
UV_SOURCES_unix := \
|
2021-01-02 13:10:00 -05:00
|
|
|
deps/libuv/src/unix/async.c \
|
|
|
|
deps/libuv/src/unix/core.c \
|
|
|
|
deps/libuv/src/unix/dl.c \
|
|
|
|
deps/libuv/src/unix/fs.c \
|
|
|
|
deps/libuv/src/unix/getaddrinfo.c \
|
|
|
|
deps/libuv/src/unix/getnameinfo.c \
|
|
|
|
deps/libuv/src/unix/loop-watcher.c \
|
|
|
|
deps/libuv/src/unix/loop.c \
|
|
|
|
deps/libuv/src/unix/pipe.c \
|
|
|
|
deps/libuv/src/unix/poll.c \
|
|
|
|
deps/libuv/src/unix/process.c \
|
|
|
|
deps/libuv/src/unix/random-devurandom.c \
|
|
|
|
deps/libuv/src/unix/random-getrandom.c \
|
|
|
|
deps/libuv/src/unix/signal.c \
|
|
|
|
deps/libuv/src/unix/stream.c \
|
|
|
|
deps/libuv/src/unix/tcp.c \
|
|
|
|
deps/libuv/src/unix/thread.c \
|
|
|
|
deps/libuv/src/unix/tty.c \
|
2022-05-16 18:30:14 -04:00
|
|
|
deps/libuv/src/unix/udp.c
|
2023-10-25 22:56:33 -04:00
|
|
|
ifeq ($(UNAME_S),Linux)
|
|
|
|
UV_SOURCES_unix += \
|
|
|
|
deps/libuv/src/unix/linux.c \
|
|
|
|
deps/libuv/src/unix/procfs-exepath.c \
|
|
|
|
deps/libuv/src/unix/proctitle.c \
|
|
|
|
deps/libuv/src/unix/random-sysctl-linux.c
|
|
|
|
else ifeq ($(UNAME_S),Haiku)
|
|
|
|
UV_SOURCES_unix += \
|
|
|
|
deps/libuv/src/unix/bsd-ifaddrs.c \
|
|
|
|
deps/libuv/src/unix/haiku.c \
|
|
|
|
deps/libuv/src/unix/no-fsevents.c \
|
|
|
|
deps/libuv/src/unix/no-proctitle.c \
|
|
|
|
deps/libuv/src/unix/posix-hrtime.c \
|
|
|
|
deps/libuv/src/unix/posix-poll.c
|
2023-11-07 22:36:08 -05:00
|
|
|
else ifeq ($(UNAME_S),OpenBSD)
|
|
|
|
UV_SOURCES_unix += \
|
|
|
|
deps/libuv/src/unix/bsd-ifaddrs.c \
|
|
|
|
deps/libuv/src/unix/kqueue.c \
|
|
|
|
deps/libuv/src/unix/no-proctitle.c \
|
|
|
|
deps/libuv/src/unix/openbsd.c \
|
|
|
|
deps/libuv/src/unix/posix-hrtime.c \
|
|
|
|
deps/libuv/src/unix/random-getentropy.c
|
2023-10-25 22:56:33 -04:00
|
|
|
endif
|
2022-12-29 16:58:54 -05:00
|
|
|
UV_SOURCES_android := \
|
|
|
|
deps/libuv/src/unix/random-getentropy.c
|
2022-05-25 20:47:36 -04:00
|
|
|
UV_SOURCES_win := \
|
2022-05-16 18:30:14 -04:00
|
|
|
deps/libuv/src/win/async.c \
|
|
|
|
deps/libuv/src/win/core.c \
|
|
|
|
deps/libuv/src/win/detect-wakeup.c \
|
|
|
|
deps/libuv/src/win/dl.c \
|
|
|
|
deps/libuv/src/win/error.c \
|
|
|
|
deps/libuv/src/win/fs-event.c \
|
|
|
|
deps/libuv/src/win/fs.c \
|
|
|
|
deps/libuv/src/win/getaddrinfo.c \
|
|
|
|
deps/libuv/src/win/getnameinfo.c \
|
|
|
|
deps/libuv/src/win/handle.c \
|
|
|
|
deps/libuv/src/win/loop-watcher.c \
|
|
|
|
deps/libuv/src/win/pipe.c \
|
|
|
|
deps/libuv/src/win/poll.c \
|
|
|
|
deps/libuv/src/win/process-stdio.c \
|
|
|
|
deps/libuv/src/win/process.c \
|
|
|
|
deps/libuv/src/win/signal.c \
|
|
|
|
deps/libuv/src/win/snprintf.c \
|
|
|
|
deps/libuv/src/win/stream.c \
|
|
|
|
deps/libuv/src/win/tcp.c \
|
|
|
|
deps/libuv/src/win/thread.c \
|
|
|
|
deps/libuv/src/win/tty.c \
|
|
|
|
deps/libuv/src/win/udp.c \
|
|
|
|
deps/libuv/src/win/util.c \
|
|
|
|
deps/libuv/src/win/winapi.c \
|
|
|
|
deps/libuv/src/win/winsock.c
|
2023-10-04 19:20:57 -04:00
|
|
|
UV_SOURCES_macos := \
|
|
|
|
deps/libuv/src/unix/async.c \
|
|
|
|
deps/libuv/src/unix/bsd-ifaddrs.c \
|
|
|
|
deps/libuv/src/unix/core.c \
|
|
|
|
deps/libuv/src/unix/darwin.c \
|
|
|
|
deps/libuv/src/unix/darwin-proctitle.c \
|
|
|
|
deps/libuv/src/unix/dl.c \
|
|
|
|
deps/libuv/src/unix/fs.c \
|
|
|
|
deps/libuv/src/unix/fsevents.c \
|
|
|
|
deps/libuv/src/unix/getaddrinfo.c \
|
|
|
|
deps/libuv/src/unix/getnameinfo.c \
|
|
|
|
deps/libuv/src/unix/kqueue.c \
|
|
|
|
deps/libuv/src/unix/loop-watcher.c \
|
|
|
|
deps/libuv/src/unix/loop.c \
|
|
|
|
deps/libuv/src/unix/pipe.c \
|
|
|
|
deps/libuv/src/unix/poll.c \
|
|
|
|
deps/libuv/src/unix/process.c \
|
|
|
|
deps/libuv/src/unix/proctitle.c \
|
|
|
|
deps/libuv/src/unix/random-devurandom.c \
|
|
|
|
deps/libuv/src/unix/random-getentropy.c \
|
|
|
|
deps/libuv/src/unix/signal.c \
|
|
|
|
deps/libuv/src/unix/stream.c \
|
|
|
|
deps/libuv/src/unix/tcp.c \
|
|
|
|
deps/libuv/src/unix/thread.c \
|
|
|
|
deps/libuv/src/unix/tty.c \
|
|
|
|
deps/libuv/src/unix/udp.c
|
2022-05-25 20:47:36 -04:00
|
|
|
UV_OBJS := $(call get_objs,UV_SOURCES)
|
2021-01-02 13:10:00 -05:00
|
|
|
$(UV_OBJS): CFLAGS += \
|
|
|
|
-Ideps/libuv/include \
|
|
|
|
-Ideps/libuv/src \
|
2023-05-21 17:36:51 -04:00
|
|
|
-Wno-dangling-pointer \
|
2021-01-02 13:10:00 -05:00
|
|
|
-Wno-incompatible-pointer-types \
|
2023-05-21 17:36:51 -04:00
|
|
|
-Wno-maybe-uninitialized \
|
2021-01-02 13:10:00 -05:00
|
|
|
-Wno-sign-compare \
|
2024-10-13 14:46:24 -04:00
|
|
|
-Wno-unknown-attributes \
|
2023-11-07 12:30:39 -05:00
|
|
|
-Wno-unused-but-set-parameter \
|
2023-05-21 17:36:51 -04:00
|
|
|
-Wno-unused-but-set-variable \
|
|
|
|
-Wno-unused-result \
|
2024-09-30 12:37:41 -04:00
|
|
|
-Wno-unused-variable \
|
|
|
|
-Wno-nonnull
|
2024-08-25 12:45:42 -04:00
|
|
|
$(UV_OBJS): CFLAGS += -fno-lto
|
2024-09-25 12:11:17 -04:00
|
|
|
$(filter out/win%,$(UV_OBJS)): \
|
|
|
|
CFLAGS += \
|
|
|
|
-Wno-cast-function-type \
|
|
|
|
-Wno-missing-braces
|
2023-10-25 22:56:33 -04:00
|
|
|
ifeq ($(UNAME_S),Linux)
|
|
|
|
$(UV_OBJS): CFLAGS += \
|
2022-09-24 17:13:14 -04:00
|
|
|
-D_GNU_SOURCE
|
2023-10-25 22:56:33 -04:00
|
|
|
else ifeq ($(UNAME_S),Haiku)
|
|
|
|
$(UV_OBJS): CFLAGS += \
|
|
|
|
-D_BSD_SOURCE \
|
|
|
|
-Wno-format-truncation
|
|
|
|
endif
|
2021-01-02 13:10:00 -05:00
|
|
|
|
2022-05-25 20:47:36 -04:00
|
|
|
SODIUM_SOURCES := \
|
2023-10-04 20:39:57 -04:00
|
|
|
deps/libsodium/src/libsodium/crypto_aead/aegis128l/aead_aegis128l.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_aead/aegis128l/aegis128l_soft.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_aead/aegis256/aead_aegis256.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_aead/aegis256/aegis256_soft.c \
|
2022-03-07 22:42:47 -05:00
|
|
|
deps/libsodium/src/libsodium/crypto_auth/hmacsha512/auth_hmacsha512.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_auth/hmacsha512256/auth_hmacsha512256.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_box/crypto_box.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_core/salsa/ref/core_salsa_ref.c \
|
2023-10-04 20:39:57 -04:00
|
|
|
deps/libsodium/src/libsodium/crypto_core/softaes/softaes.c \
|
2022-05-30 13:24:42 -04:00
|
|
|
deps/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ref.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c \
|
2022-05-16 18:30:14 -04:00
|
|
|
deps/libsodium/src/libsodium/crypto_generichash/blake2b/ref/generichash_blake2b.c \
|
2022-03-07 22:42:47 -05:00
|
|
|
deps/libsodium/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_hash/sha256/hash_sha256.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c \
|
2022-05-16 18:30:14 -04:00
|
|
|
deps/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_pwhash/argon2/blake2b-long.c \
|
2022-03-07 22:42:47 -05:00
|
|
|
deps/libsodium/src/libsodium/crypto_scalarmult/crypto_scalarmult.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c \
|
2023-10-04 20:52:59 -04:00
|
|
|
deps/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c \
|
2022-03-07 22:42:47 -05:00
|
|
|
deps/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c \
|
2022-05-30 13:24:42 -04:00
|
|
|
deps/libsodium/src/libsodium/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305.c \
|
2022-03-07 22:42:47 -05:00
|
|
|
deps/libsodium/src/libsodium/crypto_sign/crypto_sign.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_sign/ed25519/ref10/keypair.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_sign/ed25519/ref10/open.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_sign/ed25519/ref10/sign.c \
|
2022-05-30 13:24:42 -04:00
|
|
|
deps/libsodium/src/libsodium/crypto_sign/ed25519/sign_ed25519.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.c \
|
2022-03-07 22:42:47 -05:00
|
|
|
deps/libsodium/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_stream/salsa20/stream_salsa20.c \
|
|
|
|
deps/libsodium/src/libsodium/crypto_stream/xsalsa20/stream_xsalsa20.c \
|
2023-10-04 20:32:37 -04:00
|
|
|
deps/libsodium/src/libsodium/crypto_verify/verify.c \
|
2022-03-07 22:42:47 -05:00
|
|
|
deps/libsodium/src/libsodium/randombytes/randombytes.c \
|
|
|
|
deps/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c \
|
|
|
|
deps/libsodium/src/libsodium/sodium/core.c \
|
2023-02-13 22:15:24 -05:00
|
|
|
deps/libsodium/src/libsodium/sodium/codecs.c \
|
2022-05-16 18:30:14 -04:00
|
|
|
deps/libsodium/src/libsodium/sodium/runtime.c \
|
2023-07-04 21:06:59 -04:00
|
|
|
deps/libsodium/src/libsodium/sodium/utils.c \
|
|
|
|
deps/libsodium/src/libsodium/sodium/version.c
|
2022-05-25 20:47:36 -04:00
|
|
|
SODIUM_OBJS := $(call get_objs,SODIUM_SOURCES)
|
2022-03-07 22:42:47 -05:00
|
|
|
$(SODIUM_OBJS): CFLAGS += \
|
|
|
|
-DCONFIGURED=1 \
|
|
|
|
-DMINIMAL=1 \
|
2023-10-04 20:52:59 -04:00
|
|
|
-DHAVE_ALLOCA \
|
|
|
|
-DHAVE_CPUID_V \
|
|
|
|
-DHAVE_GCC_MEMORY_FENCES \
|
2022-03-07 22:42:47 -05:00
|
|
|
-Wno-unused-function \
|
|
|
|
-Wno-unused-variable \
|
2022-06-04 13:22:55 -04:00
|
|
|
-Wno-type-limits \
|
|
|
|
-Wno-unknown-pragmas \
|
2023-10-04 20:39:57 -04:00
|
|
|
-Wno-attributes \
|
2023-07-04 21:06:59 -04:00
|
|
|
-Ideps/libsodium/builds/msvc \
|
2022-03-07 22:42:47 -05:00
|
|
|
-Ideps/libsodium/src/libsodium/include/sodium
|
2023-12-10 18:16:00 -05:00
|
|
|
ifneq ($(UNAME_S),OpenBSD)
|
2023-12-10 18:07:05 -05:00
|
|
|
$(filter-out $(BUILD_DIR)/win%,$(SODIUM_OBJS)): CFLAGS += \
|
2023-10-04 20:52:59 -04:00
|
|
|
-DHAVE_ALLOCA_H
|
2023-12-10 18:16:00 -05:00
|
|
|
endif
|
2022-03-07 22:42:47 -05:00
|
|
|
|
2022-05-25 20:47:36 -04:00
|
|
|
SQLITE_SOURCES := deps/sqlite/sqlite3.c
|
|
|
|
SQLITE_OBJS := $(call get_objs,SQLITE_SOURCES)
|
2021-01-02 13:10:00 -05:00
|
|
|
$(SQLITE_OBJS): CFLAGS += \
|
|
|
|
-DSQLITE_DBCONFIG_DEFAULT_DEFENSIVE \
|
2023-03-19 16:25:50 -04:00
|
|
|
-DSQLITE_DEFAULT_MEMSTATUS=0 \
|
|
|
|
-DSQLITE_DQS=0 \
|
2023-03-19 20:29:46 -04:00
|
|
|
-DSQLITE_ENABLE_MEMSYS5 \
|
2022-09-10 13:56:54 -04:00
|
|
|
-DSQLITE_ENABLE_FTS5 \
|
2021-01-02 13:10:00 -05:00
|
|
|
-DSQLITE_ENABLE_JSON1 \
|
2023-03-19 20:29:46 -04:00
|
|
|
-DSQLITE_LIKE_DOESNT_MATCH_BLOBS \
|
2023-07-27 08:22:37 -04:00
|
|
|
-DSQLITE_MAX_ATTACHED=1 \
|
2021-01-02 13:10:00 -05:00
|
|
|
-DSQLITE_MAX_COLUMN=100 \
|
2022-10-21 19:30:22 -04:00
|
|
|
-DSQLITE_MAX_COMPOUND_SELECT=300 \
|
2023-03-19 16:25:50 -04:00
|
|
|
-DSQLITE_MAX_EXPR_DEPTH=40 \
|
2021-01-02 13:10:00 -05:00
|
|
|
-DSQLITE_MAX_FUNCTION_ARG=8 \
|
2023-03-19 16:25:50 -04:00
|
|
|
-DSQLITE_MAX_LENGTH=5242880 \
|
2021-01-02 13:10:00 -05:00
|
|
|
-DSQLITE_MAX_LIKE_PATTERN_LENGTH=50 \
|
2023-03-19 16:25:50 -04:00
|
|
|
-DSQLITE_MAX_SQL_LENGTH=100000 \
|
2021-01-02 13:10:00 -05:00
|
|
|
-DSQLITE_MAX_TRIGGER_DEPTH=10 \
|
2023-03-19 16:25:50 -04:00
|
|
|
-DSQLITE_MAX_VARIABLE_NUMBER=100 \
|
|
|
|
-DSQLITE_MAX_VDBE_OP=25000 \
|
|
|
|
-DSQLITE_OMIT_DEPRECATED \
|
|
|
|
-DSQLITE_OMIT_DESERIALIZE \
|
|
|
|
-DSQLITE_OMIT_LOAD_EXTENSION \
|
|
|
|
-DSQLITE_OMIT_TCL_VARIABLE \
|
2023-03-19 20:29:46 -04:00
|
|
|
-DSQLITE_PRAGMA_DEFAULT_WAL_SYNCHRONOUS=1 \
|
2021-01-02 14:27:41 -05:00
|
|
|
-DSQLITE_SECURE_DELETE \
|
2023-10-23 21:34:59 -04:00
|
|
|
-DSQLITE_THREADSAFE=2 \
|
2023-03-19 16:25:50 -04:00
|
|
|
-DSQLITE_UNTESTABLE \
|
|
|
|
-DSQLITE_USE_ALLOCA \
|
|
|
|
-DHAVE_ISNAN \
|
2023-10-18 10:46:58 -04:00
|
|
|
-DHAVE_GETHOSTUUID=0 \
|
2022-06-04 13:22:55 -04:00
|
|
|
-Wno-implicit-fallthrough \
|
2022-12-30 09:22:04 -05:00
|
|
|
-Wno-unused-but-set-variable \
|
2023-03-19 16:25:50 -04:00
|
|
|
-Wno-unused-function \
|
|
|
|
-Wno-unused-variable
|
2021-01-02 13:10:00 -05:00
|
|
|
|
2022-05-25 20:47:36 -04:00
|
|
|
QUICKJS_SOURCES := \
|
2021-01-02 13:10:00 -05:00
|
|
|
deps/quickjs/cutils.c \
|
|
|
|
deps/quickjs/libbf.c \
|
|
|
|
deps/quickjs/libregexp.c \
|
|
|
|
deps/quickjs/libunicode.c \
|
|
|
|
deps/quickjs/quickjs.c
|
2022-05-25 20:47:36 -04:00
|
|
|
QUICKJS_OBJS := $(call get_objs,QUICKJS_SOURCES)
|
2021-01-02 13:10:00 -05:00
|
|
|
$(QUICKJS_OBJS): CFLAGS += \
|
|
|
|
-DCONFIG_VERSION=\"$(shell cat deps/quickjs/VERSION)\" \
|
2022-12-11 09:36:14 -05:00
|
|
|
-DCONFIG_BIGNUM \
|
2021-01-02 13:10:00 -05:00
|
|
|
-D_GNU_SOURCE \
|
2023-03-19 16:25:50 -04:00
|
|
|
-Wno-enum-conversion \
|
|
|
|
-Wno-implicit-const-int-float-conversion \
|
2021-01-02 13:10:00 -05:00
|
|
|
-Wno-implicit-fallthrough \
|
2023-03-19 16:25:50 -04:00
|
|
|
-Wno-sign-compare \
|
2021-10-03 18:14:06 -04:00
|
|
|
-Wno-unused-but-set-variable \
|
2023-03-19 16:25:50 -04:00
|
|
|
-Wno-unused-variable
|
|
|
|
$(NONANDROID_TARGETS): CFLAGS += -DDUMP_LEAKS
|
2021-01-02 13:10:00 -05:00
|
|
|
|
2024-01-13 08:19:08 -05:00
|
|
|
ifeq ($(UNAME_S),Haiku)
|
|
|
|
$(QUICKJS_OBJS): CFLAGS += "-Dmalloc_usable_size(x)=0"
|
|
|
|
else ifeq ($(UNAME_S),OpenBSD)
|
|
|
|
$(QUICKJS_OBJS): CFLAGS += "-Dmalloc_usable_size(x)=0"
|
|
|
|
endif
|
|
|
|
|
2022-09-24 16:54:54 -04:00
|
|
|
LIBBACKTRACE_SOURCES := \
|
|
|
|
deps/libbacktrace/atomic.c \
|
|
|
|
deps/libbacktrace/backtrace.c \
|
|
|
|
deps/libbacktrace/dwarf.c \
|
|
|
|
deps/libbacktrace/fileline.c \
|
|
|
|
deps/libbacktrace/print.c \
|
|
|
|
deps/libbacktrace/simple.c \
|
|
|
|
deps/libbacktrace/sort.c \
|
|
|
|
deps/libbacktrace/state.c
|
2022-09-24 17:10:23 -04:00
|
|
|
LIBBACKTRACE_SOURCES_unix := \
|
|
|
|
deps/libbacktrace/elf.c \
|
|
|
|
deps/libbacktrace/mmap.c \
|
|
|
|
deps/libbacktrace/mmapio.c \
|
|
|
|
deps/libbacktrace/posix.c
|
|
|
|
LIBBACKTRACE_SOURCES_win := \
|
|
|
|
deps/libbacktrace/alloc.c \
|
|
|
|
deps/libbacktrace/pecoff.c \
|
|
|
|
deps/libbacktrace/posix.c \
|
|
|
|
deps/libbacktrace/read.c
|
2023-10-04 19:20:57 -04:00
|
|
|
LIBBACKTRACE_SOURCES_macos := \
|
|
|
|
deps/libbacktrace/dwarf.c \
|
|
|
|
deps/libbacktrace/macho.c \
|
|
|
|
deps/libbacktrace/mmap.c \
|
|
|
|
deps/libbacktrace/mmapio.c \
|
|
|
|
deps/libbacktrace/posix.c
|
2022-09-24 16:54:54 -04:00
|
|
|
LIBBACKTRACE_OBJS := $(call get_objs,LIBBACKTRACE_SOURCES)
|
|
|
|
$(LIBBACKTRACE_OBJS): CFLAGS += \
|
|
|
|
-Ideps/libbacktrace_config \
|
|
|
|
-Wno-unused-but-set-variable \
|
|
|
|
-Wno-maybe-initialized \
|
|
|
|
-Wno-unused-function \
|
|
|
|
-DBACKTRACE_ELF_SIZE=64
|
|
|
|
|
2022-12-31 11:47:10 -05:00
|
|
|
PICOHTTPPARSER_SOURCES := \
|
|
|
|
deps/picohttpparser/picohttpparser.c
|
|
|
|
PICOHTTPPARSER_OBJS := $(call get_objs,PICOHTTPPARSER_SOURCES)
|
2023-03-08 18:59:11 -05:00
|
|
|
|
|
|
|
MINIUNZIP_SOURCES := \
|
|
|
|
deps/zlib/contrib/minizip/unzip.c \
|
|
|
|
deps/zlib/contrib/minizip/ioapi.c \
|
|
|
|
deps/zlib/adler32.c \
|
|
|
|
deps/zlib/crc32.c \
|
|
|
|
deps/zlib/inffast.c \
|
|
|
|
deps/zlib/inflate.c \
|
|
|
|
deps/zlib/inftrees.c \
|
|
|
|
deps/zlib/zutil.c
|
|
|
|
MINIUNZIP_OBJS := $(call get_objs,MINIUNZIP_SOURCES)
|
|
|
|
$(MINIUNZIP_OBJS): CFLAGS += \
|
|
|
|
-Ideps/zlib \
|
|
|
|
-Wno-maybe-uninitialized
|
2022-12-31 11:47:10 -05:00
|
|
|
|
2021-10-03 18:14:06 -04:00
|
|
|
LDFLAGS += \
|
2021-01-02 13:10:00 -05:00
|
|
|
-pthread \
|
2022-05-16 18:30:14 -04:00
|
|
|
-lm
|
2024-03-25 13:50:17 -04:00
|
|
|
$(LINUX_TARGETS) $(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS): LDFLAGS += \
|
2022-05-16 18:30:14 -04:00
|
|
|
-lssl \
|
|
|
|
-lcrypto
|
2023-10-25 22:56:33 -04:00
|
|
|
ifneq ($(UNAME_S),Haiku)
|
2023-11-07 22:36:08 -05:00
|
|
|
ifneq ($(UNAME_S),OpenBSD)
|
2023-10-25 22:56:33 -04:00
|
|
|
debug release $(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS): LDFLAGS += \
|
|
|
|
-ldl
|
|
|
|
endif
|
2023-11-07 22:36:08 -05:00
|
|
|
endif
|
2023-10-19 20:13:00 -04:00
|
|
|
$(WINDOWS_TARGETS): LDFLAGS += \
|
2022-12-29 18:55:49 -05:00
|
|
|
-lssl \
|
|
|
|
-lcrypto \
|
2023-05-21 17:36:51 -04:00
|
|
|
-lcrypt32 \
|
|
|
|
-ldbghelp \
|
|
|
|
-liphlpapi \
|
|
|
|
-lkernel32 \
|
|
|
|
-lole32 \
|
|
|
|
-luserenv \
|
|
|
|
-luuid \
|
2022-12-29 18:55:49 -05:00
|
|
|
-lws2_32 \
|
2023-05-21 17:36:51 -04:00
|
|
|
-lwsock32
|
2023-03-06 22:02:16 -05:00
|
|
|
$(ANDROID_TARGETS): LDFLAGS += \
|
2023-08-23 17:37:23 -04:00
|
|
|
-target $(ANDROID_NDK_TARGET_TRIPLE)$(ANDROID_MIN_SDK_VERSION) \
|
2022-12-29 16:58:54 -05:00
|
|
|
-ldl \
|
2023-03-13 23:17:01 -04:00
|
|
|
-llog \
|
2022-12-29 16:58:54 -05:00
|
|
|
-lssl \
|
2023-03-13 23:17:01 -04:00
|
|
|
-lcrypto
|
2023-10-19 08:41:43 -04:00
|
|
|
$(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS): CFLAGS += \
|
2023-10-18 10:46:58 -04:00
|
|
|
-Wno-unknown-warning-option
|
2023-10-13 22:11:20 -04:00
|
|
|
$(IOS_TARGETS) $(IOSSIM_TARGETS): LDFLAGS += \
|
|
|
|
-framework Foundation \
|
|
|
|
-framework CoreFoundation \
|
|
|
|
-framework UIKit \
|
|
|
|
-framework WebKit
|
2021-01-02 13:10:00 -05:00
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
##
|
|
|
|
## Common targets:
|
|
|
|
##
|
|
|
|
debug: ## Build a debug executable for the current platform.
|
|
|
|
release: ## Build a release executable for the current platform.
|
|
|
|
all: $(BUILD_TYPES) ## Build all targets that appear possible to build on this machine.
|
|
|
|
unix: debug release ## Build all UNIX targets.
|
|
|
|
win: windebug winrelease ## Build all Windows targets.
|
2022-05-30 13:24:42 -04:00
|
|
|
.PHONY: all win unix
|
2021-10-03 18:14:06 -04:00
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
##
|
|
|
|
## Windows targets:
|
|
|
|
##
|
|
|
|
windebug: ## Build a debug win32 executable.
|
|
|
|
winrelease: ## Build a release win32 executable.
|
|
|
|
|
|
|
|
##
|
|
|
|
## MacOS targets:
|
|
|
|
##
|
|
|
|
macosdebug: ## Build a MacOS debug executable.
|
|
|
|
macosrelease: ## Build a MacOS release executable.
|
|
|
|
|
2022-05-25 20:47:36 -04:00
|
|
|
ALL_APP_OBJS := \
|
|
|
|
$(APP_OBJS) \
|
2024-08-07 20:21:39 -04:00
|
|
|
$(ARES_OBJS) \
|
2022-05-25 20:47:36 -04:00
|
|
|
$(BLOWFISH_OBJS) \
|
2022-09-24 16:54:54 -04:00
|
|
|
$(LIBBACKTRACE_OBJS) \
|
2023-03-08 18:59:11 -05:00
|
|
|
$(MINIUNZIP_OBJS) \
|
2022-12-31 11:47:10 -05:00
|
|
|
$(PICOHTTPPARSER_OBJS) \
|
2022-05-25 20:47:36 -04:00
|
|
|
$(QUICKJS_OBJS) \
|
|
|
|
$(SODIUM_OBJS) \
|
|
|
|
$(SQLITE_OBJS) \
|
2024-02-25 14:45:31 -05:00
|
|
|
$(UV_OBJS)
|
2021-01-02 13:10:00 -05:00
|
|
|
|
|
|
|
DEPS = $(ALL_APP_OBJS:.o=.d)
|
|
|
|
-include $(DEPS)
|
|
|
|
|
2022-05-30 13:24:42 -04:00
|
|
|
define build_rules
|
2023-03-10 22:47:01 -05:00
|
|
|
$(1): $(BUILD_DIR)/$(1)/$(PROJECT)$(if $(filter win%,$(1)),.exe)
|
2022-05-30 13:24:42 -04:00
|
|
|
.PHONY: $(1)
|
2021-01-02 13:10:00 -05:00
|
|
|
|
2023-03-09 21:02:24 -05:00
|
|
|
$(BUILD_DIR)/$(1)/$(PROJECT)$(if $(filter win%,$(1)),.exe): $(filter $(BUILD_DIR)/$(1)/%,$(ALL_APP_OBJS))
|
2024-02-07 19:17:30 -05:00
|
|
|
@echo "[link] $$@"
|
2023-10-19 20:13:00 -04:00
|
|
|
@$$(CC) -o $$@ $$^ $$(LDFLAGS)
|
2022-05-25 20:47:36 -04:00
|
|
|
|
2022-05-30 13:24:42 -04:00
|
|
|
$(BUILD_DIR)/$(1)/%.o: %.c
|
|
|
|
@mkdir -p $$(dir $$@)
|
2024-02-07 19:17:30 -05:00
|
|
|
@echo "[c] $$@"
|
2022-05-30 13:24:42 -04:00
|
|
|
@$$(CC) $$(CFLAGS) -c $$< -o $$@
|
2022-05-25 20:47:36 -04:00
|
|
|
|
2023-10-13 22:11:20 -04:00
|
|
|
$(BUILD_DIR)/$(1)/%.o: %.m
|
|
|
|
@mkdir -p $$(dir $$@)
|
2024-02-07 19:17:30 -05:00
|
|
|
@echo "[m] $$@"
|
2023-10-13 22:11:20 -04:00
|
|
|
@$$(CC) $$(CFLAGS) -c $$< -o $$@
|
|
|
|
|
2022-05-30 13:24:42 -04:00
|
|
|
$(BUILD_DIR)/$(1)/%.o: %.S
|
|
|
|
@mkdir -p $$(dir $$@)
|
2024-02-07 19:17:30 -05:00
|
|
|
@echo "[as] $$@"
|
2022-05-30 13:24:42 -04:00
|
|
|
@$$(AS) -c $$< -o $$@
|
|
|
|
endef
|
2022-05-16 18:30:14 -04:00
|
|
|
|
2023-10-18 10:24:44 -04:00
|
|
|
$(foreach build_type,$(BUILD_TYPES),$(eval $(call build_rules,$(build_type))))
|
2022-05-16 18:30:14 -04:00
|
|
|
|
2023-06-28 19:00:34 -04:00
|
|
|
src/version.h : $(firstword $(MAKEFILE_LIST))
|
2024-02-07 19:17:30 -05:00
|
|
|
@echo "[version] $@"
|
2023-10-25 23:03:25 -04:00
|
|
|
@echo "#define VERSION_NUMBER \"$(VERSION_NUMBER)\"" > $@
|
|
|
|
@echo "#define VERSION_NAME \"$(VERSION_NAME)\"" >> $@
|
2023-06-28 19:00:34 -04:00
|
|
|
|
2024-08-02 20:07:21 -04:00
|
|
|
src/android/AndroidManifest.xml : $(firstword $(MAKEFILE_LIST))
|
|
|
|
@echo "[android_version] $@"
|
|
|
|
@sed -i \
|
|
|
|
-e 's/versionCode=".*"/versionCode="$(VERSION_CODE)"/' \
|
|
|
|
-e 's/versionName=".*"/versionName="$(VERSION_NUMBER)"/' \
|
|
|
|
-e 's/android:minSdkVersion="[[:digit:]]*"/android:minSdkVersion="$(ANDROID_MIN_SDK_VERSION)"/' \
|
|
|
|
-e 's/android:targetSdkVersion="[[:digit:]]*"/android:targetSdkVersion="$(ANDROID_TARGET_SDK_VERSION)"/' \
|
|
|
|
$@
|
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
##
|
|
|
|
## Android targets:
|
|
|
|
##
|
|
|
|
androiddebug: ## Build a debug 64-bit ARM Android APK.
|
|
|
|
androidrelease: ## Build a release 64-bit ARM Android APK.
|
|
|
|
androiddebug-armv7a: ## Build a debug 32-bit ARM Android APK.
|
|
|
|
androidrelease-armv7a: ## Build a release 32-bit ARM Android APK.
|
|
|
|
androiddebug-x86: ## Build a debug x86 Android APK.
|
|
|
|
androidrelease-x86: ## Build a release x86 Android APK.
|
|
|
|
androiddebug-x86_64: ## Build a debug x86_64 Android APK.
|
|
|
|
androidrelease-x86_64: ## Build a release x86_64 Android APK.
|
|
|
|
|
2023-03-14 23:21:20 -04:00
|
|
|
out/res/layout_activity_main.xml.flat: src/android/res/layout/activity_main.xml
|
2023-03-04 14:10:05 -05:00
|
|
|
@mkdir -p $(dir $@)
|
2024-02-07 19:17:30 -05:00
|
|
|
@echo "[aapt2] $@"
|
2023-03-15 19:55:22 -04:00
|
|
|
@$(ANDROID_BUILD_TOOLS)/aapt2 compile -o out/res/ src/android/res/layout/activity_main.xml
|
2023-03-14 23:21:20 -04:00
|
|
|
|
2023-05-03 20:04:43 -04:00
|
|
|
out/res/drawable_icon.xml.flat: src/android/res/drawable/icon.xml
|
2023-03-18 08:31:58 -04:00
|
|
|
@mkdir -p $(dir $@)
|
2024-02-07 19:17:30 -05:00
|
|
|
@echo "[aapt2] $@"
|
2023-05-03 20:04:43 -04:00
|
|
|
@$(ANDROID_BUILD_TOOLS)/aapt2 compile -o out/res/ src/android/res/drawable/icon.xml
|
|
|
|
|
|
|
|
out/apk/res.apk out/gen/com/unprompted/tildefriends/R.java: out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat src/android/AndroidManifest.xml
|
2024-07-14 16:18:47 -04:00
|
|
|
@echo [aapt2 link] res.apk
|
2024-07-16 20:22:07 -04:00
|
|
|
@mkdir -p out/apk/
|
2024-07-14 16:18:47 -04:00
|
|
|
@$(ANDROID_BUILD_TOOLS)/aapt2 link -I $(ANDROID_PLATFORM)/android.jar out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat \
|
|
|
|
--min-sdk-version $(ANDROID_MIN_SDK_VERSION) \
|
|
|
|
--target-sdk-version $(ANDROID_TARGET_SDK_VERSION) \
|
|
|
|
--manifest src/android/AndroidManifest.xml \
|
|
|
|
-o out/apk/res.apk \
|
|
|
|
--java out/gen/
|
|
|
|
|
|
|
|
out/apk/res.fdroid.apk out/gen_fdroid/com/unprompted/tildefriends/R.java: out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat src/android/AndroidManifest.xml
|
|
|
|
@echo [aapt2 link] res.fdroid.apk
|
2024-07-16 20:22:07 -04:00
|
|
|
@mkdir -p out/apk/
|
2024-07-14 16:18:47 -04:00
|
|
|
@$(ANDROID_BUILD_TOOLS)/aapt2 link -I $(ANDROID_PLATFORM)/android.jar out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat \
|
|
|
|
--min-sdk-version $(ANDROID_MIN_SDK_VERSION) \
|
|
|
|
--target-sdk-version $(ANDROID_TARGET_SDK_VERSION) \
|
|
|
|
--rename-manifest-package com.unprompted.tildefriends.fdroid \
|
|
|
|
--manifest src/android/AndroidManifest.xml \
|
|
|
|
-o out/apk/res.fdroid.apk \
|
|
|
|
--java out/gen_fdroid/
|
2023-03-04 14:10:05 -05:00
|
|
|
|
|
|
|
JAVA_FILES := out/gen/com/unprompted/tildefriends/R.java $(wildcard src/android/com/unprompted/tildefriends/*.java)
|
|
|
|
CLASS_FILES := $(foreach src,$(JAVA_FILES),out/classes/com/unprompted/tildefriends/$(notdir $(src:.java=.class)))
|
|
|
|
|
|
|
|
$(CLASS_FILES) &: $(JAVA_FILES)
|
2024-02-07 19:17:30 -05:00
|
|
|
@echo "[javac] $(CLASS_FILES)"
|
2024-04-26 18:10:22 -04:00
|
|
|
@javac --release 8 -encoding UTF-8 -Xlint:deprecation -XDuseUnsharedTable=true -classpath $(ANDROID_PLATFORM)/android.jar:$(ANDROID_BUILD_TOOLS)/core-lambda-stubs.jar -d out/classes $(JAVA_FILES)
|
2023-03-04 14:10:05 -05:00
|
|
|
|
|
|
|
out/apk/classes.dex: $(CLASS_FILES)
|
2023-03-15 19:55:22 -04:00
|
|
|
@mkdir -p $(dir $@)
|
2024-02-07 19:17:30 -05:00
|
|
|
@echo "[d8] $@"
|
2024-06-30 13:32:17 -04:00
|
|
|
@$(ANDROID_BUILD_TOOLS)/d8 --lib $(ANDROID_PLATFORM)/android.jar --output $(dir $@) out/classes/com/unprompted/tildefriends/*.class
|
2023-03-04 14:10:05 -05:00
|
|
|
|
2023-03-08 12:46:19 -05:00
|
|
|
PACKAGE_DIRS := \
|
|
|
|
apps/ \
|
|
|
|
core/ \
|
|
|
|
deps/codemirror/ \
|
2024-02-17 13:59:36 -05:00
|
|
|
deps/prettier/ \
|
2023-08-16 20:50:22 -04:00
|
|
|
deps/lit/
|
2023-03-08 12:46:19 -05:00
|
|
|
|
2024-09-04 20:07:26 -04:00
|
|
|
RAW_FILES := $(sort $(filter-out apps/blog% apps/issues% apps/welcome% apps/journal% %.map, $(shell find $(PACKAGE_DIRS) -type f -not -name '.*')))
|
2023-03-08 12:46:19 -05:00
|
|
|
|
2023-10-20 15:46:20 -04:00
|
|
|
out/apk/TildeFriends-arm-debug.unsigned.apk: BUILD_TYPE := debug
|
|
|
|
out/apk/TildeFriends-arm-release.unsigned.apk: BUILD_TYPE := release
|
|
|
|
out/apk/TildeFriends-x86-debug.unsigned.apk: BUILD_TYPE := debug
|
|
|
|
out/apk/TildeFriends-x86-release.unsigned.apk: BUILD_TYPE := release
|
2024-07-14 16:18:47 -04:00
|
|
|
out/apk/TildeFriends-release.fdroid.unsigned.apk: BUILD_TYPE := release
|
2023-03-18 08:31:58 -04:00
|
|
|
|
2023-10-20 15:46:20 -04:00
|
|
|
out/apk/TildeFriends-arm-debug.unsigned.apk: out/apk/classes.dex out/androiddebug/tildefriends out/androiddebug-armv7a/tildefriends $(RAW_FILES) out/apk/res.apk
|
|
|
|
out/apk/TildeFriends-arm-release.unsigned.apk: out/apk/classes.dex out/androidrelease/tildefriends out/androidrelease-armv7a/tildefriends $(RAW_FILES) out/apk/res.apk
|
|
|
|
out/apk/TildeFriends-x86-debug.unsigned.apk: out/apk/classes.dex out/androiddebug-x86_64/tildefriends out/androiddebug-x86/tildefriends $(RAW_FILES) out/apk/res.apk
|
|
|
|
out/apk/TildeFriends-x86-release.unsigned.apk: out/apk/classes.dex out/androidrelease-x86_64/tildefriends out/androidrelease-x86/tildefriends $(RAW_FILES) out/apk/res.apk
|
2024-07-14 16:18:47 -04:00
|
|
|
out/apk/TildeFriends-release.fdroid.unsigned.apk: out/apk/classes.dex out/androidrelease/tildefriends out/androidrelease-armv7a/tildefriends out/androidrelease-x86_64/tildefriends out/androidrelease-x86/tildefriends $(RAW_FILES) out/apk/res.fdroid.apk
|
2023-03-15 19:55:22 -04:00
|
|
|
|
2024-06-30 13:32:17 -04:00
|
|
|
$(BUNDLETOOL):
|
|
|
|
@echo [curl] $(BUNDLETOOL_URL) TO $@
|
|
|
|
@curl -q -L --create-dirs -o $@ $(BUNDLETOOL_URL)
|
|
|
|
|
|
|
|
out/TildeFriends.aab: out/apk/classes.dex $(filter-out %debug%, $(ANDROID_TARGETS)) $(RAW_FILES) out/apk/res.apk src/android/AndroidManifest.xml $(BUNDLETOOL)
|
|
|
|
@rm -rf out/aab/staging/
|
|
|
|
@mkdir -p out/aab/staging
|
2024-07-24 13:50:48 -04:00
|
|
|
@$(ANDROID_BUILD_TOOLS)/aapt2 link --proto-format -o out/aab/temporary.apk \
|
|
|
|
-I $(ANDROID_PLATFORM)/android.jar \
|
|
|
|
--min-sdk-version $(ANDROID_MIN_SDK_VERSION) \
|
|
|
|
--target-sdk-version $(ANDROID_TARGET_SDK_VERSION) \
|
|
|
|
--manifest src/android/AndroidManifest.xml \
|
|
|
|
-R out/res/layout_activity_main.xml.flat \
|
|
|
|
-R out/res/drawable_icon.xml.flat \
|
|
|
|
--auto-add-overlay
|
2024-06-30 13:32:17 -04:00
|
|
|
@unzip out/aab/temporary.apk -d out/aab/staging/
|
|
|
|
@mkdir -p out/aab/staging/root/deps
|
|
|
|
@mkdir -p out/aab/staging/classes
|
|
|
|
@mkdir -p out/aab/staging/dex
|
|
|
|
@mkdir -p out/aab/staging/manifest
|
|
|
|
@mv out/aab/staging/AndroidManifest.xml out/aab/staging/manifest/AndroidManifest.xml
|
|
|
|
@cp out/apk/classes.dex out/aab/staging/dex/
|
|
|
|
@rm -fv out/base.zip
|
2024-07-24 14:03:21 -04:00
|
|
|
@mkdir -p out/aab/staging/lib/arm64-v8a out/aab/staging/lib/armeabi-v7a out/aab/staging/lib/x86_64 out/aab/staging/lib/x86
|
|
|
|
@cp out/androidrelease/tildefriends out/aab/staging/lib/arm64-v8a/libtildefriends.so
|
|
|
|
@cp out/androidrelease-armv7a/tildefriends out/aab/staging/lib/armeabi-v7a/libtildefriends.so
|
|
|
|
@cp out/androidrelease-x86_64/tildefriends out/aab/staging/lib/x86_64/libtildefriends.so
|
|
|
|
@cp out/androidrelease-x86/tildefriends out/aab/staging/lib/x86/libtildefriends.so
|
|
|
|
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/aab/staging/lib/arm64-v8a/libtildefriends.so
|
|
|
|
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/aab/staging/lib/armeabi-v7a/libtildefriends.so
|
|
|
|
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/aab/staging/lib/x86_64/libtildefriends.so
|
|
|
|
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/aab/staging/lib/x86/libtildefriends.so
|
2024-06-30 13:32:17 -04:00
|
|
|
@cp -r apps/ out/aab/staging/root/
|
|
|
|
@rm -rf out/aab/staging/root/apps/welcome*
|
|
|
|
@cp -r core/ out/aab/staging/root/
|
|
|
|
@cp -r deps/prettier/ out/aab/staging/root/deps/
|
|
|
|
@cp -r deps/lit/ out/aab/staging/root/deps/
|
|
|
|
@cp -r deps/codemirror/ out/aab/staging/root/deps/
|
|
|
|
@cd out/aab/staging/; zip -r ../base.zip *; cd ../../../
|
|
|
|
@java -jar $(BUNDLETOOL) build-bundle --overwrite --config=src/android/BundleConfig.json --modules=out/aab/base.zip --output=$@
|
|
|
|
@jarsigner -keystore .keys/android.jks $@ androidKey -storepass android
|
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
aab: out/TildeFriends.aab ## Build an Android App Bundle.
|
2024-06-30 13:32:17 -04:00
|
|
|
.PHONY: aab
|
|
|
|
|
|
|
|
out/TildeFriends.apks: out/TildeFriends.aab $(BUNDLETOOL)
|
|
|
|
@java -jar $(BUNDLETOOL) build-apks --bundle out/TildeFriends.aab --overwrite --output $@ --ks .keys/android.jks --ks-key-alias androidKey --ks-pass pass:android
|
|
|
|
|
|
|
|
aabgo: out/TildeFriends.apks $(BUNDLETOOL)
|
|
|
|
@java -jar $(BUNDLETOOL) install-apks --apks out/TildeFriends.apks
|
|
|
|
@adb shell am start com.unprompted.tildefriends/.TildeFriendsActivity
|
|
|
|
|
2023-10-20 15:46:20 -04:00
|
|
|
out/apk/TildeFriends-arm-%.unsigned.apk:
|
2023-10-22 14:52:20 -04:00
|
|
|
@mkdir -p $(dir $@) out/apk-arm-$(BUILD_TYPE)/lib/arm64-v8a/ out/apk-arm-$(BUILD_TYPE)/lib/armeabi-v7a/
|
2024-02-07 19:17:30 -05:00
|
|
|
@echo "[aapt] $@"
|
2024-06-30 13:32:17 -04:00
|
|
|
@cp out/android$(BUILD_TYPE)/tildefriends out/apk-arm-$(BUILD_TYPE)/lib/arm64-v8a/libtildefriends.so
|
|
|
|
@cp out/android$(BUILD_TYPE)-armv7a/tildefriends out/apk-arm-$(BUILD_TYPE)/lib/armeabi-v7a/libtildefriends.so
|
|
|
|
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-arm-$(BUILD_TYPE)/lib/arm64-v8a/libtildefriends.so
|
|
|
|
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-arm-$(BUILD_TYPE)/lib/armeabi-v7a/libtildefriends.so
|
2024-02-25 18:29:10 -05:00
|
|
|
@cp out/apk/res.apk $@.zip
|
2023-10-20 15:46:20 -04:00
|
|
|
@cp out/apk/classes.dex out/apk-arm-$(BUILD_TYPE)/
|
2024-02-25 18:29:10 -05:00
|
|
|
@cd out/apk-arm-$(BUILD_TYPE) && zip -u ../../$@.zip -q -9 -r . && cd ../../
|
2024-03-25 13:50:17 -04:00
|
|
|
@zip -u $@.zip -q -9 $(RAW_FILES)
|
2024-03-07 20:42:08 -05:00
|
|
|
@$(ANDROID_BUILD_TOOLS)/zipalign -f 4 $@.zip $@
|
2023-10-20 15:46:20 -04:00
|
|
|
|
|
|
|
out/apk/TildeFriends-x86-%.unsigned.apk:
|
2023-10-22 14:52:20 -04:00
|
|
|
@mkdir -p $(dir $@) out/apk-x86-$(BUILD_TYPE)/lib/x86_64/ out/apk-x86-$(BUILD_TYPE)/lib/x86/
|
2024-02-07 19:17:30 -05:00
|
|
|
@echo "[aapt] $@"
|
2024-06-30 13:32:17 -04:00
|
|
|
@cp out/android$(BUILD_TYPE)-x86_64/tildefriends out/apk-x86-$(BUILD_TYPE)/lib/x86_64/libtildefriends.so
|
|
|
|
@cp out/android$(BUILD_TYPE)-x86/tildefriends out/apk-x86-$(BUILD_TYPE)/lib/x86/libtildefriends.so
|
|
|
|
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-x86-$(BUILD_TYPE)/lib/x86_64/libtildefriends.so
|
|
|
|
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-x86-$(BUILD_TYPE)/lib/x86/libtildefriends.so
|
2024-02-25 18:29:10 -05:00
|
|
|
@cp out/apk/res.apk $@.zip
|
2023-10-20 15:46:20 -04:00
|
|
|
@cp out/apk/classes.dex out/apk-x86-$(BUILD_TYPE)/
|
2024-02-25 18:29:10 -05:00
|
|
|
@cd out/apk-x86-$(BUILD_TYPE) && zip -u ../../$@.zip -q -9 -r . && cd ../../
|
2024-03-25 13:50:17 -04:00
|
|
|
@zip -u $@.zip -q -9 $(RAW_FILES)
|
2024-03-07 20:42:08 -05:00
|
|
|
@$(ANDROID_BUILD_TOOLS)/zipalign -f 4 $@.zip $@
|
2023-03-04 14:10:05 -05:00
|
|
|
|
2024-07-14 16:18:47 -04:00
|
|
|
out/apk/TildeFriends-%.fdroid.unsigned.apk:
|
2024-08-02 21:55:00 -04:00
|
|
|
@rm -rf out/apk-fdroid-$(BUILD_TYPE) out/apk-fdroid-$(BUILD_TYPE)-raw
|
2024-07-14 16:18:47 -04:00
|
|
|
@mkdir -p $(dir $@) out/apk-fdroid-$(BUILD_TYPE)/lib/x86_64/ out/apk-fdroid-$(BUILD_TYPE)/lib/x86/ out/apk-fdroid-$(BUILD_TYPE)/lib/arm64-v8a/ out/apk-fdroid-$(BUILD_TYPE)/lib/armeabi-v7a/
|
|
|
|
@echo "[aapt] $@"
|
|
|
|
@cp out/android$(BUILD_TYPE)-x86_64/tildefriends out/apk-fdroid-$(BUILD_TYPE)/lib/x86_64/libtildefriends.so
|
|
|
|
@cp out/android$(BUILD_TYPE)-x86/tildefriends out/apk-fdroid-$(BUILD_TYPE)/lib/x86/libtildefriends.so
|
|
|
|
@cp out/android$(BUILD_TYPE)/tildefriends out/apk-fdroid-$(BUILD_TYPE)/lib/arm64-v8a/libtildefriends.so
|
|
|
|
@cp out/android$(BUILD_TYPE)-armv7a/tildefriends out/apk-fdroid-$(BUILD_TYPE)/lib/armeabi-v7a/libtildefriends.so
|
|
|
|
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-fdroid-$(BUILD_TYPE)/lib/x86_64/libtildefriends.so
|
|
|
|
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-fdroid-$(BUILD_TYPE)/lib/x86/libtildefriends.so
|
|
|
|
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-fdroid-$(BUILD_TYPE)/lib/arm64-v8a/libtildefriends.so
|
|
|
|
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-fdroid-$(BUILD_TYPE)/lib/armeabi-v7a/libtildefriends.so
|
|
|
|
@cp out/apk/res.fdroid.apk $@.zip
|
|
|
|
@cp out/apk/classes.dex out/apk-fdroid-$(BUILD_TYPE)/classes.dex
|
2024-08-05 12:43:22 -04:00
|
|
|
@touch -d @0 out/apk-fdroid-$(BUILD_TYPE)/classes.dex out/apk-fdroid-$(BUILD_TYPE)/lib/*/libtildefriends.so
|
|
|
|
@chmod 755 out/apk-fdroid-$(BUILD_TYPE)/classes.dex out/apk-fdroid-$(BUILD_TYPE)/lib/*/libtildefriends.so
|
2024-08-05 12:26:10 -04:00
|
|
|
@cd out/apk-fdroid-$(BUILD_TYPE) && zip -X -u ../../$@.zip -q classes.dex lib/*/libtildefriends.so && cd ../../
|
2024-08-02 21:55:00 -04:00
|
|
|
@mkdir out/apk-fdroid-$(BUILD_TYPE)-raw
|
2024-08-04 11:25:06 -04:00
|
|
|
@for i in $(RAW_FILES); do mkdir -p $$(dirname out/apk-fdroid-$(BUILD_TYPE)-raw/$$i) && cp $$i out/apk-fdroid-$(BUILD_TYPE)-raw/$$i && touch -d @0 out/apk-fdroid-$(BUILD_TYPE)-raw/$$i && chmod 644 out/apk-fdroid-$(BUILD_TYPE)-raw/$$i; done
|
2024-08-04 10:21:04 -04:00
|
|
|
@cd out/apk-fdroid-$(BUILD_TYPE)-raw && zip -X -u ../../$@.zip -q $(RAW_FILES) && cd ../../
|
2024-07-14 16:18:47 -04:00
|
|
|
@$(ANDROID_BUILD_TOOLS)/zipalign -f 4 $@.zip $@
|
|
|
|
|
2023-03-18 08:31:58 -04:00
|
|
|
out/%.apk: out/apk/%.unsigned.apk
|
2024-02-07 19:17:30 -05:00
|
|
|
@echo "[apksigner] $(notdir $@)"
|
2024-02-25 18:29:10 -05:00
|
|
|
@$(ANDROID_BUILD_TOOLS)/apksigner sign --ks .keys/android.jks --ks-key-alias androidKey --ks-pass pass:android --key-pass pass:android --min-sdk-version $(ANDROID_MIN_SDK_VERSION) --out $@ $<
|
2023-03-04 14:10:05 -05:00
|
|
|
|
2024-03-07 20:42:08 -05:00
|
|
|
out/%.zopfli.apk: out/%.apk
|
|
|
|
@echo "[zopfli] $(notdir $@)"
|
|
|
|
$(ANDROID_BUILD_TOOLS)/zipalign -f -z 4 $< $@.zopfli
|
|
|
|
@$(ANDROID_BUILD_TOOLS)/apksigner sign --ks .keys/android.jks --ks-key-alias androidKey --ks-pass pass:android --key-pass pass:android --min-sdk-version $(ANDROID_MIN_SDK_VERSION) --out $@ $@.zopfli
|
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
release-apk: out/TildeFriends-arm-release.zopfli.apk out/TildeFriends-x86-release.zopfli.apk ## Build an Android release APK.
|
2023-10-20 15:46:20 -04:00
|
|
|
.PHONY: release-apk
|
2023-03-07 21:49:41 -05:00
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
fdroid: out/apk/TildeFriends-release.fdroid.unsigned.apk ## Build Android APK for distribution on F-Droid.
|
|
|
|
.PHONY: fdroid
|
|
|
|
|
|
|
|
apkgo: out/TildeFriends-arm-debug.apk ## Build, install, and run a debug Android APK.
|
2024-06-30 13:32:17 -04:00
|
|
|
@adb install -r $<
|
|
|
|
@adb shell am start com.unprompted.tildefriends/.TildeFriendsActivity
|
|
|
|
.PHONY: apkgo
|
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
releaseapkgo: out/TildeFriends-arm-release.apk ## Build, install, and run a release Android APK.
|
2023-10-22 13:26:53 -04:00
|
|
|
@adb install -r $<
|
2024-04-26 18:10:22 -04:00
|
|
|
@adb shell am start com.unprompted.tildefriends/.TildeFriendsActivity
|
2023-10-20 15:46:20 -04:00
|
|
|
.PHONY: releaseapkgo
|
2023-03-18 08:28:48 -04:00
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
apklog: ## Display Android log output.
|
|
|
|
@adb logcat *:S tildefriends
|
|
|
|
.PHONY: apklog
|
|
|
|
|
|
|
|
##
|
|
|
|
## iPhoneOS targets:
|
|
|
|
##
|
|
|
|
iosdebug: ## Build a debug iPhoneOS executable.
|
|
|
|
iosrelease: ## Build a release iPhoneOS executable.
|
|
|
|
|
2023-10-15 12:55:25 -04:00
|
|
|
out/%.app/Info.plist: src/ios/Info.plist
|
2023-10-15 14:06:31 -04:00
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
@cp -v $< $@
|
2023-10-19 14:52:56 -04:00
|
|
|
out/%.app/tildefriends.png: src/ios/tildefriends.png
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
@cp -v $< $@
|
2023-10-15 12:55:25 -04:00
|
|
|
|
2024-03-25 13:50:17 -04:00
|
|
|
out/data.zip: $(RAW_FILES)
|
2023-11-26 12:36:35 -05:00
|
|
|
@zip -u $@ -q -9 $(RAW_FILES)
|
2023-10-15 12:55:25 -04:00
|
|
|
|
2024-03-25 13:50:17 -04:00
|
|
|
out/tildefriends-%.app/tildefriends: out/%/tildefriends out/tildefriends-%.app/Info.plist out/tildefriends-%.app/tildefriends.png out/data.zip
|
2023-10-15 14:06:31 -04:00
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
@cp -v $< $@
|
2024-10-10 21:32:35 -04:00
|
|
|
@cp -v out/data.zip $(@D)/
|
2023-10-19 15:18:16 -04:00
|
|
|
ifeq ($(HAVE_LINUX_IOS),1)
|
2023-10-19 20:16:01 -04:00
|
|
|
@zsign -q -k .keys/apple.p12 -f -m src/ios/embedded.mobileprovision $(realpath $(dir $@))
|
2023-10-19 15:18:16 -04:00
|
|
|
endif
|
2023-10-15 14:06:31 -04:00
|
|
|
.SECONDARY:
|
2023-10-19 15:18:16 -04:00
|
|
|
out/tildefriends-%.ipa: out/tildefriends-ios%.app/tildefriends
|
2024-02-07 19:17:30 -05:00
|
|
|
@echo "[ipa] $@"
|
2023-10-19 15:18:16 -04:00
|
|
|
@rm -rf $@.tmp $@
|
|
|
|
@mkdir -p $@.tmp/Payload/tildefriends.app/
|
|
|
|
@cp -R $(dir $<)/* $@.tmp/Payload/tildefriends.app/
|
|
|
|
@cd $@.tmp/ && zip -u ../../$@ -q -9 -r ./
|
|
|
|
@rm -rf $@.tmp/
|
2023-10-15 14:06:31 -04:00
|
|
|
|
2024-03-25 13:50:17 -04:00
|
|
|
|
|
|
|
out/%/tildefriends.standalone: out/%/tildefriends out/data.zip
|
|
|
|
@echo "[standalone] $@"
|
|
|
|
@cat $< out/data.zip > $@
|
|
|
|
@chmod +x $@
|
2024-04-17 20:16:07 -04:00
|
|
|
out/%/tildefriends.standalone.exe: out/%/tildefriends.exe out/data.zip
|
|
|
|
@echo "[standalone] $@"
|
|
|
|
@cat $< out/data.zip > $@
|
|
|
|
@chmod +x $@
|
2024-03-25 13:50:17 -04:00
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
iossimdebug-app: out/tildefriends-iossimdebug.app/tildefriends ## Build a debug iOS Simulator .app directory.
|
|
|
|
iossimrelease-app: out/tildefriends-iossimrelease.app/tildefriends ## Build a release iOS Simulator .app directory.
|
|
|
|
iosdebug-app: out/tildefriends-iosdebug.app/tildefriends ## Build a debug iOS .app directory.
|
|
|
|
iosrelease-app: out/tildefriends-iosrelease.app/tildefriends ## Build a release iOS .app directory.
|
2023-10-19 15:18:16 -04:00
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
iosdebug-ipa: out/tildefriends-debug.ipa ## Build a debug iOS .ipa.
|
|
|
|
iosrelease-ipa: out/tildefriends-release.ipa ## Build a release iOS .ipa.
|
2023-10-16 09:57:40 -04:00
|
|
|
.PHONY: iossimdebug-app iossimrelease-app iosdebug-app iosrelease-app
|
2023-10-15 12:55:25 -04:00
|
|
|
|
2023-10-19 21:40:58 -04:00
|
|
|
ios%go: out/tildefriends-ios%.app/tildefriends
|
2023-10-19 14:21:36 -04:00
|
|
|
ideviceinstaller -i $(realpath $(dir $<))
|
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
iossimdebuggo: out/tildefriends-iossimdebug.app/tildefriends ## Build, install, and run an iOS debug build.
|
2023-10-15 12:55:25 -04:00
|
|
|
xcrun simctl install booted out/tildefriends-iossimdebug.app/
|
|
|
|
xcrun simctl launch booted com.unprompted.tildefriends
|
2023-10-15 14:06:31 -04:00
|
|
|
.PHONY: iossimdebuggo
|
2023-10-15 12:55:25 -04:00
|
|
|
|
2024-02-21 19:46:28 -05:00
|
|
|
ANDROID_DEPS := deps/openssl/android/arm64-v8a/usr/local/lib/libssl.a
|
|
|
|
$(ANDROID_DEPS):
|
2024-07-24 11:20:35 -04:00
|
|
|
+@ANDROID_NDK_ROOT=$(ANDROID_NDK) tools/ssl-android
|
2024-02-21 19:46:28 -05:00
|
|
|
$(filter $(BUILD_DIR)/android%,$(APP_OBJS)): | $(ANDROID_DEPS)
|
|
|
|
|
|
|
|
ifeq ($(HAVE_WIN),1)
|
|
|
|
WINDOWS_DEPS := deps/openssl/mingw64/usr/local/lib/libssl.a
|
|
|
|
$(WINDOWS_DEPS):
|
|
|
|
+@tools/ssl-mingw64
|
|
|
|
$(filter $(BUILD_DIR)/win%,$(APP_OBJS)): | $(WINDOWS_DEPS)
|
|
|
|
endif
|
2024-02-07 18:12:32 -05:00
|
|
|
|
2024-02-21 20:23:35 -05:00
|
|
|
ifeq ($(UNAME_S),Darwin)
|
2024-02-25 14:52:35 -05:00
|
|
|
IOS_DEPS := deps/openssl/ios/ios64-xcrun/usr/local/lib/libssl.a
|
2024-02-21 20:23:35 -05:00
|
|
|
$(IOS_DEPS):
|
|
|
|
+@tools/ssl-ios
|
|
|
|
$(filter $(BUILD_DIR)/ios%,$(APP_OBJS)): | $(IOS_DEPS)
|
|
|
|
endif
|
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
##
|
|
|
|
## Linux package targets:
|
|
|
|
##
|
|
|
|
|
2024-09-25 12:49:32 -04:00
|
|
|
out/tildefriends-x86_64.AppImage: out/release/tildefriends out/data.zip
|
2024-09-25 19:45:05 -04:00
|
|
|
@echo "[appimage] $$@"
|
2024-09-27 21:19:18 -04:00
|
|
|
@rm -rf out/tildefriends.AppDir
|
|
|
|
@mkdir -p out/tildefriends.AppDir/usr/bin
|
|
|
|
@mkdir -p out/tildefriends.AppDir/usr/share/applications
|
|
|
|
@mkdir -p out/tildefriends.AppDir/usr/share/icons/hicolor/scalable/apps
|
|
|
|
@mkdir -p out/tildefriends.AppDir/usr/share/tildefriends
|
|
|
|
@echo $(APPIMAGETOOL_MD5) > out/appimagetool.md5
|
|
|
|
@test -x out/appimagetool || curl -q -L -o out/appimagetool $(APPIMAGETOOL_URL) && md5sum -c out/appimagetool.md5 && chmod +x out/appimagetool
|
|
|
|
@echo "[Desktop Entry]\nName=tildefriends\nExec=/usr/bin/tildefriends\nIcon=/usr/share/icons/hicolor/scalable/apps/tildefriends\nType=Application\nCategories=Network" > out/tildefriends.AppDir/tildefriends.desktop
|
|
|
|
@cp src/ios/tildefriends.svg out/tildefriends.AppDir/usr/share/icons/hicolor/scalable/apps/
|
|
|
|
@cp src/ios/tildefriends.svg out/tildefriends.AppDir/
|
|
|
|
@cp out/release/tildefriends out/tildefriends.AppDir/usr/bin/
|
|
|
|
@cp out/data.zip out/tildefriends.AppDir/usr/share/tildefriends/data.zip
|
|
|
|
@echo "#!/bin/sh\n\$${APPDIR}/usr/bin/tildefriends run -z \$$APPDIR/usr/share/tildefriends/data.zip" > out/tildefriends.AppDir/AppRun
|
|
|
|
@chmod +x out/tildefriends.AppDir/AppRun
|
|
|
|
@cd out; ./appimagetool --appimage-extract; cd ..
|
2024-10-02 20:03:44 -04:00
|
|
|
@cd out; unset SOURCE_DATE_EPOCH; PATH=$$PATH:squashfs-root/usr/bin ARCH=x86_64 squashfs-root/usr/bin/appimagetool -u 'zsync|https://dev.tildefriends.net/releases/tildefriends-x86_64.AppImage.zsync' tildefriends.AppDir tildefriends-x86_64.AppImage; cd ..
|
2024-08-28 20:55:52 -04:00
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
appimage: out/tildefriends-x86_64.AppImage ## Build an AppImage.
|
2024-08-28 20:55:52 -04:00
|
|
|
.PHONY: appimage
|
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
flatpak: out/ ## Build a flatpak.
|
2024-10-27 14:31:11 -04:00
|
|
|
flatpak-builder --force-clean --user --install-deps-from=flathub --install --repo=out/flatpak-repo out/flatpak src/com.unprompted.tildefriends.yml
|
2024-10-27 18:50:07 -04:00
|
|
|
flatpak build-bundle out/flatpak-repo out/tildefriends.flatpak com.unprompted.tildefriends
|
2024-10-27 14:31:11 -04:00
|
|
|
.PHONY: flatpak
|
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
##
|
|
|
|
## Targets for release management:
|
|
|
|
##
|
|
|
|
|
|
|
|
fetchdeps: ## Update various external sources that live in the tree that can't be pulled in as git submodules.
|
|
|
|
@echo "[fetch] sqlite"
|
|
|
|
@test -f out/deps/sqlite.zip && test "$$(cat out/deps/sqlite.txt 2>/dev/null)" = $(SQLITE_URL) || (mkdir -p out/deps/ && curl -q $(SQLITE_URL) -o out/deps/sqlite.zip)
|
|
|
|
@test -d deps/sqlite/ && test "$$(cat out/deps/sqlite.txt 2>/dev/null)" = $(SQLITE_URL) || (mkdir -p deps/sqlite/ && unzip -qDjo -d deps/sqlite/ out/deps/sqlite.zip)
|
|
|
|
@echo -n $(SQLITE_URL) > out/deps/sqlite.txt
|
|
|
|
@echo "[fetch] prettier"
|
|
|
|
@test -f deps/prettier/standalone.mjs || curl -q --create-dirs -O --output-dir deps/prettier/ https://cdn.jsdelivr.net/npm/prettier@3.2.5/standalone.mjs
|
|
|
|
@test -f deps/prettier/html.mjs || curl -q --create-dirs -O --output-dir deps/prettier/ https://cdn.jsdelivr.net/npm/prettier@3.2.5/plugins/html.mjs
|
|
|
|
@test -f deps/prettier/babel.mjs || curl -q --create-dirs -O --output-dir deps/prettier/ https://cdn.jsdelivr.net/npm/prettier@3.2.5/plugins/babel.mjs
|
|
|
|
@test -f deps/prettier/estree.mjs || curl -q --create-dirs -O --output-dir deps/prettier/ https://cdn.jsdelivr.net/npm/prettier@3.2.5/plugins/estree.mjs
|
|
|
|
.PHONY: fetchdeps
|
|
|
|
|
|
|
|
shots: ## Copy generated screenshots from `tildefriends test -t=auto` into place in the metadata/ directory.
|
|
|
|
@echo [shots] $(wildcard out/screenshot*.png)
|
|
|
|
@cp -f out/screenshot*.png metadata/en-US/images/phoneScreenshots/
|
|
|
|
.PHONY: shots
|
2023-08-09 19:14:16 -04:00
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
tarball: ## Build an all-inclusive source tarball (.tar.xz).
|
2024-09-04 20:07:26 -04:00
|
|
|
@echo [archive] out/tildefriends-$(VERSION_NUMBER).tar.xz
|
2024-02-21 19:59:26 -05:00
|
|
|
@rm -rf out/tildefriends-$(VERSION_NUMBER)
|
2024-09-04 20:07:26 -04:00
|
|
|
@mkdir -p out/tildefriends-$(VERSION_NUMBER)
|
2024-04-10 19:09:31 -04:00
|
|
|
@git ls-files --recurse-submodules | tar -c -T- | tar -x -C out/tildefriends-$(VERSION_NUMBER)
|
2023-08-09 19:14:16 -04:00
|
|
|
@tar \
|
2023-10-19 15:47:55 -04:00
|
|
|
--exclude=apps/welcome* \
|
2023-08-09 19:14:16 -04:00
|
|
|
--exclude=deps/libbacktrace/Isaac.Newton-Opticks.txt \
|
|
|
|
--exclude=deps/libsodium/builds/msvc/vs* \
|
|
|
|
--exclude=deps/libsodium/builds/msvc/build \
|
|
|
|
--exclude=deps/libsodium/builds/msvc/properties \
|
|
|
|
--exclude=deps/libsodium/configure \
|
|
|
|
--exclude=deps/libsodium/test \
|
|
|
|
--exclude=deps/libuv/docs \
|
|
|
|
--exclude=deps/libuv/test \
|
|
|
|
--exclude=deps/openssl \
|
|
|
|
--exclude=deps/speedscope/*.map \
|
|
|
|
--exclude=deps/sqlite/shell.c \
|
|
|
|
--exclude=deps/zlib/contrib/vstudio \
|
|
|
|
--exclude=deps/zlib/doc \
|
2024-09-04 20:07:26 -04:00
|
|
|
-caf out/tildefriends-$(VERSION_NUMBER).tar.xz \
|
2024-03-20 20:43:41 -04:00
|
|
|
-C out/ \
|
|
|
|
tildefriends-$(VERSION_NUMBER)
|
2024-09-04 20:07:26 -04:00
|
|
|
.PHONY: tarball
|
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
dist: ## Build versions of all distributables for release.
|
2024-09-25 20:02:45 -04:00
|
|
|
dist: release-apk iosrelease-ipa aab $(if $(HAVE_WIN), out/winrelease/tildefriends.standalone.exe) out/TildeFriends-release.fdroid.apk appimage tarball
|
2024-09-04 20:07:26 -04:00
|
|
|
@mkdir -p dist/
|
|
|
|
@echo "[cp] tildefriends-$(VERSION_NUMBER).tar.xz"
|
|
|
|
@cp out/tildefriends-$(VERSION_NUMBER).tar.xz dist/tildefriends-$(VERSION_NUMBER).tar.xz
|
2023-10-20 15:46:20 -04:00
|
|
|
@echo "[cp] TildeFriends-x86-$(VERSION_NUMBER).apk"
|
2024-03-07 20:42:08 -05:00
|
|
|
@cp out/TildeFriends-x86-release.zopfli.apk dist/TildeFriends-x86-$(VERSION_NUMBER).apk
|
2023-10-20 15:46:20 -04:00
|
|
|
@echo "[cp] TildeFriends-arm-$(VERSION_NUMBER).apk"
|
2024-03-07 20:42:08 -05:00
|
|
|
@cp out/TildeFriends-arm-release.zopfli.apk dist/TildeFriends-arm-$(VERSION_NUMBER).apk
|
2023-10-19 15:47:55 -04:00
|
|
|
@echo "[cp] TildeFriends-$(VERSION_NUMBER).ipa"
|
2024-02-21 19:59:26 -05:00
|
|
|
@cp out/tildefriends-release.ipa dist/TildeFriends-$(VERSION_NUMBER).ipa
|
2024-04-17 20:16:07 -04:00
|
|
|
@test $(HAVE_WIN) && echo "[cp] tildefriends-$(VERSION_NUMBER).exe"
|
|
|
|
@test $(HAVE_WIN) && cp out/winrelease/tildefriends.standalone.exe dist/tildefriends-$(VERSION_NUMBER).exe
|
2024-09-04 20:07:26 -04:00
|
|
|
@echo "[cp] TildeFriends-$(VERSION_NUMBER).aab"
|
2024-07-10 20:52:40 -04:00
|
|
|
@cp out/TildeFriends.aab dist/TildeFriends-$(VERSION_NUMBER).aab
|
2024-09-04 20:07:26 -04:00
|
|
|
@echo "[cp] TildeFriends-$(VERSION_NUMBER).fdroid.apk"
|
2024-08-04 12:10:52 -04:00
|
|
|
@cp out/TildeFriends-release.fdroid.apk dist/TildeFriends-$(VERSION_NUMBER).fdroid.apk
|
2024-09-04 20:07:26 -04:00
|
|
|
@echo "[cp] TildeFriends-x86_64-$(VERSION_NUMBER).AppImage"
|
2024-09-25 12:49:32 -04:00
|
|
|
@cp out/tildefriends-x86_64.AppImage dist/TildeFriends-x86_64-$(VERSION_NUMBER).AppImage
|
2023-08-09 19:14:16 -04:00
|
|
|
.PHONY: dist
|
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
dist-test: dist ## Exercise some built distributable files, making sure they work as intended.
|
2023-08-09 19:14:16 -04:00
|
|
|
@tar -xf tildefriends-$(VERSION_NUMBER).tar.xz
|
|
|
|
@$(MAKE) -C tildefriends-$(VERSION_NUMBER)/ debug release
|
2023-10-23 20:30:07 -04:00
|
|
|
@docker build tildefriends-$(VERSION_NUMBER)/
|
2023-08-09 19:14:16 -04:00
|
|
|
@rm -rf tildefriends-$(VERSION_NUMBER)
|
|
|
|
.PHONY: dist-test
|
2024-02-15 18:35:01 -05:00
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
##
|
|
|
|
## Targets for tidying up:
|
|
|
|
##
|
|
|
|
|
|
|
|
format: ## Standardize formatting of C source.
|
2024-02-15 18:35:01 -05:00
|
|
|
@clang-format -i $(wildcard src/*.c src/*.h src/*.m)
|
|
|
|
.PHONY: format
|
2024-02-20 21:41:37 -05:00
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
prettier: ## Standardize formatting of JavaScript and Markdown source.
|
2024-03-08 21:43:08 -05:00
|
|
|
@npm run prettier
|
|
|
|
.PHONY: prettier
|
|
|
|
|
2024-11-25 21:11:36 -05:00
|
|
|
clean: ## Clean all generated files from the out/ directory.
|
|
|
|
rm -rf $(BUILD_DIR)
|
|
|
|
.PHONY: clean
|
|
|
|
|
|
|
|
##
|
|
|
|
## Documentation:
|
|
|
|
##
|
|
|
|
help: ## Display this help message.
|
2024-11-27 09:06:02 -05:00
|
|
|
@awk \
|
|
|
|
-F: \
|
|
|
|
-vG=$$(tput setaf 2) \
|
2024-11-27 09:28:14 -05:00
|
|
|
-vO=$$(tput setaf 3) \
|
|
|
|
-vB=$$(tput setaf 4) \
|
|
|
|
-vM=$$(tput setaf 5) \
|
|
|
|
-vC=$$(tput setaf 6) \
|
2024-11-27 09:06:02 -05:00
|
|
|
-vR=$$(tput sgr0) ' \
|
2024-11-27 09:28:14 -05:00
|
|
|
/^## ==.*==$$/ { sub(/^## ?/, ""); printf "%s%s%s\n", C, $$0, R } \
|
2024-11-27 14:36:50 -05:00
|
|
|
/^##.*:=.*/ { sub(/^## ?/, ""); sub(/:=/, ":"); printf " %s%-20s%s %s%s%s\n", M, $$1, R, O, $$2, R } \
|
2024-11-27 09:28:14 -05:00
|
|
|
/^##/ { sub(/^## ?/, ""); print $$0 } \
|
|
|
|
/^[[:alnum:]-]+:.*##/ { \
|
|
|
|
sub(/:.*##\s?/, ":"); \
|
|
|
|
printf " %s%-20s%s %s%s%s\n", G, $$1, R, O, $$2, R \
|
|
|
|
} \
|
2024-11-26 22:55:01 -05:00
|
|
|
' < $(filter-out %.d,$(MAKEFILE_LIST))
|
2024-11-25 21:11:36 -05:00
|
|
|
@echo "" # Blank line.
|
|
|
|
.PHONY: help
|
|
|
|
.DEFAULT_GOAL := help
|
|
|
|
|
|
|
|
docs: ## Build HTML docs.
|
2024-02-20 21:41:37 -05:00
|
|
|
@doxygen
|
|
|
|
.PHONY: docs
|