Pass source dir into makefile generator script
The script runs in build/, the source is in git/.
Change-Id: I3f6804f3a83013bc0afe7bfba8da585d2fd24413
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/configure.ac b/configure.ac
index b5a14ad..0234491 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,7 +42,7 @@
AS_IF([test "x$CHIPS" == "x"], [CHIPS="p9"])
AC_CONFIG_FILES([Makefile.generated],
- [${srcdir}/gen_makefile.sh "$myChips" > Makefile.generated],
+ [${srcdir}/gen_makefile.sh ${srcdir} "$myChips" > Makefile.generated],
[myChips="$CHIPS"])
PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging],, [AC_MSG_ERROR([Could not find phosphor-logging...openbmc/phosphor-logging package required])])
diff --git a/gen_makefile.sh b/gen_makefile.sh
index a6fc076..f5150fc 100755
--- a/gen_makefile.sh
+++ b/gen_makefile.sh
@@ -1,11 +1,15 @@
#!/bin/bash
files=()
+dir=$1
+args=("$@")
+
echo "openpower_procedures_cpp_files = \\"
-for type in "$@";
+for ((i=1; i<${#args[@]}; ++i));
do
+ type=${args[$i]}
type=${type// /} #remove spaces
- for file in $(ls procedures/$type/*.cpp);
+ for file in $(ls $dir/procedures/$type/*.cpp);
do
files+=($file)
done