I have a list of files such as:
SOURCES = program1.txt \
program2.txt \
... \
program_n.txt
from which I want to generate, when specified, handlers in C, Python, etc. These will later be compiled/included by a top makefile.
how can I write my makefile so from each file in SOURCES, it generates its handler by calling a script.
the main targets should be something like:
all: handler_py handler_c ... handler_whatever
handler_py: all_my_possible_python_handlers
handler_c: all_my_possible_c_handlers
handler_whatever: all_my_possible_whatever_handlers
So in the end we get
sources/(name_of_program).txt produces output/handler_type/my_handler_(name_of_program).handler_type
The idea is that whenever I write a new program I only have to update the SOURCES list
instead of copy-pasting this for example:
handler_py : output/my_handler_program.py output/my_handler_program1.py ...
output/my_handler_program.py : sources/program.txt
./generate_handler.py py sources/program.txt
output/my_handler_program1.py : sources/program1.txt
./generate_handler.py py sources/program1.txt
...