blob: 1d65364065bfe0e391b99c9ea70ffecc1c314854 [file] [log] [blame]
Yuta HIGUCHI488a94c2018-01-26 17:24:09 -08001#!/usr/bin/env bash
2
3YANG_ROOT=$1
4
5CONFDC_ARGS=' -c'
6
7# YANGPATHS
8for path in $(find $YANG_ROOT -type d); do
9 CONFDC_ARGS+=" --yangpath $path"
10done
11
12# create output dir
13mkdir -p fxs
14
15# compile .yang s
16for yang in $(find $YANG_ROOT -type f -name '*.yang'); do
17 BASE=$(basename $yang)
18 OUT="${BASE%.yang}.fxs"
19 echo "Compiling..$yang"
20 confdc $CONFDC_ARGS -o fxs/$OUT -- $yang
21done