summaryrefslogtreecommitdiff
path: root/package/ncftp/ncftp.mk
blob: 6a7a32b719f11ed671303afe2c32c11fedb02f21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#############################################################
#
# ncftp client
#
#############################################################
NCFTP_VERSION:=3.2.1
NCFTP_SOURCE:=ncftp-$(NCFTP_VERSION)-src.tar.bz2
NCFTP_SITE:=ftp://ftp.ncftp.com/ncftp
NCFTP_DIR:=$(BUILD_DIR)/ncftp-$(NCFTP_VERSION)

NCFTP_TARGET_BINS:=ncftp

ifeq ($(strip $(BR2_PACKAGE_NCFTP_GET)),y)
NCFTP_TARGET_BINS+=ncftpget
endif

ifeq ($(strip $(BR2_PACKAGE_NCFTP_PUT)),y)
NCFTP_TARGET_BINS+=ncftpput
endif

ifeq ($(strip $(BR2_PACKAGE_NCFTP_LS)),y)
NCFTP_TARGET_BINS+=ncftpls
endif

ifeq ($(strip $(BR2_PACKAGE_NCFTP_BATCH)),y)
NCFTP_TARGET_BINS+=ncftpbatch
endif

ifeq ($(strip $(BR2_PACKAGE_NCFTP_SPOOLER)),y)
#Someone needs to figure out what to do...
NCFTP_TARGET_BINS+=
endif

ifeq ($(strip $(BR2_PACKAGE_NCFTP_BOOKMARKS)),y)
NCFTP_TARGET_BINS+=ncftpbookmarks
endif

ncftp-source: $(DL_DIR)/$(NCFTP_SOURCE)

$(DL_DIR)/$(NCFTP_SOURCE):
	$(WGET) -P $(DL_DIR) $(NCFTP_SITE)/$(NCFTP_SOURCE)

$(NCFTP_DIR)/.source: $(DL_DIR)/$(NCFTP_SOURCE)
	$(BZCAT) $(DL_DIR)/$(NCFTP_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	touch $@

$(NCFTP_DIR)/.configured: $(NCFTP_DIR)/.source
	(cd $(NCFTP_DIR); rm -f config.cache; \
		$(TARGET_CONFIGURE_OPTS) \
		$(TARGET_CONFIGURE_ARGS) \
		./configure \
		--target=$(GNU_TARGET_NAME) \
		--host=$(GNU_TARGET_NAME) \
		--build=$(GNU_HOST_NAME) \
		--prefix=/usr \
		--sysconfdir=/etc \
	)
	touch $@

$(NCFTP_DIR)/bin/%: $(NCFTP_DIR)/.configured
	$(MAKE) -C $(NCFTP_DIR)

$(TARGET_DIR)/usr/bin/ncftp $(TARGET_DIR)/usr/bin/ncftp%: $(addprefix $(NCFTP_DIR)/bin/, $(NCFTP_TARGET_BINS))
	$(INSTALL) -m 0755 $(NCFTP_DIR)/bin/$(notdir $@) $(TARGET_DIR)/usr/bin
	$(STRIPCMD) $(STRIP_STRIP_ALL) $@

ncftp: uclibc $(addprefix $(TARGET_DIR)/usr/bin/, $(NCFTP_TARGET_BINS))

ncftp-clean:
	-$(MAKE) -C $(NCFTP_DIR) clean
	rm -rf $(addprefix $(TARGET_DIR)/usr/bin/, $(NCFTP_TARGET_BINS))

ncftp-dirclean:
	rm -rf $(NCFTP_DIR)

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(strip $(BR2_PACKAGE_NCFTP)),y)
TARGETS+=ncftp
endif