# $Id: $ ## @file # # kBuild Makefile for ash. # # Copyright (c) 2005 knut st. osmundsen # PROGRAMS = ash INSTALLS = ash.man ash_TEMPLATE = bin ash_INST = bin/ash$(SUFF_EXE) bin/sh$(SUFF_EXE) ash_DEFS = lint SHELL SMALL ash_DEFS.os2 = EXEC_HASH_BANG_SCRIPT PC_OS2_LIBPATHS PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS PC_SLASHES ash_INCS = $(PATH_TARGET) . # (the last is because of error.h) ash_SOURCES = \ alias.c \ cd.c \ error.c \ eval.c \ exec.c \ expand.c \ histedit.c \ input.c \ jobs.c \ mail.c \ main.c \ memalloc.c \ miscbltin.c \ mystring.c \ options.c \ output.c \ parser.c \ redir.c \ show.c \ syntax.c \ trap.c \ var.c \ bltin/echo.c \ bltin/kill.c \ bltin/test.c \ $(PATH_TARGET)/arith.c \ $(PATH_TARGET)/arith_lex.c \ $(PATH_TARGET)/builtins.c \ $(PATH_TARGET)/init.c \ $(PATH_TARGET)/nodes.c ash_ORDERDEPS = \ $(PATH_TARGET)/arith.h \ $(PATH_TARGET)/builtins.h \ $(PATH_TARGET)/nodes.h \ $(PATH_TARGET)/token.h ash_CLEAN = \ $(ash_ORDERDEPS) \ $(PATH_TARGET)/arith.c \ $(PATH_TARGET)/arith_lex.c \ $(PATH_TARGET)/builtins.c \ $(PATH_TARGET)/init.c \ $(PATH_TARGET)/nodes.c ash.man_TEMPLATE = usr.bin.man ash.man_SOURCES = \ sh.1=>ash.1 #ash.man_SYMLINKS = \ # ash.1.gz=>sh.1 DEPTH = .. include $(PATH_KBUILD)/rules.kmk $(PATH_TARGET)/arith.h $(PATH_TARGET)/arith.c: arith.y | $(call DIRDEP,$(PATH_TARGET)) yacc -ld $^ $(MV) -f y.tab.c $(PATH_TARGET)/arith.c $(MV) -f y.tab.h $(PATH_TARGET)/arith.h $(PATH_TARGET)/arith_lex.c: arith_lex.l | $(call DIRDEP,$(PATH_TARGET)) flex -8 -o$@ $^ # -8 -- 8-bit lex scanner for arithmetic $(PATH_TARGET)/builtins.h + $(PATH_TARGET)/builtins.c: mkbuiltins shell.h builtins.def | $(call DIRDEP,$(PATH_TARGET)) $(ASH) $+ $(dir $@) [ -f $(PATH_TARGET)/builtins.h ] $(PATH_TARGET)/nodes.h + $(PATH_TARGET)/nodes.c: mknodes.sh nodetypes nodes.c.pat | $(call DIRDEP,$(PATH_TARGET)) $(ASH) $+ $(dir $@) [ -f $(dir $@)/nodes.h ] $(PATH_TARGET)/token.h: mktokens | $(call DIRDEP,$(PATH_TARGET)) $(ASH) $+ $(MV) token.h $@ $(PATH_TARGET)/init.c: mkinit.sh $(filter-out $(PATH_TARGET)/%,$(ash_SOURCES)) | $(call DIRDEP,$(PATH_TARGET)) $(ASH) $+ $(MV) init.c $@