diff options
Diffstat (limited to 'mesalib/src/util')
-rw-r--r-- | mesalib/src/util/Android.mk | 42 | ||||
-rw-r--r-- | mesalib/src/util/macros.h | 2 |
2 files changed, 18 insertions, 26 deletions
diff --git a/mesalib/src/util/Android.mk b/mesalib/src/util/Android.mk index 6b38cf9af..a39185ae4 100644 --- a/mesalib/src/util/Android.mk +++ b/mesalib/src/util/Android.mk @@ -36,27 +36,22 @@ LOCAL_SRC_FILES := \ LOCAL_C_INCLUDES := \ $(MESA_TOP)/src/mesa \ $(MESA_TOP)/src/mapi \ - $(MESA_TOP)/src + $(MESA_TOP)/src/gallium/include \ + $(MESA_TOP)/src/gallium/auxiliary LOCAL_MODULE := libmesa_util # Generated sources -ifeq ($(LOCAL_MODULE_CLASS),) LOCAL_MODULE_CLASS := STATIC_LIBRARIES -endif -intermediates := $(call local-intermediates-dir) +intermediates := $(call local-generated-sources-dir) +LOCAL_GENERATED_SOURCES := $(addprefix $(intermediates)/,$(MESA_UTIL_GENERATED_FILES)) -# This is the list of auto-generated files: sources and headers -sources := $(addprefix $(intermediates)/, $(MESA_UTIL_GENERATED_FILES)) - -LOCAL_GENERATED_SOURCES += $(sources) - -FORMAT_SRGB := $(LOCAL_PATH)/format_srgb.py - -$(intermediates)/format_srgb.c: $(FORMAT_SRGB) - @$(MESA_PYTHON2) $(FORMAT_SRGB) $< > $@ +$(LOCAL_GENERATED_SOURCES): PRIVATE_PYTHON := $(MESA_PYTHON2) +$(LOCAL_GENERATED_SOURCES): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PYTHON) $^ > $@ +$(LOCAL_GENERATED_SOURCES): $(intermediates)/%.c: $(LOCAL_PATH)/%.py + $(transform-generated-source) include $(MESA_COMMON_MK) include $(BUILD_STATIC_LIBRARY) @@ -76,27 +71,22 @@ LOCAL_SRC_FILES := \ LOCAL_C_INCLUDES := \ $(MESA_TOP)/src/mesa \ $(MESA_TOP)/src/mapi \ - $(MESA_TOP)/src + $(MESA_TOP)/src/gallium/include \ + $(MESA_TOP)/src/gallium/auxiliary LOCAL_MODULE := libmesa_util # Generated sources -ifeq ($(LOCAL_MODULE_CLASS),) LOCAL_MODULE_CLASS := STATIC_LIBRARIES -endif - -intermediates := $(call local-intermediates-dir) - -# This is the list of auto-generated files: sources and headers -sources := $(addprefix $(intermediates)/, $(MESA_UTIL_GENERATED_FILES)) - -LOCAL_GENERATED_SOURCES += $(sources) -FORMAT_SRGB := $(LOCAL_PATH)/format_srgb.py +intermediates := $(call local-generated-sources-dir) +LOCAL_GENERATED_SOURCES := $(addprefix $(intermediates)/,$(MESA_UTIL_GENERATED_FILES)) -$(intermediates)/format_srgb.c: $(FORMAT_SRGB) - @$(MESA_PYTHON2) $(FORMAT_SRGB) $< > $@ +$(LOCAL_GENERATED_SOURCES): PRIVATE_PYTHON := $(MESA_PYTHON2) +$(LOCAL_GENERATED_SOURCES): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PYTHON) $^ > $@ +$(LOCAL_GENERATED_SOURCES): $(intermediates)/%.c: $(LOCAL_PATH)/%.py + $(transform-generated-source) include $(MESA_COMMON_MK) include $(BUILD_HOST_STATIC_LIBRARY) diff --git a/mesalib/src/util/macros.h b/mesalib/src/util/macros.h index 6c7bda7ae..3b708ed6a 100644 --- a/mesalib/src/util/macros.h +++ b/mesalib/src/util/macros.h @@ -182,5 +182,7 @@ do { \ #define UNUSED #endif +/** Compute ceiling of integer quotient of A divided by B. */ +#define DIV_ROUND_UP( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 ) #endif /* UTIL_MACROS_H */ |