google / u2f-ref-code

U2F reference implementations
BSD 3-Clause "New" or "Revised" License
588 stars 182 forks source link

How to build u2f-test/HID under Mac #171

Open stephenwwu opened 6 years ago

stephenwwu commented 6 years ago

I try to build the code under Mac, but failed. What is the build environment requirements? Error message:

make: *** No rule to make target hidapi/mac/hid.c', needed byhid.o'. Stop.

mschilder123 commented 6 years ago

see DEPENDENCIES in the README

git clone https://github.com/signal11/hidapi git clone -b lollipop-release https://android.googlesource.com/platform/system/core

On Thu, Feb 15, 2018 at 3:25 PM, stephenwwu notifications@github.com wrote:

I try to build the code under Mac, but failed. What is the build environment requirements? Error message:

make: *** No rule to make target hidapi/mac/hid.c', needed byhid.o'. Stop.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/u2f-ref-code/issues/171, or mute the thread https://github.com/notifications/unsubscribe-auth/AFpd9AluAlEToJ7Qw_U4mY7j_nD9_NK-ks5tVLzmgaJpZM4SHqtk .

stephenwwu commented 6 years ago

I cloned both source codes side-by-side with u2f-ref-code already. It still can't find hid.c. What settings should I change to make it built?

mschilder123 commented 6 years ago

Run the git clone commands in the HID subdirectory; the super simplistic Makefile assumes these as subdirectories thereof. Or modify the Makefile to look for these sources where you put them.

On Sat, Feb 17, 2018 at 3:51 PM, stephenwwu notifications@github.com wrote:

I cloned both source codes side-by-side with u2f-ref-code already. It still can't find hid.c. What settings should I change to make it built?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google/u2f-ref-code/issues/171#issuecomment-366480361, or mute the thread https://github.com/notifications/unsubscribe-auth/AFpd9ABP19XGLka-WyZsZwVRKqmnXTPzks5tV2XwgaJpZM4SHqtk .

stephenwwu commented 6 years ago

It is not clear in the instruction. Cloning another repo to a subdirectory of another repo doesn't look like a good practice to me. How about add something like $(HIDAPI_PATH) in the make file, and remind user to set the path to the right location?