NDK 8b, Eclipse / Cygwin
I'm trying to add custom pre-build steps to Android.mk:
1) for every *.xyz file in the source tree, run a custom tool which generates corresponding .h and .cpp files
2) add the .cpp files to LOCAL_SRC_FILES
I've read this post and it's not quite what I'm looking for (it's only for one file)
According http://www.gnu.org/software/make/manual/make.html you can use old-fashioned suffix rules:
source_xyz_files = a.xyz b.xyz
.xyz.cpp: $(source_xyz_files)
if test "`dirname $@`" != "."; then mkdir -p "`dirname $@`"; fi
tool_to_create_cpp_and_h_from_xyz $< $@ $(patsubst %.cpp,%.h,$@)
LOCAL_SRC_FILES += $(patsubst %.xyz,%.cpp,$(source_xyz_files))
or patter rules:
generated_cpp_files = a.cpp b.cpp
$(generated_cpp_files) : %.cpp : %.xyz
if test "`dirname $@`" != "."; then mkdir -p "`dirname $@`"; fi
tool_to_create_cpp_and_h_from_xyz $< $@ $(patsubst %.cpp,%.h,$@)
LOCAL_SRC_FILES += $(generated_cpp_files)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With