I want to make a conditional makefile where some source files are exluded from the build depending on LOCAL_CFLAGS values. Any ways I can do it?
Asked
Active
Viewed 320 times
0
-
1Have you tried anything? – Etan Reisner Aug 18 '14 at 15:10
-
I tried: LOCAL_SRC_FILES:= \ file1.cpp ifneq (, $(findstring _MY_VALUE,$(LOCAL_CFLAGS))) LOCAL_SRC_FILES += \ file2.cpp endif – user3933974 Aug 18 '14 at 16:47
-
Drop the space after the comma in the `ifneq` and that should work correctly for when `_MY_VALUE` is in `LOCAL_CFLAGS`. I'm assuming it always evaluates to true at the moment. – Etan Reisner Aug 18 '14 at 16:57
-
It now works. It seems like I had a typo somewhere. – user3933974 Aug 18 '14 at 18:10