CROSS_COMPILE ?= CC := $(CROSS_COMPILE)gcc STRIP := $(CROSS_COMPILE)strip OBJ := httpudp #如果是安卓编译 ifeq ($(ANDROID_DATA),/data) CFLAGS := -O2 -pie SHELL := /system/bin/sh else CFLAGS := -O2 -pthread -Wall endif all : main.o conf.o common.o httpudp.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: /usr/lib/android-ndk/ndk-build NDK_PROJECT_PATH=. NDK_APPLICATION_MK=Application.mk APP_BUILD_SCRIPT=Android.mk