blob: f13c8e95ae1dbf26680ca4f1ca05b3abb428fbba [file] [log] [blame]
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# piglit_top := $(LOCAL_PATH)/../..
piglit_major_version := 1
piglit_minor_version := 0
piglit_patch_version := 0
LOCAL_MODULE := libpiglitutil
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
intermediates:= $(local-intermediates-dir)
LOCAL_CFLAGS := -DPIGLIT_USE_WAFFLE \
-DPIGLIT_USE_OPENGL_ES2 \
-DPIGLIT_USE_OPENGL_ES3 \
-DPIGLIT_HAS_ANDROID \
-DSOURCE_DIR='"piglit";' \
-DWAFFLE_API_VERSION=0x0103 \
-DPIGLIT_HAS_EGL \
LOCAL_C_INCLUDES := . \
bionic \
$(piglit_top)/src \
$(piglit_top)/tests/util \
external/waffle/include/waffle \
$(intermediates)
# config.h is only used by piglit-util.h
# This is wrong in two ways:
# 1) still being generated in $(LOCAL_PATH) rather than $(intermediates) until I can fix up the dependencies for the user's #include
# 2) Can't use the target-specific late-evalutated variable style - my shell complains of missing quotes.
CONFIG_HEADER := $(LOCAL_PATH)/config.h
$(CONFIG_HEADER): $(LOCAL_PATH)/config.h.in
sed -e 's/#cmakedefine HAVE_STRCHRNUL/#define HAVE_STRCHRNUL/' \
-e 's/#cmakedefine HAVE_FOPEN_S//' \
-e 's/#cmakedefine HAVE_SETRLIMIT/#define HAVE_SETRLIMIT/' \
-e 's/#cmakedefine HAVE_ASPRINTF/#define HAVE_ASPRINTF/' \
-e 's/#cmakedefine HAVE_FFS/#define HAVE_FFS/' \
-e 's/#cmakedefine HAVE_STRNDUP/#define HAVE_STRNDUP/' \
-e 's/#cmakedefine HAVE_FCNTL_H/#define HAVE_FCNTL_H/' \
-e 's/#cmakedefine HAVE_SYS_STAT_H/#define HAVE_SYS_STAT_H/' \
-e 's/#cmakedefine HAVE_SYS_TYPES_H/#define HAVE_SYS_TYPES_H/' \
-e 's/#cmakedefine HAVE_SYS_TIME_H/#define HAVE_SYS_TIME_H/' \
-e 's/#cmakedefine HAVE_SYS_RESOURCE_H/#define HAVE_SYS_RESOURCE_H/' \
-e 's/#cmakedefine HAVE_UNISTD_H/#define HAVE_UNISTD_H/' $< > $@
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(CONFIG_HEADER)
# Use a pattern match rule to account for simulataneous .c and .h file creation
# Don't add the .c file to the generated sources list otherwise Android will also generate a .o rule for that as well
# Make the intermediates also depend on the scripts (so they get rebuilt is the .py files change as well)
# Ensure that the arguments for gen_dispatch are in the correct order (.c _then_ .h file)
intermediates:= $(local-generated-sources-dir)
GEN_PIGLIT_DISPATCH_DIR := $(LOCAL_PATH)
GEN_DISPATCH := $(GEN_PIGLIT_DISPATCH_DIR)/%.h $(GEN_PIGLIT_DISPATCH_DIR)/%.c
GEN_HEADER := $(GEN_PIGLIT_DISPATCH_DIR)/%.h
$(GEN_DISPATCH): PRIVATE_CUSTOM_TOOL = python $+ --out-dir $(GEN_PIGLIT_DISPATCH_DIR)
$(GEN_DISPATCH): $(LOCAL_PATH)/gen_dispatch.py
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN_HEADER)
LOCAL_SRC_FILES := \
fdo-bitmap.c \
minmax-test.c \
piglit-dispatch.c \
piglit-dispatch-init.c \
piglit-fbo.cpp \
piglit-matrix.c \
piglit-util-gl.c \
piglit-vbo.cpp \
piglit-framework-gl.c \
piglit-framework-gl/piglit_gl_framework.c \
piglit-framework-gl/piglit_fbo_framework.c \
piglit-framework-gl/piglit_wfl_framework.c \
piglit-framework-gl/piglit_winsys_framework.c \
piglit-framework-gl/piglit_gbm_framework.c \
piglit-framework-gl/piglit_wl_framework.c \
piglit-framework-gl/piglit_android_framework.c \
piglit-shader.c \
piglit_ktx.c \
rgb9e5.c \
r11g11b10f.c \
sized-internalformats.c \
piglit-util-waffle.c \
piglit-util.c \
piglit-log.c \
piglit-util-gl-enum-gen.c \
# piglit-test-pattern.cpp \
LOCAL_SHARED_LIBRARIES := \
libEGL \
libGLESv2 \
libwaffle-1 \
libstdc++ \
LOCAL_COPY_HEADERS := \
glxew.h \
piglit-framework-gl.h \
piglit-util-egl.h \
minmax-test.h \
piglit-glx-util.h \
piglit-dispatch.h \
piglit_ktx.h \
piglit-util.h \
piglit-framework-cl-api.h \
piglit-shader.h \
piglit-util-waffle.h \
piglit-framework-cl-custom.h \
piglit-util-cl-enum.h \
piglit-vbo.h \
piglit-framework-cl.h \
piglit-util-cl.h \
rgb9e5.h \
piglit-framework-cl-program.h \
piglit-util-compressed-grays.h \
sized-internalformats.h \
LOCAL_COPY_HEADERS_TO := piglit-$(piglit_major_version)
include $(BUILD_SHARED_LIBRARY)