1LOCAL_PATH:= $(call my-dir) 2 3# We need to build this for both the device (as a shared library) 4# and the host (as a static library for tools to use). 5 6common_SRC_FILES := \ 7 png.c \ 8 pngerror.c \ 9 pnggccrd.c \ 10 pngget.c \ 11 pngmem.c \ 12 pngpread.c \ 13 pngread.c \ 14 pngrio.c \ 15 pngrtran.c \ 16 pngrutil.c \ 17 pngset.c \ 18 pngtrans.c \ 19 pngvcrd.c \ 20 pngwio.c \ 21 pngwrite.c \ 22 pngwtran.c \ 23 pngwutil.c 24 25common_CFLAGS := -std=gnu89 -fvisibility=hidden ## -fomit-frame-pointer 26 27ifeq ($(HOST_OS),windows) 28 ifeq ($(USE_MINGW),) 29 # Case where we're building windows but not under linux (so it must be cygwin) 30 # In this case, gcc cygwin doesn't recognize -fvisibility=hidden 31 $(info libpng: Ignoring gcc flag $(common_CFLAGS) on Cygwin) 32 common_CFLAGS := 33 endif 34endif 35 36common_C_INCLUDES += 37 38common_COPY_HEADERS_TO := libpng 39common_COPY_HEADERS := png.h pngconf.h pngusr.h 40 41# For the host 42# ===================================================== 43 44include $(CLEAR_VARS) 45 46LOCAL_SRC_FILES := $(common_SRC_FILES) 47LOCAL_CFLAGS += $(common_CFLAGS) 48LOCAL_C_INCLUDES += $(common_C_INCLUDES) external/zlib 49 50LOCAL_MODULE:= libpng 51 52LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO) 53LOCAL_COPY_HEADERS := $(common_COPY_HEADERS) 54 55include $(BUILD_HOST_STATIC_LIBRARY) 56 57 58# For the device 59# ===================================================== 60 61include $(CLEAR_VARS) 62LOCAL_CLANG := true 63LOCAL_SRC_FILES := $(common_SRC_FILES) 64LOCAL_CFLAGS += $(common_CFLAGS) -ftrapv 65LOCAL_C_INCLUDES += $(common_C_INCLUDES) \ 66 external/zlib 67LOCAL_SHARED_LIBRARIES := \ 68 libz 69 70LOCAL_MODULE:= libpng 71 72LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO) 73LOCAL_COPY_HEADERS := $(common_COPY_HEADERS) 74 75include $(BUILD_STATIC_LIBRARY) 76 77# For testing 78# ===================================================== 79 80include $(CLEAR_VARS) 81LOCAL_C_INCLUDES:= $(common_C_INCLUDES) external/zlib 82LOCAL_SRC_FILES:= $(common_SRC_FILES) pngtest.c 83LOCAL_MODULE := pngtest 84LOCAL_SHARED_LIBRARIES:= libz 85LOCAL_MODULE_TAGS := debug 86include $(BUILD_EXECUTABLE) 87