1#!/bin/sh
2# Copyright 2016 The Fuchsia Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6# This script generates the following files:
7#
8#  * src/builtins.h
9#  * src/builtins.c
10#  * src/builtins.def
11#  * src/init.c
12#  * src/nodes.h
13#  * src/nodes.c
14#  * src/signames.c (if you uncomment the lines at the end)
15#  * src/syntax.h
16#  * src/syntax.c
17#  * src/token.h
18#  * src/token_vars.h
19
20cd src
21
22set -ex
23
24gcc -E -x c -o builtins.def builtins.def.in -DJOBS=0
25
26sh mktokens
27sh mkbuiltins builtins.def
28
29gcc mkinit.c -o mkinit
30gcc mknodes.c -o mknodes
31gcc mksyntax.c -o mksyntax
32
33DASH_CFILES="alias.c arith_yacc.c arith_yylex.c cd.c controller.c error.c eval.c exec.c expand.c \
34  input.c jobs.c main.c memalloc.c miscbltin.c \
35  mystring.c options.c parser.c redir.c show.c trap.c output.c \
36  bltin/printf.c system.c tab.c bltin/test.c bltin/times.c var.c"
37
38./mkinit $DASH_CFILES
39./mknodes nodetypes nodes.c.pat
40./mksyntax
41
42rm mkinit
43rm mknodes
44rm mksyntax
45
46# Uncomment the following lines to generate signames.c:
47#
48#   gcc mksignames.c -o mksignames
49#   ./mksignames
50#   rm mksignames
51