#!/bin/sh
# $Id: create_flat_submakefile.sh 690051 2024-11-13 20:55:40Z ucko $

top_dir=$1
rel_dir=$2

if nawk 'BEGIN { exit 0 }' 2>/dev/null; then
    awk=nawk
else
    awk=awk
fi

exec > Makefile.flat

cat <<EOF
# This file was generated by $0
# on `date +'%m/%d/%Y %H:%M:%S'`

builddir = $(pwd)
EOF

exec $awk -f `dirname $0`/create_flat_submakefile.awk subdir=$rel_dir \
    $top_dir/Makefile.flat
