blob: 7ab8db7fffcb05c2929dfcb4d1d2f7b1541bec09 [file] [log] [blame]
Stephen Smalleyda752ca2012-02-23 10:14:13 -05001LOCAL_PATH:= $(call my-dir)
2
3common_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
11common_cflags := \
12 -Wall -Wshadow -O2 \
13 -pipe -fno-strict-aliasing \
14 -Wno-return-type
15
16ifeq ($(HOST_OS),darwin)
17common_cflags += -DDARWIN
18endif
19
20common_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++
28yacc_flags := -x c
29
30
31##
32# checkpolicy
33#
34include $(CLEAR_VARS)
35
36LOCAL_MODULE := checkpolicy
37LOCAL_MODULE_TAGS := optional
38LOCAL_C_INCLUDES := $(common_includes)
39LOCAL_CFLAGS := $(yacc_flags) $(common_cflags)
40LOCAL_SRC_FILES := $(common_src_files) checkpolicy.c
41LOCAL_STATIC_LIBRARIES := libsepol
42LOCAL_YACCFLAGS := -v
43LOCAL_MODULE_CLASS := EXECUTABLES
44
45include $(BUILD_HOST_EXECUTABLE)
46
47
48##
49# checkmodule
50#
51include $(CLEAR_VARS)
52
53LOCAL_MODULE := checkmodule
54LOCAL_MODULE_TAGS := optional
55LOCAL_C_INCLUDES := $(common_includes)
56LOCAL_CFLAGS := $(yacc_flags) $(common_cflags)
57LOCAL_SRC_FILES := $(common_src_files) checkmodule.c
58LOCAL_STATIC_LIBRARIES := libsepol
59LOCAL_YACCFLAGS := -v
60LOCAL_MODULE_CLASS := EXECUTABLES
61
62include $(BUILD_HOST_EXECUTABLE)