The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 1 | LOCAL_PATH:= $(call my-dir) |
| 2 | include $(CLEAR_VARS) |
| 3 | |
| 4 | LOCAL_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 | |
Thorsten Glaser | bdc36d6 | 2010-06-07 10:26:37 +0200 | [diff] [blame] | 32 | LOCAL_MODULE:= ash |
| 33 | LOCAL_MODULE_TAGS:= shell_ash |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 34 | |
Jack Palevich | 7fe202f | 2010-05-25 14:49:57 +0800 | [diff] [blame] | 35 | LOCAL_CFLAGS += -DSHELL -DWITH_LINENOISE |
| 36 | |
| 37 | LOCAL_STATIC_LIBRARIES := liblinenoise |
| 38 | |
| 39 | LOCAL_C_INCLUDES += system/core/liblinenoise |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 40 | |
| 41 | make_ash_files: PRIVATE_SRC_FILES := $(SRC_FILES) |
| 42 | make_ash_files: PRIVATE_CFLAGS := $(LOCAL_CFLAGS) |
| 43 | make_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 | |
| 54 | include $(BUILD_EXECUTABLE) |
Thorsten Glaser | bdc36d6 | 2010-06-07 10:26:37 +0200 | [diff] [blame] | 55 | |
| 56 | |
| 57 | # create /system/bin/sh symlink to $(TARGET_SHELL) |
| 58 | # not the optimal place for this, but a fitting one |
| 59 | |
| 60 | OUTSYSTEMBINSH := $(TARGET_OUT)/bin/sh |
| 61 | LOCAL_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 | |
| 69 | ALL_DEFAULT_INSTALLED_MODULES += $(OUTSYSTEMBINSH) |
| 70 | ALL_MODULES.$(LOCAL_MODULE).INSTALLED += $(OUTSYSTEMBINSH) |