2022-08-21 13:17:23 -04:00
|
|
|
.ONESHELL:
|
|
|
|
.DELETE_ON_ERROR:
|
|
|
|
MAKEFLAGS += --warn-undefined-variables
|
|
|
|
MAKEFLAGS += --no-builtin-rules
|
|
|
|
|
2024-06-30 13:32:17 -04:00
|
|
|
VERSION_CODE := 22
|
2024-06-26 20:47:44 -04:00
|
|
|
VERSION_NUMBER := 0.0.21-wip
|
|
|
|
VERSION_NAME := Psst. Look behind you.
|
2023-06-28 19:23:29 -04:00
|
|
|
|
2024-05-25 07:46:15 -04:00
|
|
|
SQLITE_URL := https://www.sqlite.org/2024/sqlite-amalgamation-3460000.zip
|
2024-03-13 19:53:57 -04:00
|
|
|
LIBUV_URL := https://dist.libuv.org/dist/v1.48.0/libuv-v1.48.0.tar.gz
|
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-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
|
|
|
|
|
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 \
|
|
|
|
-lnetwork
|
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 \
|
|
|
|
-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 \
|
2022-09-24 16:54:54 -04:00
|
|
|
-g
|
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-07-24 11:20:35 -04:00
|
|
|
ifneq "$(wildcard $(ANDROID_SDK)/ndk/27.0.12077973/.)" ""
|
|
|
|
ANDROID_NDK ?= $(ANDROID_SDK)/ndk/27.0.12077973
|
|
|
|
else
|
2024-04-26 18:10:22 -04:00
|
|
|
ANDROID_NDK ?= $(ANDROID_SDK)/ndk/26.2.11394342
|
2024-07-24 11:20:35 -04:00
|
|
|
endif
|
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))
|
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 \
|
|
|
|
-funwind-tables
|
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
|
2023-03-19 16:25:50 -04:00
|
|
|
$(RELEASE_TARGETS): CFLAGS += -DNDEBUG
|
|
|
|
$(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 \
|
2023-10-25 17:56:29 -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 \
|
2023-10-25 17:56:29 -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
|
2023-10-19 14:06:32 -04:00
|
|
|
$(IOS_TARGETS): CFLAGS += -mios-version-min=9.0 -Ideps/openssl/ios/ios64-xcrun/usr/local/include
|
2023-10-11 20:29:17 -04:00
|
|
|
$(IOS_TARGETS): LDFLAGS += -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)
|
|
|
|
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 \
|
|
|
|
-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
|
|
|
|
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 \
|
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 \
|
2023-10-25 22:56:33 -04:00
|
|
|
-Wno-unused-variable
|
|
|
|
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
|
|
|
|
2022-05-25 20:47:36 -04:00
|
|
|
unix: debug release
|
|
|
|
win: windebug winrelease
|
2024-06-29 08:33:51 -04:00
|
|
|
all: $(BUILD_TYPES)
|
2022-05-30 13:24:42 -04:00
|
|
|
.PHONY: all win unix
|
2021-10-03 18:14:06 -04:00
|
|
|
|
2022-05-25 20:47:36 -04:00
|
|
|
ALL_APP_OBJS := \
|
|
|
|
$(APP_OBJS) \
|
|
|
|
$(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
|
|
|
|
2023-03-04 14:10:05 -05:00
|
|
|
# Android support.
|
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 \
|
|
|
|
--version-code $(VERSION_CODE) \
|
|
|
|
--version-name $(VERSION_NUMBER) \
|
|
|
|
--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 \
|
|
|
|
--version-code $(VERSION_CODE) \
|
|
|
|
--version-name $(VERSION_NUMBER) \
|
|
|
|
--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-02-24 11:19:36 -05:00
|
|
|
RAW_FILES := $(filter-out apps/blog% apps/issues% apps/welcome% apps/journal% %.map, $(shell find $(PACKAGE_DIRS) -type f))
|
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
|
|
|
|
@$(ANDROID_BUILD_TOOLS)/aapt2 link --proto-format -o out/aab/temporary.apk -I $(ANDROID_PLATFORM)/android.jar --manifest src/android/AndroidManifest.xml -R out/res/layout_activity_main.xml.flat -R out/res/drawable_icon.xml.flat --auto-add-overlay
|
|
|
|
@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
|
|
|
|
@cp -r out/apk-arm-release/lib/ out/aab/staging/
|
|
|
|
@cp -r out/apk-x86-release/lib/ out/aab/staging/
|
|
|
|
@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
|
|
|
|
|
|
|
|
aab: out/TildeFriends.aab
|
|
|
|
.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:
|
|
|
|
@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
|
|
|
|
@cd out/apk-fdroid-$(BUILD_TYPE) && zip -u ../../$@.zip -q -9 -r . && cd ../../
|
|
|
|
@zip -u $@.zip -q -9 $(RAW_FILES)
|
|
|
|
@$(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
|
|
|
|
|
|
|
|
release-apk: out/TildeFriends-arm-release.zopfli.apk out/TildeFriends-x86-release.zopfli.apk
|
2023-10-20 15:46:20 -04:00
|
|
|
.PHONY: release-apk
|
2023-03-07 21:49:41 -05:00
|
|
|
|
2024-06-30 13:32:17 -04:00
|
|
|
apkgo: out/TildeFriends-arm-debug.apk
|
|
|
|
@adb install -r $<
|
|
|
|
@adb shell am start com.unprompted.tildefriends/.TildeFriendsActivity
|
|
|
|
.PHONY: apkgo
|
|
|
|
|
2023-10-20 15:46:20 -04:00
|
|
|
releaseapkgo: out/TildeFriends-arm-release.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
|
|
|
|
2023-10-15 12:55:25 -04:00
|
|
|
# iOS Support
|
|
|
|
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 $< $@
|
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
|
|
|
|
2023-10-15 14:06:31 -04:00
|
|
|
iossimdebug-app: out/tildefriends-iossimdebug.app/tildefriends
|
|
|
|
iossimrelease-app: out/tildefriends-iossimrelease.app/tildefriends
|
2023-10-16 09:57:40 -04:00
|
|
|
iosdebug-app: out/tildefriends-iosdebug.app/tildefriends
|
|
|
|
iosrelease-app: out/tildefriends-iosrelease.app/tildefriends
|
2023-10-19 15:18:16 -04:00
|
|
|
|
|
|
|
iosdebug-ipa: out/tildefriends-debug.ipa
|
|
|
|
iosrelease-ipa: out/tildefriends-release.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 $<))
|
|
|
|
|
2023-10-15 12:55:25 -04:00
|
|
|
iossimdebuggo: out/tildefriends-iossimdebug.app/tildefriends
|
|
|
|
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
|
|
|
|
2023-05-23 19:26:07 -04:00
|
|
|
apklog:
|
|
|
|
@adb logcat *:S tildefriends
|
|
|
|
.PHONY: apklog
|
|
|
|
|
2024-02-07 18:12:32 -05:00
|
|
|
fetchdeps:
|
2024-02-07 19:17:30 -05:00
|
|
|
@echo "[fetch] libuv"
|
2024-03-13 19:53:57 -04:00
|
|
|
@test -f out/deps/libuv.tar.gz && test "$$(cat out/deps/libuv.txt 2>/dev/null)" = $(LIBUV_URL) || (mkdir -p out/deps/ && curl -q $(LIBUV_URL) -o out/deps/libuv.tar.gz)
|
|
|
|
@test -d deps/libuv/ && test "$$(cat out/deps/libuv.txt 2>/dev/null)" = $(LIBUV_URL) || (rm -rf deps/libuv/ && mkdir -p deps/libuv/ && tar -C deps/libuv/ -m --strip=1 -xf out/deps/libuv.tar.gz)
|
|
|
|
@echo -n $(LIBUV_URL) > out/deps/libuv.txt
|
2024-02-07 19:17:30 -05:00
|
|
|
@echo "[fetch] sqlite"
|
2024-03-13 19:53:57 -04:00
|
|
|
@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)
|
2024-03-13 12:30:14 -04:00
|
|
|
@echo -n $(SQLITE_URL) > out/deps/sqlite.txt
|
2024-02-17 13:53:21 -05:00
|
|
|
@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
|
2024-02-21 19:46:28 -05:00
|
|
|
.PHONY: fetchdeps
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
clean:
|
|
|
|
rm -rf $(BUILD_DIR)
|
|
|
|
.PHONY: clean
|
2023-08-09 19:14:16 -04:00
|
|
|
|
2024-06-29 08:33:51 -04:00
|
|
|
dist: release-apk iosrelease-ipa $(if $(HAVE_WIN), out/winrelease/tildefriends.standalone.exe)
|
2024-02-21 19:59:26 -05:00
|
|
|
@echo [archive] dist/tildefriends-$(VERSION_NUMBER).tar.xz
|
|
|
|
@rm -rf out/tildefriends-$(VERSION_NUMBER)
|
|
|
|
@mkdir -p dist/ 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-03-20 20:43:41 -04:00
|
|
|
-caf dist/tildefriends-$(VERSION_NUMBER).tar.xz \
|
|
|
|
-C out/ \
|
|
|
|
tildefriends-$(VERSION_NUMBER)
|
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-07-10 20:52:40 -04:00
|
|
|
@cp out/TildeFriends.aab dist/TildeFriends-$(VERSION_NUMBER).aab
|
2023-08-09 19:14:16 -04:00
|
|
|
.PHONY: dist
|
|
|
|
|
|
|
|
dist-test: dist
|
|
|
|
@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
|
|
|
|
|
|
|
format:
|
|
|
|
@clang-format -i $(wildcard src/*.c src/*.h src/*.m)
|
|
|
|
.PHONY: format
|
2024-02-20 21:41:37 -05:00
|
|
|
|
2024-03-08 21:43:08 -05:00
|
|
|
prettier:
|
|
|
|
@npm run prettier
|
|
|
|
.PHONY: prettier
|
|
|
|
|
2024-02-20 21:41:37 -05:00
|
|
|
docs:
|
|
|
|
@doxygen
|
|
|
|
.PHONY: docs
|
2024-07-10 19:25:01 -04:00
|
|
|
|
2024-07-14 16:18:47 -04:00
|
|
|
fdroid: out/apk/TildeFriends-release.fdroid.unsigned.apk
|
2024-07-10 19:25:01 -04:00
|
|
|
.PHONE: fdroid
|