Conditional Dependencies in Make

Make is the de facto build tool on Linux. I needed a way to conditionally require a dependency. Here is how I did it: Before any of the executable code, I placed this if clause: ifeq ($(findstring $(TARGET),$(wildcard *.s)), $(TARGET)) conditional_file_exists = $(TARGET).o else conditional_file_exists = $() endif Then, I placed $(conditional_file_exists) in the dependency Read more about Conditional Dependencies in Make[…]