FAQ

[android-ndk] Help on to write a rule in Android.mk

praveen kumar R
Feb 3, 2012 at 9:53 am
Hi All,
I have a problem in adding the fallowing two rules in Android.mk make
file.

1.arm-linux-androideabi-gcc -g -O2 -s -static -c -I../install/
include/libusb-1.0 -o usb.o usb.c

2.arm-linux-androideabi-gcc -std=gnu99 -fgnu89-inline -Wall -Wundef -
Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-
pointer-sign -Wshadow -g -O2 -s -o lsusb lsusb.o ../libusb/.libs/
libusb-1.0.a

Here how it works
the rule 1 generates lsusb.o only with only -c (-c--.Compile and
assemble, but do not link) and the 2 rule uses the .o genrated from 1
to generate lsusb executable.

This i have to add in the android make file.
I tried to get the .o by adding the fallowing lines in my Android mk
file

//////////////////////////////////////////////////////////////
#Clear variables and build the executable
include $(CLEAR_VARS)

LOCAL_MODULE:= Usb.o
LOCAL_MODULE_TAGS := eng
LOCAL_CFLAGS:= -g -O2 -s -static -c -o
LOCAL_SRC_FILES:= Usb.c
#The shared libraries to link against
LOCAL_SHARED_LIBRARIES += libc

include $(BUILD_EXECUTABLE)

//////////////////////////////////////////////////////////////////

but I get errors when compile

make: Circular out/target//obj/EXECUTABLES/Usb.o_intermediates/LINKED/
Usb.o <- out/target/product/mars/obj/EXECUTABLES/Usb.o_intermediates/
polyUsb.o dependency dropped.
target Executable: Usb.o (out/target/obj/EXECUTABLES/
Usb.o_intermediates/LINKEDUsb.o)
arm-eabi-g++: out/target/obj/EXECUTABLES/Usb.o_intermediates/Usb.o: No
such file or directory
make: *** [out/target/obj/EXECUTABLES/Usb.o_intermediates/LINKED/
Usb.o] Error 1.


How do I put the above two rules in the Android make file ..?

Thanks,
Praveen

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to android-ndk@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
reply

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post

1 user in discussion

praveen kumar R: 1 post