Skip to content

Commit

Permalink
Cleanup Android.mk
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Feb 28, 2017
1 parent a96d57f commit d7c6efa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 114 deletions.
27 changes: 8 additions & 19 deletions libselinux/Android.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
LOCAL_PATH:= $(call my-dir)

common_SRC_FILES := \
##
# libselinux.a
#

include $(CLEAR_VARS)
LOCAL_MODULE:= libselinux
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/ $(LOCAL_PATH)/../libsepol/include/
LOCAL_SRC_FILES := \
src/booleans.c \
src/canonicalize_context.c \
src/disable.c \
Expand Down Expand Up @@ -32,24 +39,6 @@ common_SRC_FILES := \
src/freecon.c \
src/setrans_client.c

common_HOST_FILES := \
src/callbacks.c \
src/check_context.c \
src/freecon.c \
src/init.c \
src/label.c \
src/label_file.c \
src/label_android_property.c


common_COPY_HEADERS_TO := selinux
common_COPY_HEADERS := include/selinux/selinux.h include/selinux/label.h include/selinux/context.h include/selinux/avc.h

include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(common_SRC_FILES)
LOCAL_MODULE:= libselinux
LOCAL_MODULE_TAGS := eng
LOCAL_C_INCLUDES := jni/selinux/libselinux/include/ jni/selinux/libsepol/include/
# 1003 corresponds to auditd, from system/core/logd/event.logtags
LOCAL_CFLAGS := -DAUDITD_LOG_TAG=1003
include $(BUILD_STATIC_LIBRARY)
107 changes: 12 additions & 95 deletions libsepol/Android.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
LOCAL_PATH:= $(call my-dir)

common_src_files := \
##
# libsepol.a
#

include $(CLEAR_VARS)
LOCAL_MODULE := libsepol
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/ $(LOCAL_PATH)/src/
LOCAL_CFLAGS := -D_GNU_SOURCE \
-Wall -W -Wundef \
-Wshadow -Wmissing-noreturn \
-Wmissing-format-attribute
LOCAL_SRC_FILES := \
src/assertion.c \
src/avrule_block.c \
src/avtab.c \
Expand Down Expand Up @@ -42,98 +53,4 @@ common_src_files := \
src/util.c \
src/write.c

cil_src_files := \
cil/src/cil_binary.c \
cil/src/cil_build_ast.c \
cil/src/cil.c \
cil/src/cil_copy_ast.c \
cil/src/cil_find.c \
cil/src/cil_fqn.c \
cil/src/cil_lexer.l \
cil/src/cil_list.c \
cil/src/cil_log.c \
cil/src/cil_mem.c \
cil/src/cil_parser.c \
cil/src/cil_policy.c \
cil/src/cil_post.c \
cil/src/cil_reset_ast.c \
cil/src/cil_resolve_ast.c \
cil/src/cil_stack.c \
cil/src/cil_strpool.c \
cil/src/cil_symtab.c \
cil/src/cil_tree.c \
cil/src/cil_verify.c

common_cflags := \
-D_GNU_SOURCE \
-Wall -W -Wundef \
-Wshadow -Wmissing-noreturn \
-Wmissing-format-attribute

common_includes := \
$(LOCAL_PATH)/include/ \
$(LOCAL_PATH)/src/
# $(LOCAL_PATH)/cil/include/ \
# $(LOCAL_PATH)/cil/src/ \
##
# "-x c" forces the lex/yacc files to be compiled as c the build system
# otherwise forces them to be c++. Need to also add an explicit -std because the
# build system will soon default C++ to -std=c++11.
yacc_flags := -x c -std=gnu89

##
# libsepol.so
#
# include $(CLEAR_VARS)

# LOCAL_MODULE := libsepol
# LOCAL_MODULE_TAGS := optional
# LOCAL_COPY_HEADERS_TO := sepol
# LOCAL_COPY_HEADERS := include/sepol/handle.h include/sepol/policydb.h cil/include/cil/cil.h
# LOCAL_C_INCLUDES := $(common_includes)
# LOCAL_CFLAGS := $(yacc_flags) $(common_cflags)
# LOCAL_SRC_FILES := $(common_src_files) $(cil_src_files)
# LOCAL_MODULE_CLASS := SHARED_LIBRARIES

# include $(BUILD_HOST_SHARED_LIBRARY)

##
# libsepol.a
#
include $(CLEAR_VARS)

LOCAL_MODULE := libsepol
LOCAL_MODULE_TAGS := optional
LOCAL_C_INCLUDES := $(common_includes)
LOCAL_CFLAGS := $(common_cflags)
LOCAL_SRC_FILES := $(common_src_files)
LOCAL_MODULE_CLASS := STATIC_LIBRARIES

include $(BUILD_STATIC_LIBRARY)

##
# chkcon
#
# include $(CLEAR_VARS)

# LOCAL_MODULE := chkcon
# LOCAL_MODULE_TAGS := optional
# LOCAL_C_INCLUDES := $(common_includes)
# LOCAL_CFLAGS := $(common_cflags)
# LOCAL_SRC_FILES := utils/chkcon.c
# LOCAL_SHARED_LIBRARIES := libsepol
# LOCAL_MODULE_CLASS := EXECUTABLES

# include $(BUILD_HOST_EXECUTABLE)

# include $(CLEAR_VARS)

# LOCAL_MODULE := libsepol
# LOCAL_MODULE_TAGES := optional
# LOCAL_C_INCLUDES := $(common_includes)
# LOCAL_CFLAGS := $(common_cflags)
# LOCAL_SRC_FILES := $(common_src_files)
# LOCAL_MODULE_CLASS := STATIC_LIBRARIES

# include $(BUILD_STATIC_LIBRARY)

0 comments on commit d7c6efa

Please sign in to comment.