| 1 | # $Id: $ | 
|---|
| 2 | ## @file | 
|---|
| 3 | # | 
|---|
| 4 | # kBuild Makefile for ash. | 
|---|
| 5 | # | 
|---|
| 6 | # Copyright (c) 2005 knut st. osmundsen <bird@anduin.net> | 
|---|
| 7 | # | 
|---|
| 8 |  | 
|---|
| 9 | PROGRAMS = ash | 
|---|
| 10 | INSTALLS = ash.man | 
|---|
| 11 |  | 
|---|
| 12 | ash_TEMPLATE = bin | 
|---|
| 13 | ash_INST = bin/ash$(SUFF_EXE) bin/sh$(SUFF_EXE) | 
|---|
| 14 | ash_DEFS = lint SHELL SMALL | 
|---|
| 15 | ash_DEFS.os2 = EXEC_HASH_BANG_SCRIPT PC_OS2_LIBPATHS PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS PC_SLASHES | 
|---|
| 16 | ash_INCS = $(PATH_TARGET) . # (the last is because of error.h) | 
|---|
| 17 | ash_SOURCES = \ | 
|---|
| 18 | alias.c \ | 
|---|
| 19 | cd.c \ | 
|---|
| 20 | error.c \ | 
|---|
| 21 | eval.c \ | 
|---|
| 22 | exec.c \ | 
|---|
| 23 | expand.c \ | 
|---|
| 24 | histedit.c \ | 
|---|
| 25 | input.c \ | 
|---|
| 26 | jobs.c \ | 
|---|
| 27 | mail.c \ | 
|---|
| 28 | main.c \ | 
|---|
| 29 | memalloc.c \ | 
|---|
| 30 | miscbltin.c \ | 
|---|
| 31 | mystring.c \ | 
|---|
| 32 | options.c \ | 
|---|
| 33 | output.c \ | 
|---|
| 34 | parser.c \ | 
|---|
| 35 | redir.c \ | 
|---|
| 36 | show.c \ | 
|---|
| 37 | syntax.c \ | 
|---|
| 38 | trap.c \ | 
|---|
| 39 | var.c \ | 
|---|
| 40 | bltin/echo.c \ | 
|---|
| 41 | bltin/kill.c \ | 
|---|
| 42 | bltin/test.c \ | 
|---|
| 43 | $(PATH_TARGET)/arith.c \ | 
|---|
| 44 | $(PATH_TARGET)/arith_lex.c \ | 
|---|
| 45 | $(PATH_TARGET)/builtins.c \ | 
|---|
| 46 | $(PATH_TARGET)/init.c \ | 
|---|
| 47 | $(PATH_TARGET)/nodes.c | 
|---|
| 48 | ash_ORDERDEPS = \ | 
|---|
| 49 | $(PATH_TARGET)/arith.h \ | 
|---|
| 50 | $(PATH_TARGET)/builtins.h \ | 
|---|
| 51 | $(PATH_TARGET)/nodes.h \ | 
|---|
| 52 | $(PATH_TARGET)/token.h | 
|---|
| 53 | ash_CLEAN = \ | 
|---|
| 54 | $(ash_DEPS)     \ | 
|---|
| 55 | $(PATH_TARGET)/arith.c \ | 
|---|
| 56 | $(PATH_TARGET)/arith_lex.c \ | 
|---|
| 57 | $(PATH_TARGET)/builtins.c \ | 
|---|
| 58 | $(PATH_TARGET)/init.c \ | 
|---|
| 59 | $(PATH_TARGET)/nodes.c | 
|---|
| 60 |  | 
|---|
| 61 | ash.man_TEMPLATE = usr.bin.man | 
|---|
| 62 | ash.man_SOURCES = \ | 
|---|
| 63 | sh.1=>ash.1 | 
|---|
| 64 | #ash.man_SYMLINKS = \ | 
|---|
| 65 | #       ash.1.gz=>sh.1 | 
|---|
| 66 |  | 
|---|
| 67 | DEPTH = .. | 
|---|
| 68 | include $(PATH_KBUILD)/rules.kmk | 
|---|
| 69 |  | 
|---|
| 70 | $(PATH_TARGET)/arith.h $(PATH_TARGET)/arith.c: arith.y | $(call DIRDEP,$(PATH_TARGET)) | 
|---|
| 71 | yacc -ld $^ | 
|---|
| 72 | $(MV) -f y.tab.c $(PATH_TARGET)/arith.c | 
|---|
| 73 | $(MV) -f y.tab.h $(PATH_TARGET)/arith.h | 
|---|
| 74 |  | 
|---|
| 75 | $(PATH_TARGET)/arith_lex.c: arith_lex.l | $(call DIRDEP,$(PATH_TARGET)) | 
|---|
| 76 | flex -8 -o$@ $^ | 
|---|
| 77 | # -8 -- 8-bit lex scanner for arithmetic | 
|---|
| 78 |  | 
|---|
| 79 | $(PATH_TARGET)/builtins.h $(PATH_TARGET)/builtins.c: mkbuiltins shell.h builtins.def | $(call DIRDEP,$(PATH_TARGET)) | 
|---|
| 80 | $(ASH) $+ $(dir $@) | 
|---|
| 81 | [ -f $(PATH_TARGET)/builtins.h ] | 
|---|
| 82 |  | 
|---|
| 83 | $(PATH_TARGET)/nodes.h $(PATH_TARGET)/nodes.c: mknodes.sh nodetypes nodes.c.pat | $(call DIRDEP,$(PATH_TARGET)) | 
|---|
| 84 | $(ASH) $+ $(dir $@) | 
|---|
| 85 | [ -f $(dir $@)/nodes.h ] | 
|---|
| 86 |  | 
|---|
| 87 | $(PATH_TARGET)/token.h: mktokens | $(call DIRDEP,$(PATH_TARGET)) | 
|---|
| 88 | $(ASH) $+ | 
|---|
| 89 | $(MV) token.h $@ | 
|---|
| 90 |  | 
|---|
| 91 | $(PATH_TARGET)/init.c: mkinit.sh $(filter-out $(PATH_TARGET)/%,$(ash_SOURCES)) | $(call DIRDEP,$(PATH_TARGET)) | 
|---|
| 92 | $(ASH) $+ | 
|---|
| 93 | $(MV) init.c $@ | 
|---|
| 94 |  | 
|---|