libclean: find the libraries properly
authorAlan Cox <alan@linux.intel.com>
Wed, 21 Oct 2015 09:13:45 +0000 (10:13 +0100)
committerAlan Cox <alan@linux.intel.com>
Wed, 21 Oct 2015 09:13:45 +0000 (10:13 +0100)
Library/tools/libclean

index 1a9fb04..662d6e2 100755 (executable)
@@ -4,17 +4,10 @@
 #      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