gary-rowe / hid4java

A cross-platform Java Native Access (JNA) wrapper for the libusb/hidapi library. Works out of the box on Windows/Mac/Linux.
MIT License
229 stars 71 forks source link

build-hidapi.sh: Remove calls to "make clean" #122

Closed tresf closed 1 year ago

tresf commented 3 years ago

Some targets in build-hidapi.sh will fail when make clean is called with the error:

- make: *** No rule to make target `clean'.  Stop.

I propose we abolish all calls to make clean in build-hidapi.sh in favor of reseting the hidapi git repository between builds.

Example:

function git-clean {
  echo -e "Resetting Cpp/hidapi"
  git clean -ffdx > /dev/null 2>&1 || exit   # remove all untracked files
  git reset --hard > /dev/null 2>&1 || exit  # reset all tracked files
}
- echo -e "${green}Building Windows 64-bit${plain}"
+ echo -e "${green}Building Windows 64-bit${plain}" && git-clean
   dockcross-windows-shared-x64 bash -c 'sudo apt-get update && sudo apt-get --yes install libudev-dev libusb-1.0-0-dev && sudo ./bootstrap && sudo ./configure --host=x86_64-w64-mingw32 && sudo make'
// ...
gary-rowe commented 1 year ago

@tresf I've added the git-clean function to the build-hidapi.sh script in develop so I think this issue can be closed now. Thank you for submitting it 😁