Home | History | Annotate | Download | only in libsepol
      1 LOCAL_PATH:= $(call my-dir)
      2 
      3 common_src_files := \
      4 	src/assertion.c \
      5 	src/avrule_block.c \
      6 	src/avtab.c \
      7 	src/boolean_record.c \
      8 	src/booleans.c \
      9 	src/conditional.c \
     10 	src/constraint.c \
     11 	src/context.c \
     12 	src/context_record.c \
     13 	src/debug.c \
     14 	src/ebitmap.c \
     15 	src/expand.c \
     16 	src/genbools.c \
     17 	src/genusers.c \
     18 	src/handle.c \
     19 	src/hashtab.c \
     20 	src/hierarchy.c \
     21 	src/iface_record.c \
     22 	src/interfaces.c \
     23 	src/link.c \
     24 	src/mls.c \
     25 	src/module.c \
     26 	src/module_to_cil.c \
     27 	src/node_record.c \
     28 	src/nodes.c \
     29 	src/polcaps.c \
     30 	src/policydb.c \
     31 	src/policydb_convert.c \
     32 	src/policydb_public.c \
     33 	src/port_record.c \
     34 	src/ports.c \
     35 	src/roles.c \
     36 	src/services.c \
     37 	src/sidtab.c \
     38 	src/symtab.c \
     39 	src/user_record.c \
     40 	src/users.c \
     41 	src/util.c \
     42 	src/write.c
     43 
     44 cil_src_files := \
     45 	cil/src/cil_binary.c \
     46 	cil/src/cil_build_ast.c \
     47 	cil/src/cil.c \
     48 	cil/src/cil_copy_ast.c \
     49 	cil/src/cil_find.c \
     50 	cil/src/cil_fqn.c \
     51 	cil/src/cil_lexer.l \
     52 	cil/src/cil_list.c \
     53 	cil/src/cil_log.c \
     54 	cil/src/cil_mem.c \
     55 	cil/src/cil_parser.c \
     56 	cil/src/cil_policy.c \
     57 	cil/src/cil_post.c \
     58 	cil/src/cil_reset_ast.c \
     59 	cil/src/cil_resolve_ast.c \
     60 	cil/src/cil_stack.c \
     61 	cil/src/cil_strpool.c \
     62 	cil/src/cil_symtab.c \
     63 	cil/src/cil_tree.c \
     64 	cil/src/cil_verify.c
     65 
     66 common_cflags := \
     67 	-Wall -W -Wundef \
     68 	-Wshadow -Wmissing-noreturn \
     69 	-Wmissing-format-attribute
     70 
     71 ifeq ($(HOST_OS), darwin)
     72 common_cflags += -DDARWIN
     73 endif
     74 
     75 common_includes := \
     76 	$(LOCAL_PATH)/include/ \
     77 	$(LOCAL_PATH)/src/ \
     78 	$(LOCAL_PATH)/cil/include/ \
     79 	$(LOCAL_PATH)/cil/src/ \
     80 
     81 ##
     82 # "-x c" forces the lex/yacc files to be compiled as c the build system
     83 # otherwise forces them to be c++. Need to also add an explicit -std because the
     84 # build system will soon default C++ to -std=c++11.
     85 yacc_flags := -x c -std=gnu89
     86 
     87 ##
     88 # libsepol.so
     89 #
     90 include $(CLEAR_VARS)
     91 
     92 LOCAL_MODULE := libsepol
     93 LOCAL_MODULE_TAGS := optional
     94 LOCAL_C_INCLUDES := $(common_includes) 
     95 LOCAL_CFLAGS := $(common_cflags)
     96 LOCAL_CPPFLAGS := $(yacc_flags)
     97 LOCAL_SRC_FILES := $(common_src_files) $(cil_src_files)
     98 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
     99 
    100 include $(BUILD_HOST_SHARED_LIBRARY)
    101 
    102 ##
    103 # libsepol.a
    104 #
    105 include $(CLEAR_VARS)
    106 
    107 LOCAL_MODULE := libsepol
    108 LOCAL_MODULE_TAGS := optional
    109 LOCAL_C_INCLUDES := $(common_includes) 
    110 LOCAL_CFLAGS := $(common_cflags)
    111 LOCAL_CPPFLAGS := $(yacc_flags)
    112 LOCAL_SRC_FILES := $(common_src_files) $(cil_src_files)
    113 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
    114 
    115 include $(BUILD_HOST_STATIC_LIBRARY)
    116 
    117 ##
    118 # chkcon
    119 #
    120 include $(CLEAR_VARS)
    121 
    122 LOCAL_MODULE := chkcon
    123 LOCAL_MODULE_TAGS := optional
    124 LOCAL_C_INCLUDES := $(common_includes) 
    125 LOCAL_CFLAGS := $(common_cflags)
    126 LOCAL_SRC_FILES := utils/chkcon.c
    127 LOCAL_SHARED_LIBRARIES := libsepol
    128 
    129 include $(BUILD_HOST_EXECUTABLE)
    130 
    131 include $(CLEAR_VARS)
    132 
    133 LOCAL_MODULE := libsepol
    134 LOCAL_MODULE_TAGES := optional
    135 LOCAL_C_INCLUDES := $(common_includes)
    136 LOCAL_CFLAGS := $(common_cflags)
    137 LOCAL_SRC_FILES := $(common_src_files)
    138 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
    139 
    140 include $(BUILD_STATIC_LIBRARY)
    141