rules.mk 739 B

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