filters: Add generated cubic resampling (with gamma) yay!
[gfxprim.git] / gen.mk
blob14aac0dd2f89808ddfc08cd60d362bb82eda61fb
2 # This is makefile rule for generating C sources from python templates
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 # We add these to CSOURCES which is handled in post.mk
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 # And clean them
34 CLEAN+=$(GENSOURCES) $(GENHEADERS)
37 # Some base dependencies
39 $(GENSOURCES): $(TEMPLATE_DIR)/base.c.t $(TEMPLATE_DIR)/common.c.t
40 $(GENHEADERS): $(TEMPLATE_DIR)/base.h.t
43 # Generated files depend on python generators and the template
45 $(GENSOURCES) $(GENHEADERS): %: %.t
46 ifdef VERBOSE
47 ${PYTHON} ${TOPDIR}/pylib/bin/generate_file.py -t $(TEMPLATE_DIR) "$@.t" "$@"
48 else
49 @echo "GEN $@"
50 @${PYTHON} ${TOPDIR}/pylib/bin/generate_file.py -t $(TEMPLATE_DIR) "$@.t" "$@"
51 endif