Skip to content

Extracting dependencies in 0.151

Vitorio edited this page Jan 13, 2014 · 2 revisions

Hey, this page is super deprecated, now. Please don't follow it. See How to build and test JSMESS 0.151 instead.


When you upgrade to a new version of MESS, this is how to regenerate the dependency cross-reference text files in the helpers folder.

Make sure nm is available on your system. It's like objdump, but different. Thanks to luser for all his help.

In third_party/mame, do make clean and then make TARGET=mess SYMBOLS=1 to generate the necessary object files with symbol data. This can take a while.

Change directory into obj/sdl64 and run:

rm mangled-all-resolved.txt; \
rm mangled-all-unresolved.txt; \
rm all-resolved.txt

for a in `find . -name '*.o'`; \
do nm --defined-only $a | cut -d ' ' -f 3- > $a.tmp; \
cat $a.tmp | while read LINE; \
do echo $a $LINE >> mangled-all-resolved.txt; \
done; \
rm $a.tmp; \
done

for a in `find . -name '*.o'`; \
do nm -u $a | cut -c 20- > $a.tmp; \
cat $a.tmp | while read LINE; \
do echo $a $LINE >> mangled-all-unresolved.txt; \
done; \
rm $a.tmp; \
done

for a in `find . -name '*.o'`; \
do nm -C --defined-only $a | cut -d ' ' -f 3- > $a.tmp; \
cat $a.tmp | while read LINE; \
do echo $a $LINE >> all-resolved.txt; \
done; \
rm $a.tmp; \
done

Those will generate three files, with lists of every function and name in the system, and where they are located, e.g.

./lib/formats/trd_dsk.o floppyoptions_trd
./lib/formats/trd_dsk.o _ZL16trd_dsk_identifyP13_floppy_imagePK12FloppyFormatPi

mangled-all-resolved.txt has all the files with the definitions they contain. mangled-all-unresolved.txt has all the files with the definitions they're missing, which must be found elsewhere. all-resolved.txt has human-readable function names in case something goes wrong: just grep for whatever your errors say there's an "undefined reference to" to find the .o file that's missing. (This shouldn't happen.)

Replace the files in helpers with these new versions. You should be able to use them as-is with fulldeps.sh, to create a list of all the DRVLIBS dependencies for any system makefile.