# IMHO beats forking the library or building a private copy.
#
#
-UNAME_S=`uname -s`
+CPU=z80
+LIBZ80=$(shell tools/findsdcc $(CPU))
-if [ x"$SDCC_LIB" = "x" ]; then
- if [ "${UNAME_S}" = "Darwin" ]; then
- SDCC_LIB="/usr/local/share/sdcc/lib"
- else
- SDCC_LIB="/usr/share/sdcc/lib"
- fi
-fi
-
-cp ${SDCC_LIB}/z80/z80.lib tmp.lib
+cp $(LIBZ80)/$(CPU)/$(CPU).lib tmp.lib
#
# Scrub the functions we don't want to inherit
# Need to review setjmp and maybe a couple of others