CROSS_COMPILE ?= CC := $(CROSS_COMPILE)gcc STRIP := $(CROSS_COMPILE)strip NDK_BUILD := /usr/lib/android-ndk/ndk-build OBJ := httpdns #如果是安卓编译 ifeq ($(ANDROID_DATA),/data) CFLAGS := -O2 -pie SHELL := /system/bin/sh else CFLAGS := -O2 -pthread -Wall -static endif all : main.o common.o httpdns.o conf.o $(CC) $(CFLAGS) $(DEFS) -o $(OBJ) $^ $(STRIP) $(OBJ) -chmod 777 $(OBJ) 2>&- .c.o : $(CC) $(CFLAGS) $(DEFS) -c $< clean : rm -f *.o rm $(OBJ) android: $(NDK_BUILD) NDK_PROJECT_PATH=. NDK_APPLICATION_MK=Application.mk APP_BUILD_SCRIPT=Android.mk