2 # This is makefile rule for generating C sources from python generators
5 $(error LIBNAME not defined
, fix your library Makefile
)
17 # Headers go into include/core/
19 INCLUDE_PREFIX
=$(TOPDIR
)/include/$(LIBNAME
)/
20 RGENHEADERS
=$(addprefix $(INCLUDE_PREFIX
),$(GENHEADERS
))
23 # Generate genfiles for generated sources
25 CSOURCES
+=$(GENSOURCES
)
28 # Make the genrated headers actually build
31 $(CSOURCES
): $(RGENHEADERS
)
34 # Base common templates location
36 TEMPLATE_DIR
=$(TOPDIR
)/pylib
/templates
/
39 # ALL templates and potential generated files (not generated automatically)
40 # NOTE: Currently unused
42 ALL_TEMPLATES
=$(shell find
$(TOPDIR
) -name
'*.t')
43 ALL_GENERATED
=$(basename $(ALL_TEMPLATES
))
48 CLEAN
+=$(GENSOURCES
) $(RGENHEADERS
)
51 # Generated files depend on python generators and the template
53 $(GENSOURCES
) $(RGENHEADERS
): %: %.t
$(PYTHON_FILES
)
55 ${PYTHON} ${TOPDIR}/pylib
/bin
/generate_file.py
-t
$(TEMPLATE_DIR
) "$@.t" "$@"
58 @
${PYTHON} ${TOPDIR}/pylib
/bin
/generate_file.py
-t
$(TEMPLATE_DIR
) "$@.t" "$@"