2022-08-21 13:17:23 -04:00
|
|
|
.ONESHELL:
|
|
|
|
.DELETE_ON_ERROR:
|
|
|
|
MAKEFLAGS += --warn-undefined-variables
|
|
|
|
MAKEFLAGS += --no-builtin-rules
|
|
|
|
|
2023-10-25 22:59:37 -04:00
|
|
|
VERSION_CODE := 13
|
2023-11-29 18:40:04 -05:00
|
|
|
VERSION_NUMBER := 0.0.13
|
|
|
|
VERSION_NAME := Served on grilled naan or gluten free sweet potato flatbread.
|
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
|
|
|
|
|
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
|
|
|
|
HAVE_WIN := 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 += \
|
2021-01-02 13:10:00 -05:00
|
|
|
-Wall \
|
|
|
|
-Wextra \
|
|
|
|
-Wno-unused-parameter \
|
|
|
|
-MMD \
|
|
|
|
-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-19 21:10:58 -04:00
|
|
|
ANDROID_BUILD_TOOLS := $(ANDROID_SDK)/build-tools/34.0.0
|
2023-03-14 23:21:20 -04:00
|
|
|
ANDROID_PLATFORM := $(ANDROID_SDK)/platforms/android-33
|
2023-10-19 21:10:58 -04:00
|
|
|
ANDROID_NDK ?= $(ANDROID_SDK)/ndk/26.0.10792818
|
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
|
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
|
2023-10-20 15:46:20 -04:00
|
|
|
all: out/TildeFriends-arm-debug.apk out/TildeFriends-arm-release.apk out/TildeFriends-x86-debug.apk out/TildeFriends-x86-release.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))
|
2023-03-15 19:55:22 -04:00
|
|
|
|
2023-03-19 20:29:46 -04:00
|
|
|
$(NONANDROID_TARGETS): CFLAGS += -fno-omit-frame-pointer
|
2023-10-17 18:25:31 -04:00
|
|
|
$(filter-out $(ANDROID_TARGETS) $(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
|
|
|
|
$(ANDROID_RELEASE_TARGETS): CFLAGS += -Os
|
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
|
|
|
|
$(NONMACOS_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
|
|
|
|
2022-01-22 15:20:21 -05:00
|
|
|
ifeq ($(UNAME_M),x86_64)
|
2023-10-25 22:56:33 -04:00
|
|
|
ifneq ($(UNAME_S),Haiku)
|
2022-09-24 16:54:54 -04:00
|
|
|
debug: CFLAGS += -fsanitize=address -fsanitize=undefined -fno-common
|
2022-01-22 15:20:21 -05:00
|
|
|
debug: LDFLAGS += -fsanitize=address -fsanitize=undefined
|
2022-01-22 15:13:14 -05:00
|
|
|
endif
|
2023-10-25 22:56:33 -04:00
|
|
|
endif
|
2022-01-22 15:13:14 -05:00
|
|
|
|
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 \
|
2022-09-24 17:10:23 -04:00
|
|
|
-Ideps/xopt \
|
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 += \
|
2023-08-25 16:57:55 -04: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-11-26 12:36:35 -05:00
|
|
|
$(SODIUM_OBJS_unix): CFLAGS += \
|
2023-10-04 20:52:59 -04:00
|
|
|
-DHAVE_ALLOCA_H
|
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
|
|
|
XOPT_SOURCES := deps/xopt/xopt.c
|
|
|
|
XOPT_OBJS := $(call get_objs,XOPT_SOURCES)
|
2022-05-30 13:24:42 -04:00
|
|
|
$(filter $(BUILD_DIR)/win%,$(XOPT_OBJS)): CFLAGS += \
|
2022-05-16 18:30:14 -04:00
|
|
|
-DHAVE_SNPRINTF \
|
|
|
|
-DHAVE_VSNPRINTF \
|
|
|
|
-DHAVE_VASNPRINTF \
|
|
|
|
-DHAVE_VASPRINTF \
|
|
|
|
-Dvsnprintf=rpl_vsnprintf
|
2023-03-19 16:25:50 -04:00
|
|
|
$(XOPT_OBJS): CFLAGS += \
|
|
|
|
-Wno-implicit-const-int-float-conversion
|
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
|
|
|
|
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
|
2023-10-13 21:56:40 -04:00
|
|
|
debug release $(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
|
2023-10-04 19:41:30 -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) \
|
|
|
|
$(UV_OBJS) \
|
|
|
|
$(XOPT_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))
|
2022-05-30 13:24:42 -04: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 $$@)
|
|
|
|
@echo [c] $$@
|
|
|
|
@$$(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 $$@)
|
|
|
|
@echo [m] $$@
|
|
|
|
@$$(CC) $$(CFLAGS) -c $$< -o $$@
|
|
|
|
|
2022-05-30 13:24:42 -04:00
|
|
|
$(BUILD_DIR)/$(1)/%.o: %.S
|
|
|
|
@mkdir -p $$(dir $$@)
|
|
|
|
@echo [as] $$@
|
|
|
|
@$$(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))
|
|
|
|
@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-06-28 19:23:29 -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)"/' \
|
2023-10-22 13:51:16 -04:00
|
|
|
-e 's/android:minSdkVersion="[[:digit:]]*"/android:minSdkVersion="$(ANDROID_MIN_SDK_VERSION)"/' \
|
|
|
|
-e 's/android:targetSdkVersion="[[:digit:]]*"/android:targetSdkVersion="$(ANDROID_TARGET_SDK_VERSION)"/' \
|
2023-06-28 19:23:29 -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 $@)
|
2023-03-14 23:21:20 -04: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 $@)
|
2023-05-03 20:04:43 -04:00
|
|
|
@echo [aapt2] $@
|
|
|
|
@$(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
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
@$(ANDROID_BUILD_TOOLS)/aapt2 link -I $(ANDROID_PLATFORM)/android.jar out/res/layout_activity_main.xml.flat out/res/drawable_icon.xml.flat --manifest src/android/AndroidManifest.xml -o out/apk/res.apk --java out/gen/
|
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)
|
|
|
|
@echo [javac] $(CLASS_FILES)
|
2023-03-14 23:21:20 -04:00
|
|
|
@javac --release 8 -Xlint:deprecation -classpath $(ANDROID_PLATFORM)/android.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 $@)
|
|
|
|
@echo [d8] $@
|
|
|
|
@$(ANDROID_BUILD_TOOLS)/d8 --$(BUILD_TYPE) --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/ \
|
2023-08-16 20:50:22 -04:00
|
|
|
deps/lit/
|
2023-03-08 12:46:19 -05:00
|
|
|
|
2023-11-26 12:36:35 -05:00
|
|
|
RAW_FILES := $(filter-out apps/gg% apps/welcome% %.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
|
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
|
2023-03-15 19:55:22 -04:00
|
|
|
|
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/
|
2023-03-04 14:10:05 -05:00
|
|
|
@echo [aapt] $@
|
2023-10-22 14:52:20 -04:00
|
|
|
@cp out/android$(BUILD_TYPE)/tildefriends out/apk-arm-$(BUILD_TYPE)/lib/arm64-v8a/tildefriends.so
|
|
|
|
@cp out/android$(BUILD_TYPE)-armv7a/tildefriends out/apk-arm-$(BUILD_TYPE)/lib/armeabi-v7a/tildefriends.so
|
|
|
|
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-arm-$(BUILD_TYPE)/lib/arm64-v8a/tildefriends.so
|
|
|
|
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-arm-$(BUILD_TYPE)/lib/armeabi-v7a/tildefriends.so
|
2023-03-18 08:31:58 -04:00
|
|
|
@cp out/apk/res.apk $@
|
2023-10-20 15:46:20 -04:00
|
|
|
@cp out/apk/classes.dex out/apk-arm-$(BUILD_TYPE)/
|
|
|
|
@cd out/apk-arm-$(BUILD_TYPE) && zip -u ../../$@ -q -9 -r . && cd ../../
|
|
|
|
@zip -u $@ -q -9 -x '*.map' --exclude=apps/gg* --exclude=apps/welcome* -r $(PACKAGE_DIRS) $(RAW_FILES)
|
|
|
|
|
|
|
|
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/
|
2023-10-20 15:46:20 -04:00
|
|
|
@echo [aapt] $@
|
2023-10-22 14:52:20 -04:00
|
|
|
@cp out/android$(BUILD_TYPE)-x86_64/tildefriends out/apk-x86-$(BUILD_TYPE)/lib/x86_64/
|
|
|
|
@cp out/android$(BUILD_TYPE)-x86/tildefriends out/apk-x86-$(BUILD_TYPE)/lib/x86/
|
|
|
|
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-x86-$(BUILD_TYPE)/lib/x86_64/tildefriends
|
|
|
|
@$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-x86-$(BUILD_TYPE)/lib/x86/tildefriends
|
2023-10-20 15:46:20 -04:00
|
|
|
@cp out/apk/res.apk $@
|
|
|
|
@cp out/apk/classes.dex out/apk-x86-$(BUILD_TYPE)/
|
|
|
|
@cd out/apk-x86-$(BUILD_TYPE) && zip -u ../../$@ -q -9 -r . && cd ../../
|
2023-10-19 15:47:55 -04:00
|
|
|
@zip -u $@ -q -9 -x '*.map' --exclude=apps/gg* --exclude=apps/welcome* -r $(PACKAGE_DIRS) $(RAW_FILES)
|
2023-03-04 14:10:05 -05:00
|
|
|
|
2023-03-18 08:31:58 -04:00
|
|
|
out/%.apk: out/apk/%.unsigned.apk
|
2023-03-04 14:10:05 -05:00
|
|
|
@echo [apksigner] $(notdir $@)
|
2023-10-19 14:21:36 -04:00
|
|
|
@$(ANDROID_BUILD_TOOLS)/apksigner sign --ks .keys/android.jks --ks-key-alias androidKey --ks-pass pass:android --key-pass pass:android --out $@ $<
|
2023-03-04 14:10:05 -05:00
|
|
|
|
2023-10-20 15:46:20 -04:00
|
|
|
release-apk: out/TildeFriends-arm-release.apk out/TildeFriends-x86-release.apk
|
|
|
|
.PHONY: release-apk
|
2023-03-07 21:49:41 -05:00
|
|
|
|
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 $<
|
2023-03-18 08:28:48 -04:00
|
|
|
@adb shell am start com.unprompted.tildefriends/.MainActivity
|
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
|
|
|
|
2023-10-15 14:06:31 -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
|
|
|
|
2023-10-19 14:52:56 -04:00
|
|
|
out/tildefriends-%.app/tildefriends: out/%/tildefriends out/tildefriends-%.app/Info.plist out/tildefriends-%.app/tildefriends.png out/tildefriends-%.app/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
|
|
|
|
@echo [ipa] $@
|
|
|
|
@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
|
|
|
|
|
|
|
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
|
|
|
|
|
2021-01-02 13:10:00 -05:00
|
|
|
clean:
|
|
|
|
rm -rf $(BUILD_DIR)
|
|
|
|
.PHONY: clean
|
2023-08-09 19:14:16 -04:00
|
|
|
|
2023-10-20 15:46:20 -04:00
|
|
|
dist: release-apk iosrelease-ipa
|
2023-08-09 19:14:16 -04:00
|
|
|
@echo "[export] $$(svn info --show-item url)"
|
|
|
|
@rm -rf tildefriends-$(VERSION_NUMBER)
|
|
|
|
@svn export -q . tildefriends-$(VERSION_NUMBER)
|
|
|
|
@echo "tildefriends-$(VERSION_NUMBER): $(VERSION_NAME)" > tildefriends-$(VERSION_NUMBER)/VERSION
|
|
|
|
@echo "[tar] tildefriends-$(VERSION_NUMBER).tar.xz"
|
|
|
|
@tar \
|
2023-08-23 17:54:43 -04:00
|
|
|
--exclude=apps/gg* \
|
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 \
|
|
|
|
-caf tildefriends-$(VERSION_NUMBER).tar.xz tildefriends-$(VERSION_NUMBER)
|
|
|
|
@rm -rf tildefriends-$(VERSION_NUMBER)
|
2023-10-20 15:46:20 -04:00
|
|
|
@echo "[cp] TildeFriends-x86-$(VERSION_NUMBER).apk"
|
|
|
|
@cp out/TildeFriends-x86-release.apk TildeFriends-x86-$(VERSION_NUMBER).apk
|
|
|
|
@echo "[cp] TildeFriends-arm-$(VERSION_NUMBER).apk"
|
|
|
|
@cp out/TildeFriends-arm-release.apk TildeFriends-arm-$(VERSION_NUMBER).apk
|
2023-10-19 15:47:55 -04:00
|
|
|
@echo "[cp] TildeFriends-$(VERSION_NUMBER).ipa"
|
|
|
|
@cp out/tildefriends-release.ipa TildeFriends-$(VERSION_NUMBER).ipa
|
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
|