From d021d9f75759fc381ef7d822306cc359e3639fa5 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Thu, 8 Feb 2024 00:17:30 +0000 Subject: [PATCH] Automate fetching sqlite. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4830 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- GNUmakefile | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 8feaad37..9ca364f2 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -647,34 +647,34 @@ $(1): $(BUILD_DIR)/$(1)/$(PROJECT)$(if $(filter win%,$(1)),.exe) .PHONY: $(1) $(BUILD_DIR)/$(1)/$(PROJECT)$(if $(filter win%,$(1)),.exe): $(filter $(BUILD_DIR)/$(1)/%,$(ALL_APP_OBJS)) - @echo [link] $$@ + @echo "[link] $$@" @$$(CC) -o $$@ $$^ $$(LDFLAGS) $(BUILD_DIR)/$(1)/%.o: %.c @mkdir -p $$(dir $$@) - @echo [c] $$@ + @echo "[c] $$@" @$$(CC) $$(CFLAGS) -c $$< -o $$@ $(BUILD_DIR)/$(1)/%.o: %.m @mkdir -p $$(dir $$@) - @echo [m] $$@ + @echo "[m] $$@" @$$(CC) $$(CFLAGS) -c $$< -o $$@ $(BUILD_DIR)/$(1)/%.o: %.S @mkdir -p $$(dir $$@) - @echo [as] $$@ + @echo "[as] $$@" @$$(AS) -c $$< -o $$@ endef $(foreach build_type,$(BUILD_TYPES),$(eval $(call build_rules,$(build_type)))) src/version.h : $(firstword $(MAKEFILE_LIST)) - @echo [version] $@ + @echo "[version] $@" @echo "#define VERSION_NUMBER \"$(VERSION_NUMBER)\"" > $@ @echo "#define VERSION_NAME \"$(VERSION_NAME)\"" >> $@ src/android/AndroidManifest.xml : $(firstword $(MAKEFILE_LIST)) - @echo [android_version] $@ + @echo "[android_version] $@" @sed -i \ -e 's/versionCode=".*"/versionCode="$(VERSION_CODE)"/' \ -e 's/versionName=".*"/versionName="$(VERSION_NUMBER)"/' \ @@ -685,12 +685,12 @@ src/android/AndroidManifest.xml : $(firstword $(MAKEFILE_LIST)) # Android support. out/res/layout_activity_main.xml.flat: src/android/res/layout/activity_main.xml @mkdir -p $(dir $@) - @echo [aapt2] $@ + @echo "[aapt2] $@" @$(ANDROID_BUILD_TOOLS)/aapt2 compile -o out/res/ src/android/res/layout/activity_main.xml out/res/drawable_icon.xml.flat: src/android/res/drawable/icon.xml @mkdir -p $(dir $@) - @echo [aapt2] $@ + @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 @@ -701,12 +701,12 @@ JAVA_FILES := out/gen/com/unprompted/tildefriends/R.java $(wildcard src/android/ CLASS_FILES := $(foreach src,$(JAVA_FILES),out/classes/com/unprompted/tildefriends/$(notdir $(src:.java=.class))) $(CLASS_FILES) &: $(JAVA_FILES) - @echo [javac] $(CLASS_FILES) + @echo "[javac] $(CLASS_FILES)" @javac --release 8 -Xlint:deprecation -classpath $(ANDROID_PLATFORM)/android.jar -d out/classes $(JAVA_FILES) out/apk/classes.dex: $(CLASS_FILES) @mkdir -p $(dir $@) - @echo [d8] $@ + @echo "[d8] $@" @$(ANDROID_BUILD_TOOLS)/d8 --$(BUILD_TYPE) --lib $(ANDROID_PLATFORM)/android.jar --output $(dir $@) out/classes/com/unprompted/tildefriends/*.class PACKAGE_DIRS := \ @@ -729,7 +729,7 @@ out/apk/TildeFriends-x86-release.unsigned.apk: out/apk/classes.dex out/androidre out/apk/TildeFriends-arm-%.unsigned.apk: @mkdir -p $(dir $@) out/apk-arm-$(BUILD_TYPE)/lib/arm64-v8a/ out/apk-arm-$(BUILD_TYPE)/lib/armeabi-v7a/ - @echo [aapt] $@ + @echo "[aapt] $@" @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 @@ -741,7 +741,7 @@ out/apk/TildeFriends-arm-%.unsigned.apk: out/apk/TildeFriends-x86-%.unsigned.apk: @mkdir -p $(dir $@) out/apk-x86-$(BUILD_TYPE)/lib/x86_64/ out/apk-x86-$(BUILD_TYPE)/lib/x86/ - @echo [aapt] $@ + @echo "[aapt] $@" @cp out/android$(BUILD_TYPE)-x86_64/tildefriends out/apk-x86-$(BUILD_TYPE)/lib/x86_64/tildefriends.so @cp out/android$(BUILD_TYPE)-x86/tildefriends out/apk-x86-$(BUILD_TYPE)/lib/x86/tildefriends.so @$(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip out/apk-x86-$(BUILD_TYPE)/lib/x86_64/tildefriends.so @@ -752,7 +752,7 @@ out/apk/TildeFriends-x86-%.unsigned.apk: @zip -u $@ -q -9 $(RAW_FILES) out/%.apk: out/apk/%.unsigned.apk - @echo [apksigner] $(notdir $@) + @echo "[apksigner] $(notdir $@)" @$(ANDROID_BUILD_TOOLS)/apksigner sign --ks .keys/android.jks --ks-key-alias androidKey --ks-pass pass:android --key-pass pass:android --out $@ $< release-apk: out/TildeFriends-arm-release.apk out/TildeFriends-x86-release.apk @@ -782,7 +782,7 @@ ifeq ($(HAVE_LINUX_IOS),1) endif .SECONDARY: out/tildefriends-%.ipa: out/tildefriends-ios%.app/tildefriends - @echo [ipa] $@ + @echo "[ipa] $@" @rm -rf $@.tmp $@ @mkdir -p $@.tmp/Payload/tildefriends.app/ @cp -R $(dir $<)/* $@.tmp/Payload/tildefriends.app/ @@ -811,10 +811,16 @@ apklog: .PHONY: apklog fetchdeps: - rm -rfv deps/libuv/ - mkdir -p out/deps/ deps/libuv/ - test -f out/deps/libuv.tar.gz || curl -q https://dist.libuv.org/dist/v1.48.0/libuv-v1.48.0.tar.gz -o out/deps/libuv.tar.gz - tar -C deps/libuv/ --strip=1 -xvf out/deps/libuv.tar.gz + @echo "[fetch] libuv" + @rm -rf deps/libuv/ + @mkdir -p out/deps/ deps/libuv/ + @test -f out/deps/libuv.tar.gz || curl -q https://dist.libuv.org/dist/v1.48.0/libuv-v1.48.0.tar.gz -o out/deps/libuv.tar.gz + @tar -C deps/libuv/ -m --strip=1 -xf out/deps/libuv.tar.gz + @echo "[fetch] sqlite" + @rm -rf deps/sqlite/ + @mkdir -p out/deps/ deps/sqlite/ + @test -f out/deps/sqlite.zip || curl -q https://www.sqlite.org/2024/sqlite-amalgamation-3450100.zip -o out/deps/sqlite.zip + @unzip -qDj -d deps/sqlite/ out/deps/sqlite.zip .PHONE: fetchdeps clean: