blob: 598a87ade6c2fe76638a2a16c1fa6f97c67114f0 [file] [log] [blame]
The Android Open Source Project893912b2009-03-03 19:30:05 -08001LOCAL_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
Stephen Hinesdeba48b2012-08-03 17:25:20 -070025common_CFLAGS := -std=gnu89 -fvisibility=hidden ## -fomit-frame-pointer
The Android Open Source Project893912b2009-03-03 19:30:05 -080026
Raphael Moll671f9cd2011-02-09 12:43:48 -080027ifeq ($(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 +=
The Android Open Source Project893912b2009-03-03 19:30:05 -080037
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
Stephen Hinesb5e7fb42013-06-26 15:15:33 -070058# For the device (static)
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
72include $(BUILD_STATIC_LIBRARY)
73
74# For the device (shared)
The Android Open Source Project893912b2009-03-03 19:30:05 -080075# =====================================================
76
77include $(CLEAR_VARS)
Stephen Hinesdeba48b2012-08-03 17:25:20 -070078LOCAL_CLANG := true
The Android Open Source Project893912b2009-03-03 19:30:05 -080079LOCAL_SRC_FILES := $(common_SRC_FILES)
Geremy Condra14cab862012-06-05 15:17:48 -070080LOCAL_CFLAGS += $(common_CFLAGS) -ftrapv
The Android Open Source Project893912b2009-03-03 19:30:05 -080081LOCAL_C_INCLUDES += $(common_C_INCLUDES) \
82 external/zlib
83LOCAL_SHARED_LIBRARIES := \
84 libz
85
86LOCAL_MODULE:= libpng
87
88LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO)
89LOCAL_COPY_HEADERS := $(common_COPY_HEADERS)
90
Stephen Hinesb5e7fb42013-06-26 15:15:33 -070091include $(BUILD_SHARED_LIBRARY)
The Android Open Source Project893912b2009-03-03 19:30:05 -080092
Geremy Condra14cab862012-06-05 15:17:48 -070093# For testing
94# =====================================================
The Android Open Source Project893912b2009-03-03 19:30:05 -080095
Geremy Condra14cab862012-06-05 15:17:48 -070096include $(CLEAR_VARS)
Stephen Hinesb5e7fb42013-06-26 15:15:33 -070097LOCAL_CLANG := true
Geremy Condra14cab862012-06-05 15:17:48 -070098LOCAL_C_INCLUDES:= $(common_C_INCLUDES) external/zlib
Stephen Hinesb5e7fb42013-06-26 15:15:33 -070099LOCAL_SRC_FILES:= pngtest.c
Geremy Condra14cab862012-06-05 15:17:48 -0700100LOCAL_MODULE := pngtest
Stephen Hinesb5e7fb42013-06-26 15:15:33 -0700101LOCAL_SHARED_LIBRARIES:= libpng libz
Geremy Condra14cab862012-06-05 15:17:48 -0700102LOCAL_MODULE_TAGS := debug
103include $(BUILD_EXECUTABLE)