1 LOCAL_PATH:= $(call my-dir) 2 3 common_src_files := \ 4 policy_parse.y \ 5 policy_scan.l \ 6 queue.c \ 7 module_compiler.c \ 8 parse_util.c \ 9 policy_define.c 10 11 common_cflags := \ 12 -Wall -Wshadow -O2 \ 13 -pipe -fno-strict-aliasing \ 14 -Wno-return-type 15 16 ifeq ($(HOST_OS),darwin) 17 common_cflags += -DDARWIN 18 endif 19 20 common_includes := \ 21 $(LOCAL_PATH)/ \ 22 $(LOCAL_PATH)/../libsepol/include/ \ 23 $(LOCAL_PATH)/../libsepol/src/ \ 24 25 ## 26 # "-x c" forces the lex/yacc files to be compiled as c 27 # the build system otherwise forces them to be c++ 28 yacc_flags := -x c 29 30 31 ## 32 # checkpolicy 33 # 34 include $(CLEAR_VARS) 35 36 LOCAL_MODULE := checkpolicy 37 LOCAL_MODULE_TAGS := optional 38 LOCAL_C_INCLUDES := $(common_includes) 39 LOCAL_CFLAGS := $(yacc_flags) $(common_cflags) 40 LOCAL_SRC_FILES := $(common_src_files) checkpolicy.c 41 LOCAL_STATIC_LIBRARIES := libsepol 42 LOCAL_YACCFLAGS := -v 43 LOCAL_MODULE_CLASS := EXECUTABLES 44 45 include $(BUILD_HOST_EXECUTABLE) 46 47 48 ## 49 # checkmodule 50 # 51 include $(CLEAR_VARS) 52 53 LOCAL_MODULE := checkmodule 54 LOCAL_MODULE_TAGS := optional 55 LOCAL_C_INCLUDES := $(common_includes) 56 LOCAL_CFLAGS := $(yacc_flags) $(common_cflags) 57 LOCAL_SRC_FILES := $(common_src_files) checkmodule.c 58 LOCAL_STATIC_LIBRARIES := libsepol 59 LOCAL_YACCFLAGS := -v 60 LOCAL_MODULE_CLASS := EXECUTABLES 61 62 include $(BUILD_HOST_EXECUTABLE) 63