Added hand-made smoke tests for GP_Convert
[gfxprim.git] / gen.mk
blob5df5588a87aebe6d97ae645fbf3a0bf2a784bc26
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 goes 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)
32 $(CSOURCES): $(RGENHEADERS)
35 # And clean them
37 CLEAN+=$(GENSOURCES) $(RGENHEADERS)
40 # Currently, just depend on all python files
42 GENERATORS=$(PYTHON_FILES)
45 # Generated files depend on python generators and libs
47 %.gen.c %.gen.h: $(GENERATORS)
48 ifdef VERBOSE
49 ${PYTHON} ${TOPDIR}/pylib/bin/generate_file.py "$@"
50 else
51 @echo "GEN $@"
52 @${PYTHON} ${TOPDIR}/pylib/bin/generate_file.py "$@"
53 endif