@@ -12,11 +12,6 @@ common_cflags := \
-Wall -Wshadow -O2 \
-pipe -fno-strict-aliasing \
-common_includes := \
- $(LOCAL_PATH)/ \
- $(LOCAL_PATH)/../libsepol/include/ \
- $(LOCAL_PATH)/../libsepol/src/ \
-
##
# checkpolicy
#
@@ -24,7 +19,6 @@ include $(CLEAR_VARS)
LOCAL_MODULE := checkpolicy
LOCAL_MODULE_TAGS := optional
-LOCAL_C_INCLUDES := $(common_includes)
LOCAL_CFLAGS := $(common_cflags)
LOCAL_SRC_FILES := $(common_src_files) checkpolicy.c
LOCAL_STATIC_LIBRARIES := libsepol
@@ -41,7 +35,6 @@ include $(CLEAR_VARS)
LOCAL_MODULE := checkmodule
LOCAL_MODULE_TAGS := optional
-LOCAL_C_INCLUDES := $(common_includes)
LOCAL_CFLAGS := $(common_cflags)
LOCAL_SRC_FILES := $(common_src_files) checkmodule.c
LOCAL_STATIC_LIBRARIES := libsepol
@@ -57,7 +50,6 @@ include $(CLEAR_VARS)
LOCAL_MODULE := dispol
LOCAL_MODULE_TAGS := optional
-LOCAL_C_INCLUDES := $(common_includes)
LOCAL_CFLAGS := $(common_cflags)
LOCAL_SRC_FILES := test/dispol.c
LOCAL_STATIC_LIBRARIES := libsepol
@@ -93,7 +93,9 @@ LOCAL_C_INCLUDES := $(common_includes)
LOCAL_CFLAGS := $(common_cflags)
LOCAL_CPPFLAGS := $(yacc_flags)
LOCAL_SRC_FILES := $(common_src_files) $(cil_src_files)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
+LOCAL_EXPORT_C_INCLUDE_DIRS := \
+ $(LOCAL_PATH)/include \
+ $(LOCAL_PATH)/cil/include
include $(BUILD_HOST_SHARED_LIBRARY)
@@ -108,7 +110,9 @@ LOCAL_C_INCLUDES := $(common_includes)
LOCAL_CFLAGS := $(common_cflags)
LOCAL_CPPFLAGS := $(yacc_flags)
LOCAL_SRC_FILES := $(common_src_files) $(cil_src_files)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
+LOCAL_EXPORT_C_INCLUDE_DIRS := \
+ $(LOCAL_PATH)/include \
+ $(LOCAL_PATH)/cil/include
include $(BUILD_HOST_STATIC_LIBRARY)
@@ -132,7 +136,10 @@ LOCAL_MODULE := libsepol
LOCAL_MODULE_TAGES := optional
LOCAL_C_INCLUDES := $(common_includes)
LOCAL_CFLAGS := $(common_cflags)
-LOCAL_SRC_FILES := $(common_src_files)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
+LOCAL_CPPFLAGS := $(yacc_flags)
+LOCAL_SRC_FILES := $(common_src_files) $(cil_src_files)
+LOCAL_EXPORT_C_INCLUDE_DIRS := \
+ $(LOCAL_PATH)/include \
+ $(LOCAL_PATH)/cil/include
include $(BUILD_STATIC_LIBRARY)
@@ -6,21 +6,30 @@ common_cflags := \
-Wall -Wshadow -O2 \
-pipe -fno-strict-aliasing \
-common_includes := \
- $(LOCAL_PATH)/../libsepol/cil/include/ \
- $(LOCAL_PATH)/../libsepol/include/ \
-
##
-# secilc
+# secilc on the host.
#
include $(CLEAR_VARS)
LOCAL_MODULE := secilc
LOCAL_MODULE_TAGS := optional
-LOCAL_C_INCLUDES := $(common_includes)
LOCAL_CFLAGS := $(common_cflags)
LOCAL_SRC_FILES := secilc.c
LOCAL_SHARED_LIBRARIES := libsepol
LOCAL_MODULE_CLASS := EXECUTABLES
include $(BUILD_HOST_EXECUTABLE)
+
+##
+# secilc on the target.
+#
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := secilc
+LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS := $(common_cflags)
+LOCAL_SRC_FILES := secilc.c
+LOCAL_STATIC_LIBRARIES := libsepol
+LOCAL_MODULE_CLASS := EXECUTABLES
+
+include $(BUILD_EXECUTABLE)
@@ -35,7 +35,7 @@
#include <sys/stat.h>
#ifdef ANDROID
-#include <sepol/cil.h>
+#include <cil/cil.h>
#else
#include <sepol/cil/cil.h>
#endif
From: bowgotsai <bowgotsai@google.com> Also clean up some LOCAL_C_INCLUDES as it should be included by LOCAL_EXPORT_C_INCLUDE_DIRS from libsepol. BUG=31366888 Change-Id: I0e21279097f0635761672b838ad26861fc49e9ea --- checkpolicy/Android.mk | 8 -------- libsepol/Android.mk | 15 +++++++++++---- secilc/Android.mk | 21 +++++++++++++++------ secilc/secilc.c | 2 +- 4 files changed, 27 insertions(+), 19 deletions(-)