Build sepolicy tools with Android.bp.

Bug: 33691272
Test: make clean && mmma system/sepolicy
Change-Id: I6bbd6271c375338e7d24cd6089c6f826080c98b6
This commit is contained in:
Tri Vo 2018-05-07 12:51:52 -07:00
parent 43e172af66
commit 594488f8b0
5 changed files with 86 additions and 76 deletions

View file

@ -1,4 +0,0 @@
subdirs = [
"tests",
"build",
]

60
tools/Android.bp Normal file
View file

@ -0,0 +1,60 @@
/*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
cc_defaults {
name: "sepolicy_tools_defaults",
cflags: [
"-Wall",
"-Werror",
],
static_libs: ["libsepol"],
stl: "none",
tags: ["optional"],
}
cc_binary_host {
name: "checkseapp",
defaults: ["sepolicy_tools_defaults"],
srcs: ["check_seapp.c"],
whole_static_libs: ["libpcre2"],
cflags: ["-DLINK_SEPOL_STATIC"],
}
cc_binary_host {
name: "checkfc",
defaults: ["sepolicy_tools_defaults"],
srcs: ["checkfc.c"],
static_libs: ["libselinux"],
}
cc_binary_host {
name: "sepolicy-check",
defaults: ["sepolicy_tools_defaults"],
srcs: ["sepolicy-check.c"],
}
cc_binary_host {
name: "version_policy",
defaults: ["sepolicy_tools_defaults"],
srcs: ["version_policy.c"],
}
cc_prebuilt_binary {
name: "insertkeys.py",
srcs: ["insertkeys.py"],
tags: ["optional"],
host_supported: true,
}

View file

@ -1,62 +1,3 @@
LOCAL_PATH:= $(call my-dir) LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := checkseapp
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS := -DLINK_SEPOL_STATIC -Wall -Werror
LOCAL_SRC_FILES := check_seapp.c
LOCAL_STATIC_LIBRARIES := libsepol
LOCAL_WHOLE_STATIC_LIBRARIES := libpcre2
LOCAL_CXX_STL := none
include $(BUILD_HOST_EXECUTABLE)
###################################
include $(CLEAR_VARS)
LOCAL_MODULE := checkfc
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS := -Wall -Werror
LOCAL_SRC_FILES := checkfc.c
LOCAL_STATIC_LIBRARIES := libsepol libselinux
LOCAL_CXX_STL := none
include $(BUILD_HOST_EXECUTABLE)
##################################
include $(CLEAR_VARS)
LOCAL_MODULE := insertkeys.py
LOCAL_SRC_FILES := insertkeys.py
LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_IS_HOST_MODULE := true
LOCAL_MODULE_TAGS := optional
include $(BUILD_PREBUILT)
###################################
include $(CLEAR_VARS)
LOCAL_MODULE := sepolicy-check
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS := -Wall -Werror
LOCAL_SRC_FILES := sepolicy-check.c
LOCAL_STATIC_LIBRARIES := libsepol
LOCAL_CXX_STL := none
include $(BUILD_HOST_EXECUTABLE)
###################################
include $(CLEAR_VARS)
LOCAL_MODULE := version_policy
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS := -Wall -Werror
LOCAL_SRC_FILES := version_policy.c
LOCAL_SHARED_LIBRARIES := libsepol
LOCAL_CXX_STL := none
include $(BUILD_HOST_EXECUTABLE)
include $(call all-makefiles-under,$(LOCAL_PATH)) include $(call all-makefiles-under,$(LOCAL_PATH))

26
tools/fc_sort/Android.bp Normal file
View file

@ -0,0 +1,26 @@
/*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
cc_binary_host {
name: "fc_sort",
srcs: ["fc_sort.c"],
stl: "none",
tags: ["optional"],
cflags: [
"-Wall",
"-Werror",
],
}

View file

@ -1,13 +0,0 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := fc_sort
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := fc_sort.c
LOCAL_CFLAGS := -Wall -Werror
LOCAL_CXX_STL := none
include $(BUILD_HOST_EXECUTABLE)
###################################