bison.mk 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #############################################################
  2. #
  3. # bison
  4. #
  5. #############################################################
  6. BISON_VER:=2.1
  7. BISON_SOURCE:=bison-$(BISON_VER).tar.bz2
  8. BISON_SITE:=ftp://ftp.gnu.org/gnu/bison
  9. BISON_DIR:=$(BUILD_DIR)/bison-$(BISON_VER)
  10. BISON_CAT:=bzcat
  11. BISON_BINARY:=src/bison
  12. BISON_TARGET_BINARY:=usr/bin/bison
  13. $(DL_DIR)/$(BISON_SOURCE):
  14. $(WGET) -P $(DL_DIR) $(BISON_SITE)/$(BISON_SOURCE)
  15. bison-source: $(DL_DIR)/$(BISON_SOURCE)
  16. $(BISON_DIR)/.unpacked: $(DL_DIR)/$(BISON_SOURCE)
  17. $(BISON_CAT) $(DL_DIR)/$(BISON_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  18. touch $(BISON_DIR)/.unpacked
  19. $(BISON_DIR)/.configured: $(BISON_DIR)/.unpacked
  20. (cd $(BISON_DIR); rm -rf config.cache; \
  21. $(TARGET_CONFIGURE_OPTS) \
  22. CFLAGS="$(TARGET_CFLAGS)" \
  23. gt_cv_func_gnugettext2_libintl=yes \
  24. ./configure \
  25. --target=$(GNU_TARGET_NAME) \
  26. --host=$(GNU_TARGET_NAME) \
  27. --build=$(GNU_HOST_NAME) \
  28. --prefix=/usr \
  29. --exec-prefix=/usr \
  30. --bindir=/usr/bin \
  31. --sbindir=/usr/sbin \
  32. --libexecdir=/usr/lib \
  33. --sysconfdir=/etc \
  34. --datadir=/usr/share \
  35. --localstatedir=/var \
  36. --mandir=/usr/man \
  37. --infodir=/usr/info \
  38. $(DISABLE_NLS) \
  39. );
  40. echo 'all install:' > $(BISON_DIR)/examples/Makefile
  41. touch $(BISON_DIR)/.configured
  42. $(BISON_DIR)/$(BISON_BINARY): $(BISON_DIR)/.configured
  43. $(MAKE) CC=$(TARGET_CC) -C $(BISON_DIR)
  44. $(TARGET_DIR)/$(BISON_TARGET_BINARY): $(BISON_DIR)/$(BISON_BINARY)
  45. $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(BISON_DIR) install
  46. rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
  47. $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
  48. cp -a package/bison/yacc $(TARGET_DIR)/usr/bin/yacc
  49. bison: uclibc $(TARGET_DIR)/$(BISON_TARGET_BINARY)
  50. bison-clean:
  51. $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(BISON_DIR) uninstall
  52. -$(MAKE) -C $(BISON_DIR) clean
  53. bison-dirclean:
  54. rm -rf $(BISON_DIR)
  55. #############################################################
  56. #
  57. # Toplevel Makefile options
  58. #
  59. #############################################################
  60. ifeq ($(strip $(BR2_PACKAGE_BISON)),y)
  61. TARGETS+=bison
  62. endif