Commit b5ec195b authored by Andreas Wandinger's avatar Andreas Wandinger
Browse files

Fixed path issue.

refs 727
parent d0db9169
......@@ -4,58 +4,61 @@ Buildfile(appl) ::= <<
#!/bin/sh
# The application's name.
APPL="$appl$"
APPL="$appl$";
# The root path for this script.
if [ -z "\$ROOT" ]; then ROOT="."; fi
if [ -z "\$ROOT" ]; then ROOT="."; fi;
# The include and source paths.
IPATH=". inc-gen inc"
VPATH=". src-gen src"
IPATH=". inc-gen inc";
VPATH=". src-gen src";
# The include file for common make definitions.
MAKEDEFS="Makedefs"
MAKEDEFS="Makedefs";
# The include file for the user make definitions.
USERDEFS="Userdefs"
USERDEFS="Userdefs";
# The object file rule prefix.
PREFIX="\\\${BPATH}/\\\${APPL}.run: \\\${BPATH}/"
PREFIX="\\\${BPATH}/\\\${APPL}.run: \\\${BPATH}/";
# The file which stores the object file list.
OLIST="Objects"
OLIST="Objects";
# Search for source files in the known directories.
echo "searching for source files ..."
rm -f \$ROOT/\$OLIST
for V in \$VPATH; do if [ \$V != "." ]; then find \$ROOT/\$V -name "*.c" \>\> \$ROOT/\$OLIST; fi; done
echo "searching for source files ...";
rm -f \$ROOT/\$OLIST;
for V in \$VPATH; do if [ \$V != "." ]; then find \$ROOT/\$V -name "*.c" \>\> \$ROOT/\$OLIST; fi; done;
# The absolute path of the Makefile.
MF=\$ROOT/Makefile;
# Generate the Makefile.
echo "generating Makefile ..."
rm -f \$ROOT/Makefile
echo "# NOTICE: this Makefile has been generated, so your" \>\> \$ROOT/Makefile
echo "# modifications may get lost. To rebuild this" \>\> \$ROOT/Makefile
echo "# file, run the './configure' script." \>\> \$ROOT/Makefile
echo "" \>\> \$ROOT/Makefile
echo "# The application's name." \>\> \$ROOT/Makefile
echo "APPL=\$APPL" \>\> \$ROOT/Makefile
echo "" \>\> \$ROOT/Makefile
echo "# The include and source paths." \>\> \$ROOT/Makefile
echo "IPATH=\$IPATH" \>\> \$ROOT/Makefile
echo "VPATH=\$VPATH" \>\> \$ROOT/Makefile
echo "" \>\> \$ROOT/Makefile
echo "# Include the common make definitions." \>\> \$ROOT/Makefile
echo "include \$MAKEDEFS" \>\> \$ROOT/Makefile
echo "" \>\> \$ROOT/Makefile
if [ -f \$ROOT/\$USERDEFS ];
then
echo "# Include the users make definitions." \>\> \$ROOT/Makefile
echo "include \$USERDEFS" \>\> \$ROOT/Makefile
echo "" \>\> \$ROOT/Makefile
fi
echo "# The object file rules of this application." \>\> \$ROOT/Makefile
echo "generating Makefile ...";
rm -f \$ROOT/Makefile;
echo "# NOTICE: this Makefile has been generated, so your" \>\> \$MF;
echo "# modifications may get lost. To rebuild this" \>\> \$MF;
echo "# file, run the './configure' script." \>\> \$MF;
echo "" \>\> \$MF;
echo "# The application's name." \>\> \$MF;
echo "APPL=\$APPL" \>\> \$MF;
echo "" \>\> \$MF;
echo "# The include and source paths." \>\> \$MF;
echo "IPATH=\$IPATH" \>\> \$MF;
echo "VPATH=\$VPATH" \>\> \$MF;
echo "" \>\> \$MF;
echo "# Include the common make definitions." \>\> \$MF;
echo "include \$MAKEDEFS" \>\> \$MF;
echo "" \>\> \$MF;
if [ -f \$ROOT/\$USERDEFS ]; then
echo "# Include the users make definitions." \>\> \$MF;
echo "include \$USERDEFS" \>\> \$MF;
echo "" \>\> \$MF;
fi;
echo "# The object file rules of this application." \>\> \$ROOT/Makefile;
cat \$ROOT/\$OLIST | awk 'BEGIN {FS="/"}; {print \$NF}' | sed "s/.c\$/.o/g" \
| awk 'BEGIN {OFS=""}; {print "'"\$PREFIX"'", \$0}' \>\> \$ROOT/Makefile
rm -f \$ROOT/\$OLIST
| awk 'BEGIN {OFS=""}; {print "'"\$PREFIX"'", \$0}' \>\> \$ROOT/Makefile;
rm -f \$ROOT/\$OLIST;
exit 0;
>>
......@@ -3,38 +3,45 @@ group RootBuildfile;
RootBuildfile() ::= <<
#!/bin/sh
# The directory in which we are operating.
OP=\$(echo \$0 | sed 's/configure\$//g');
# The list of the first-level subdirectories.
DIRS=`find . -mindepth 1 -maxdepth 1 -not -name ".*" -type d`
DIRS=\$(find \$OP -mindepth 1 -maxdepth 1 -not -name ".*" -type d);
# The absolute path of the Makefile.
MF=\$OP/Makefile;
# Generate the root Makefile.
echo "generating root Makefile ..."
rm -f Makefile
echo "# NOTICE: this Makefile has been generated, so your" \>\> Makefile
echo "# modifications may get lost. To rebuild this" \>\> Makefile
echo "# file, run the './configure' script." \>\> Makefile
echo "" \>\> Makefile
echo "# The list of the first-level subdirectories." \>\> Makefile
echo "DIRS=\`find . -mindepth 1 -maxdepth 1 -not -name \".*\" -type d\`" \>\> Makefile
echo "" \>\> Makefile
echo "# The default build target." \>\> Makefile
echo "all:" \>\> Makefile
echo ' @for D in \${DIRS}; do make -C \$\${D} || exit \$\$?; done' \>\> Makefile
echo "" \>\> Makefile
echo "# The default clean target." \>\> Makefile
echo "clean:" \>\> Makefile
echo ' @for D in \${DIRS}; do make -C \$\${D} clean; done' \>\> Makefile
echo "";
echo " generating root Makefile ...";
rm -f \$MF;
echo "# NOTICE: this Makefile has been generated, so your" \>\> \$MF;
echo "# modifications may get lost. To rebuild this" \>\> \$MF;
echo "# file, run the './configure' script." \>\> \$MF;
echo "" \>\> \$MF;
echo "# The list of the first-level subdirectories." \>\> \$MF;
echo "DIRS=\\\$\\\$(find \$OP -mindepth 1 -maxdepth 1 -not -name \".*\" -type d)" \>\> \$MF;
echo "" \>\> \$MF;
echo "# The default build target." \>\> \$MF;
echo "all:" \>\> \$MF;
echo ' @for D in \${DIRS}; do make -C \$\$D || exit \$\$?; done' \>\> \$MF;
echo "" \>\> \$MF;
echo "# The default clean target." \>\> \$MF;
echo "clean:" \>\> \$MF;
echo ' @for D in \${DIRS}; do make -C \$\$D clean; done' \>\> \$MF;
# Go down the directory hierarchy.
for D in \$DIRS;
do
echo "processing directory \$D."
export ROOT=\$D && \$D/configure | awk 'BEGIN {OFS=""}; {print " ", \$0}'
echo "leaving directory \$D."
done
for D in \$DIRS; do
echo " processing directory \$D.";
export ROOT=\$D && \$D/configure | awk 'BEGIN {OFS=""}; {print " ", \$0}';
echo " leaving directory \$D.";
done;
# Finish.
echo ""
echo "Success. Now you can simply run 'make' to build your application."
echo ""
echo "";
echo " Success. Now you can simply run 'make' to build your application.";
echo "";
exit 0;
>>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment