Home | History | Annotate | Download | only in libpng
      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 
     25 common_CFLAGS := -std=gnu89 -fvisibility=hidden ## -fomit-frame-pointer
     26 
     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 += 
     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 
     58 # For the device
     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 LOCAL_COPY_HEADERS_TO := $(common_COPY_HEADERS_TO)
     73 LOCAL_COPY_HEADERS := $(common_COPY_HEADERS)
     74 
     75 include $(BUILD_STATIC_LIBRARY)
     76 
     77 # For testing
     78 # =====================================================
     79 
     80 include $(CLEAR_VARS)
     81 LOCAL_C_INCLUDES:= $(common_C_INCLUDES) external/zlib
     82 LOCAL_SRC_FILES:= $(common_SRC_FILES) pngtest.c
     83 LOCAL_MODULE := pngtest
     84 LOCAL_SHARED_LIBRARIES:= libz
     85 LOCAL_MODULE_TAGS := debug
     86 include $(BUILD_EXECUTABLE)
     87