The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 1 | LOCAL_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 | |
| 6 | common_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 | |
Stephen Hines | deba48b | 2012-08-03 17:25:20 -0700 | [diff] [blame] | 25 | common_CFLAGS := -std=gnu89 -fvisibility=hidden ## -fomit-frame-pointer |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 26 | |
Raphael Moll | 671f9cd | 2011-02-09 12:43:48 -0800 | [diff] [blame] | 27 | ifeq ($(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 |
| 34 | endif |
| 35 | |
| 36 | common_C_INCLUDES += |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 37 | |
| 38 | common_COPY_HEADERS_TO := libpng |
| 39 | common_COPY_HEADERS := png.h pngconf.h pngusr.h |
| 40 | |
| 41 | # For the host |
| 42 | # ===================================================== |
| 43 | |
| 44 | include $(CLEAR_VARS) |
| 45 | |
| 46 | LOCAL_SRC_FILES := $(common_SRC_FILES) |
| 47 | LOCAL_CFLAGS += $(common_CFLAGS) |
| 48 | LOCAL_C_INCLUDES += $(common_C_INCLUDES) external/zlib |
| 49 | |
| 50 | LOCAL_MODULE:= libpng |
| 51 | |
| 52 | LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO) |
| 53 | LOCAL_COPY_HEADERS := $(common_COPY_HEADERS) |
| 54 | |
| 55 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 56 | |
| 57 | |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame^] | 58 | # For the device (static) |
| 59 | # ===================================================== |
| 60 | |
| 61 | include $(CLEAR_VARS) |
| 62 | LOCAL_CLANG := true |
| 63 | LOCAL_SRC_FILES := $(common_SRC_FILES) |
| 64 | LOCAL_CFLAGS += $(common_CFLAGS) -ftrapv |
| 65 | LOCAL_C_INCLUDES += $(common_C_INCLUDES) \ |
| 66 | external/zlib |
| 67 | LOCAL_SHARED_LIBRARIES := \ |
| 68 | libz |
| 69 | |
| 70 | LOCAL_MODULE:= libpng |
| 71 | |
| 72 | include $(BUILD_STATIC_LIBRARY) |
| 73 | |
| 74 | # For the device (shared) |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 75 | # ===================================================== |
| 76 | |
| 77 | include $(CLEAR_VARS) |
Stephen Hines | deba48b | 2012-08-03 17:25:20 -0700 | [diff] [blame] | 78 | LOCAL_CLANG := true |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 79 | LOCAL_SRC_FILES := $(common_SRC_FILES) |
Geremy Condra | 14cab86 | 2012-06-05 15:17:48 -0700 | [diff] [blame] | 80 | LOCAL_CFLAGS += $(common_CFLAGS) -ftrapv |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 81 | LOCAL_C_INCLUDES += $(common_C_INCLUDES) \ |
| 82 | external/zlib |
| 83 | LOCAL_SHARED_LIBRARIES := \ |
| 84 | libz |
| 85 | |
| 86 | LOCAL_MODULE:= libpng |
| 87 | |
| 88 | LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO) |
| 89 | LOCAL_COPY_HEADERS := $(common_COPY_HEADERS) |
| 90 | |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame^] | 91 | include $(BUILD_SHARED_LIBRARY) |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 92 | |
Geremy Condra | 14cab86 | 2012-06-05 15:17:48 -0700 | [diff] [blame] | 93 | # For testing |
| 94 | # ===================================================== |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 95 | |
Geremy Condra | 14cab86 | 2012-06-05 15:17:48 -0700 | [diff] [blame] | 96 | include $(CLEAR_VARS) |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame^] | 97 | LOCAL_CLANG := true |
Geremy Condra | 14cab86 | 2012-06-05 15:17:48 -0700 | [diff] [blame] | 98 | LOCAL_C_INCLUDES:= $(common_C_INCLUDES) external/zlib |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame^] | 99 | LOCAL_SRC_FILES:= pngtest.c |
Geremy Condra | 14cab86 | 2012-06-05 15:17:48 -0700 | [diff] [blame] | 100 | LOCAL_MODULE := pngtest |
Stephen Hines | b5e7fb4 | 2013-06-26 15:15:33 -0700 | [diff] [blame^] | 101 | LOCAL_SHARED_LIBRARIES:= libpng libz |
Geremy Condra | 14cab86 | 2012-06-05 15:17:48 -0700 | [diff] [blame] | 102 | LOCAL_MODULE_TAGS := debug |
| 103 | include $(BUILD_EXECUTABLE) |