dhcpdump.mk 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #############################################################
  2. #
  3. # dhcpdump
  4. #
  5. #############################################################
  6. # Copyright (C) 2001-2003 by Erik Andersen <andersen@codepoet.org>
  7. # Copyright (C) 2002 by Tim Riker <Tim@Rikers.org>
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU Library General Public License as
  11. # published by the Free Software Foundation; either version 2 of the
  12. # License, or (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful, but
  15. # WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. # Library General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU Library General Public
  20. # License along with this program; if not, write to the Free Software
  21. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  22. # USA
  23. DHCPDUMP_VER:=1.4
  24. DHCPDUMP_DIR:=$(BUILD_DIR)/dhcpdump-$(DHCPDUMP_VER)
  25. DHCPDUMP_SITE:=http://www.mavetju.org/download/
  26. DHCPDUMP_SOURCE:=dhcpdump-$(DHCPDUMP_VER).tar.gz
  27. DHCPDUMP_CAT:=zcat
  28. $(DL_DIR)/$(DHCPDUMP_SOURCE):
  29. $(WGET) -P $(DL_DIR) $(DHCPDUMP_SITE)/$(DHCPDUMP_SOURCE)
  30. dhcpdump-source: $(DL_DIR)/$(DHCPDUMP_SOURCE)
  31. $(DHCPDUMP_DIR)/.unpacked: $(DL_DIR)/$(DHCPDUMP_SOURCE)
  32. $(DHCPDUMP_CAT) $(DL_DIR)/$(DHCPDUMP_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  33. touch $(DHCPDUMP_DIR)/.unpacked
  34. $(DHCPDUMP_DIR)/.configured: $(DHCPDUMP_DIR)/.unpacked
  35. ( \
  36. cd $(DHCPDUMP_DIR) ; \
  37. BUILD_CC=$(TARGET_CC) HOSTCC=$(HOSTCC) \
  38. $(TARGET_CONFIGURE_OPTS) \
  39. CFLAGS="$(TARGET_CFLAGS)" \
  40. ./configure \
  41. --target=$(GNU_TARGET_NAME) \
  42. --host=$(GNU_TARGET_NAME) \
  43. --build=$(GNU_HOST_NAME) \
  44. --with-build-cc=$(HOSTCC) \
  45. --prefix=$(STAGING_DIR) \
  46. --libdir=$(STAGING_DIR)/lib \
  47. --includedir=$(STAGING_DIR)/include \
  48. )
  49. touch $(DHCPDUMP_DIR)/.configured
  50. $(DHCPDUMP_DIR)/dhcpdump: $(DHCPDUMP_DIR)/.configured
  51. $(MAKE) -C $(DHCPDUMP_DIR)
  52. $(TARGET_DIR)/sbin/dhcpdump: $(DHCPDUMP_DIR)/dhcpdump
  53. cp -af $< $@
  54. dhcpdump: uclibc zlib libpcap $(TARGET_DIR)/sbin/dhcpdump
  55. dhcpdump-clean:
  56. rm -f $(TARGET_DIR)/sbin/dhcpdump
  57. -$(MAKE) -C $(DHCPDUMP_DIR) clean
  58. dhcpdump-dirclean:
  59. rm -rf $(DHCPDUMP_DIR)
  60. #############################################################
  61. #
  62. # Toplevel Makefile options
  63. #
  64. #############################################################
  65. ifeq ($(strip $(BR2_PACKAGE_DHCPDUMP)),y)
  66. TARGETS+=dhcpdump
  67. endif