2 # This is makefile rule for generating C sources from python generators
5 $(error LIBNAME not defined
, fix your library Makefile
)
17 # Generate genfiles for generated sources
19 CSOURCES
+=$(GENSOURCES
)
22 # Make the genrated headers actually build
24 all: $(GENHEADERS
) $(GENSOURCES
)
27 # Base common templates location
29 TEMPLATE_DIR
=$(TOPDIR
)/pylib
/templates
/
32 # ALL templates and potential generated files (not generated automatically)
33 # NOTE: Currently unused
35 ALL_TEMPLATES
=$(shell find
$(TOPDIR
) -name
'*.t')
36 ALL_GENERATED
=$(basename $(ALL_TEMPLATES
))
41 CLEAN
+=$(GENSOURCES
) $(GENHEADERS
)
44 # Add templates as dependencies
46 PYTHON_FILES
=$(shell find
$(TEMPLATE_DIR
) -name
'*.t')
47 $(GENSOURCES
) $(GENHEADERS
): $(PYTHON_FILES
)
50 # Generated files depend on python generators and the template
52 $(GENSOURCES
) $(GENHEADERS
): %: %.t
54 ${PYTHON} ${TOPDIR}/pylib
/bin
/generate_file.py
-t
$(TEMPLATE_DIR
) "$@.t" "$@"
57 @
${PYTHON} ${TOPDIR}/pylib
/bin
/generate_file.py
-t
$(TEMPLATE_DIR
) "$@.t" "$@"