# Makefile for building dynamic libraries for Android NDK and x86 # Compiler settings NDK_PATH = /usr/local/android-ndk-r19c NDK_TOOLCHAIN = $(NDK_PATH)/toolchains/llvm/prebuilt/linux-x86_64/bin NDK_CC = $(NDK_TOOLCHAIN)/armv7a-linux-androideabi28-clang GCC = gcc # Compiler flags CFLAGS = -shared -fPIC -g -O2 -Wall -I./ COMM_FLAGS = -DHAVE_CONFIG_H NDK_FLAGS = -DHAVE_ANDROID_H X86_FLAGS = -DDEBUG -DNODLOPEN # Source files SOURCES = bwstat.c atomicio.c strlcpy.c strlcat.c trickle-overload.c # Output files NDK = ndk X86 = x86 NDK_OUT = trickle-overload-ndk.so X86_OUT = trickle-overload-x86.so # Default target all: $(NDK) $(X86) # Rule for NDK dynamic library $(NDK): $(SOURCES) $(NDK_CC) $(CFLAGS) $^ -o $(NDK_OUT) $(COMM_FLAGS) $(NDK_FLAGS) # Rule for x86 dynamic library $(X86): $(SOURCES) $(GCC) $(CFLAGS) $^ -o $(X86_OUT) $(COMM_FLAGS) $(X86_FLAGS) # Clean up clean: rm -f $(NDK_OUT) $(X86_OUT) .PHONY: all clean