1LOCAL_PATH:= $(call my-dir) 2include $(CLEAR_VARS) 3 4LOCAL_SRC_FILES:= \ 5 alias.c \ 6 arith.c \ 7 arith_lex.c \ 8 builtins.c \ 9 cd.c \ 10 error.c \ 11 eval.c \ 12 exec.c \ 13 expand.c \ 14 input.c \ 15 jobs.c \ 16 main.c \ 17 memalloc.c \ 18 miscbltin.c \ 19 mystring.c \ 20 nodes.c \ 21 options.c \ 22 parser.c \ 23 redir.c \ 24 show.c \ 25 syntax.c \ 26 trap.c \ 27 output.c \ 28 var.c \ 29 bltin/echo.c \ 30 init.c 31 32LOCAL_MODULE:= ash 33LOCAL_MODULE_TAGS:= shell_ash 34 35LOCAL_CFLAGS += -DSHELL -DWITH_LINENOISE 36 37LOCAL_STATIC_LIBRARIES := liblinenoise 38 39LOCAL_C_INCLUDES += system/core/liblinenoise 40 41make_ash_files: PRIVATE_SRC_FILES := $(SRC_FILES) 42make_ash_files: PRIVATE_CFLAGS := $(LOCAL_CFLAGS) 43make_ash_files: 44 p4 edit arith.c arith_lex.c arith.h builtins.h builtins.c 45 p4 edit init.c nodes.c nodes.h token.h 46 sh ./mktokens 47 bison -o arith.c arith.y 48 flex -o arith_lex.c arith_lex.l 49 perl -ne 'print if ( /^\#\s*define\s+ARITH/ );' < arith.c > arith.h 50 sh ./mkbuiltins shell.h builtins.def . -Wall -O2 51 sh ./mknodes.sh nodetypes nodes.c.pat . 52 sh ./mkinit.sh $(PRIVATE_SRC_FILES) 53 54include $(BUILD_EXECUTABLE) 55 56 57# create /system/bin/sh symlink to $(TARGET_SHELL) 58# not the optimal place for this, but a fitting one 59 60OUTSYSTEMBINSH := $(TARGET_OUT)/bin/sh 61LOCAL_MODULE := systembinsh 62$(OUTSYSTEMBINSH): | $(TARGET_SHELL) 63$(OUTSYSTEMBINSH): LOCAL_MODULE := $(LOCAL_MODULE) 64$(OUTSYSTEMBINSH): 65 @echo "Symlink: $@ -> $(TARGET_SHELL)" 66 @rm -rf $@ 67 $(hide) ln -sf $(TARGET_SHELL) $@ 68 69ALL_DEFAULT_INSTALLED_MODULES += $(OUTSYSTEMBINSH) 70ALL_MODULES.$(LOCAL_MODULE).INSTALLED += $(OUTSYSTEMBINSH) 71