Help is autogenerated from parameter descriptions.
[gfxprim.git] / gen.mk
blob41ad5f5244b38ed75f32aa0e56962dc54aeab9a4
2 # This is makefile rule for generating C sources from python generators
4 ifndef LIBNAME
5 $(error LIBNAME not defined, fix your library Makefile)
6 endif
8 ifndef GENHEADERS
9 GENHEADERS=
10 endif
12 ifndef GENSOURCES
13 GENSOURCES=
14 endif
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
30 all: $(RGENHEADERS)
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))
46 # And clean them
48 CLEAN+=$(GENSOURCES) $(RGENHEADERS)
51 # Generated files depend on python generators and the template
53 $(GENSOURCES) $(RGENHEADERS): %: %.t $(PYTHON_FILES)
54 ifdef VERBOSE
55 ${PYTHON} ${TOPDIR}/pylib/bin/generate_file.py -t $(TEMPLATE_DIR) "$@.t" "$@"
56 else
57 @echo "GEN $@"
58 @${PYTHON} ${TOPDIR}/pylib/bin/generate_file.py -t $(TEMPLATE_DIR) "$@.t" "$@"
59 endif