rules.mk 835 B

12345678910111213141516171819202122232425262728293031
  1. TGT_DIR += $(b)pybison
  2. PYBISON_INC := -Iexternal/pybison/src/c -I/usr/include/python2.7
  3. build: $(b)pybison/bison_.so $(b)pybison/bison.py
  4. $(b)pybison/bison_.so: $(b)pybison/bison_.o $(b)pybison/bisondynlib-linux.o
  5. $(CC) $(CFLAGS) -shared -pthread -o $@ $^
  6. $(b)pybison/bison.py: $(d)pybison/src/python/bison.py | $(b)pybison
  7. ln -s `realpath $<` $@
  8. $(b)pybison/bisondynlib-linux.o $(b)pybison/bison_.o: | $(b)pybison
  9. $(CC) $(CFLAGS) -o $@ -c $< -pthread -fPIC $(PYBISON_INC)
  10. $(b)pybison/bisondynlib-linux.o: $(d)pybison/src/c/bisondynlib-linux.c
  11. $(b)pybison/bison_.o: $(b)pybison/bison_.c
  12. ifdef PYREX
  13. py2c := pyrexc
  14. else
  15. ifdef CYTHON_0_14
  16. py2c := cython --fast-fail --line-directives
  17. else
  18. py2c := cython -Wextra -Werror --fast-fail --line-directives
  19. endif
  20. endif
  21. $(b)pybison/%.c: $(d)pybison/src/pyrex/%.pyx
  22. $(py2c) -o $@ $<