mphidflash
mphidflash copied to clipboard
make mphidflash64 fails: /binaries/ does not exist
make mphidflash64
gcc main.o hex.o usb-libusb.o -lusb -m64 -o binaries/mphidflash-1.8-linux-64
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot open output file binaries/mphidflash-1.8-linux-64: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [Makefile:48: mphidflash] Error 1
you have to create "binaries" directory in the Makefile
I have no idea how you created your source tree, but if you simply clone this repo the binaries directory is there:
$ git clone [email protected]:ApertureLabsLtd/mphidflash.git Cloning into 'mphidflash'... remote: Counting objects: 162, done. remote: Total 162 (delta 0), reused 0 (delta 0), pack-reused 162 Receiving objects: 100% (162/162), 355.92 KiB | 370.00 KiB/s, done. Resolving deltas: 100% (89/89), done. Checking connectivity... done. addy@blap:tmp$ cd mphidflash/ addy@blap:mphidflash$ ls binaries CHANGELOG COPYING dist hex.c main.c Makefile Makefile.win mphidflash.h README.txt usb-libusb.c usb-linux.c usb-osx.c usb-windows.c addy@blap:mphidflash$ ls binaries/ mphidflash-1.5-linux-64 mphidflash-1.5-osx-64 mphidflash-1.5-win-32.zip mphidflash-1.6-linux-64 mphidflash-1.6-osx-64 mphidflash-1.7-linux-32 mphidflash-1.5-osx-32 mphidflash-1.5-win-32.exe mphidflash-1.6-linux-32 mphidflash-1.6-osx-32 mphidflash-1.6-win-32.exe mphidflash-1.7-linux-64 addy@blap:mphidflash$ make mphidflash64 gcc -O3 -DVERSION_MAIN=1 -DVERSION_SUB=8 -m64 -c main.c gcc -O3 -DVERSION_MAIN=1 -DVERSION_SUB=8 -m64 -c hex.c gcc -O3 -DVERSION_MAIN=1 -DVERSION_SUB=8 -m64 -c usb-libusb.c gcc main.o hex.o usb-libusb.o -lusb -m64 -o binaries/mphidflash-1.8-linux-64 strip binaries/mphidflash-1.8-linux-64
OK, I see - if you unpack the source distro there is no binaries directory. We can add creating this to the Makefile but unfortunately Windows (and possibly OS/X?) do it differently so we need to be careful to do it in a way that's not gonna break things if the directory already exists. Linux is simple: 'mkdir -p' but I'm not a Windows or OS/X guy so can someone confirm a method that works for each of those, and also tweak the Makefile so it knows when it's running Windows?
I'm not windows guy neither, but here is what I found: http://stackoverflow.com/questions/3228306/portable-makefile-creation-of-directories
Windows mkdir always does what Unix mkdir does with the -p switch on. And you can deal with the backslash problem with $(subst).