Skip to content
Snippets Groups Projects
Commit af403570 authored by Izzard, Robert Dr (Maths & Physics)'s avatar Izzard, Robert Dr (Maths & Physics)
Browse files

more changes to try to build data objects with meson

parent 6543ddee
No related branches found
No related tags found
No related merge requests found
...@@ -873,14 +873,12 @@ if 1 == 1 ...@@ -873,14 +873,12 @@ if 1 == 1
else else
# get data objects source (.h) files
data_object_sourcefiles = run_command('meson/data_object_list_files.sh') data_object_sourcefiles = run_command('meson/data_object_list_files.sh')
if data_object_sourcefiles.returncode() != 0 if data_object_sourcefiles.returncode() != 0
error('There was a problem identifying the data object source file.') error('There was a problem identifying the data object source file.')
endif endif
data_objects_source = data_object_sourcefiles.stdout().strip().split(' ')
# get data objects source (.h) files
data_objects_source = run_command('meson/data_object_list_files.sh').stdout().strip().split(' ')
# list data objects (.o) files # list data objects (.o) files
data_objects_files = run_command('meson/make_data_object.sh', data_objects_files = run_command('meson/make_data_object.sh',
...@@ -894,11 +892,12 @@ else ...@@ -894,11 +892,12 @@ else
data_objects_source, data_objects_source,
], ],
command: [ command: [
'meson/make_data_object.sh', '../meson/make_data_object.sh',
'build', 'build',
'@INPUT@', '@INPUT@',
], ],
output: [ output: [
'pants'
], ],
) )
......
...@@ -17,22 +17,28 @@ DBUILT="false" ...@@ -17,22 +17,28 @@ DBUILT="false"
COMMAND=$1 COMMAND=$1
shift shift
SRCPREFIX=".."
for HFILE in "$@"; do for HFILE in "$@"; do
TMPFILE=$(printf "%s" "$HFILE" | sed s/\.h$/.tmp/) TMPFILE=$(printf "%s" "$HFILE" | sed s/\.h$/.tmp/ | sed s/\\//_/g)
OBJFILE=$(printf "%s/%s" "${MESON_BUILD_ROOT}" "$HFILE" | sed s/\.h$/.o/ | sed s/\\//_/g) OBJFILE=$(printf "%s/%s" "${MESON_BUILD_ROOT}" "$HFILE" | sed s/\.h$/.o/ | sed s/\\//_/g)
#echo "H $HFILE" echo "H $HFILE"
#echo "T $TMPFILE" ls -l $SRCPREFIX/$HFILE
#echo "O $OBJFILE" echo "T $TMPFILE"
echo "O $OBJFILE"
if [ "$COMMAND" = "build" ] ; then if [ "$COMMAND" = "build" ] ; then
if [ "$HFILE" -nt "$OBJFILE" ] ; then echo "Do build"
if [ "$SRCPREFIX/$HFILE" -nt "$OBJFILE" ] ; then
echo "Require objfile ($DBUILT)"
if [ "$DBUILT" = true ]; then if [ "$DBUILT" = true ]; then
echo "Build double2bin"
# first time, build double2bin # first time, build double2bin
$CC double2bin.c -o ./double2bin $CC ../double2bin.c -o ./double2bin
fi fi
tr , ' ' < "$HFILE" | sed s/\\\\// | grep -v define |grep -v "\\*" | ./double2bin > "$TMPFILE" tr , ' ' < "$SRCPREFIX/$HFILE" | sed s/\\\\// | grep -v define |grep -v "\\*" | ./double2bin > "$TMPFILE"
objcopy $OBJCOPY_OPTS $OBJCOPY_SUBOPTS "$TMPFILE" "$OBJFILE" objcopy $OBJCOPY_OPTS $OBJCOPY_SUBOPTS "$TMPFILE" "$OBJFILE"
rm "$TMPFILE" rm "$TMPFILE"
DBUILT=true DBUILT=true
...@@ -42,6 +48,7 @@ for HFILE in "$@"; do ...@@ -42,6 +48,7 @@ for HFILE in "$@"; do
echo -n "$OBJFILE " echo -n "$OBJFILE "
#ls -l $OBJFILE #ls -l $OBJFILE
#echo #echo
done done
echo echo
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment