loaders: BMP loader, fix 24 BPP, add 1 BPP todo: palettes
[gfxprim.git] / gen.mk
blobef10aa4de67d46bf8995210e2ec9d45f84159d0f
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 # 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 # 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