summaryrefslogtreecommitdiffstats
path: root/package/nano/nano.mk
blob: 0327dd81ea5c34a86872a12a9220a812c383964f (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
#############################################################
#
# nano
#
#############################################################
NANO_VER:=1.3.4
NANO_SOURCE:=nano-$(NANO_VER).tar.gz
NANO_SITE:=http://www.nano-editor.org/dist/v1.3/$(NANO_SOURCE)
NANO_DIR:=$(BUILD_DIR)/nano-$(NANO_VER)
NANO_CAT:=zcat
NANO_BINARY:=src/nano
NANO_TARGET_BINARY:=bin/nano

$(DL_DIR)/$(NANO_SOURCE):
	$(WGET) -P $(DL_DIR) $(NANO_SITE)/$(NANO_SOURCE)

$(NANO_DIR)/.unpacked: $(DL_DIR)/$(NANO_SOURCE)
	$(NANO_CAT) $(DL_DIR)/$(NANO_SOURCE) | tar -C $(BUILD_DIR) -x$(TAR_VERBOSITY)f -
	touch $(NANO_DIR)/.unpacked

$(NANO_DIR)/.configured: $(NANO_DIR)/.unpacked
	(cd $(NANO_DIR); rm -rf config.cache; \
		$(TARGET_CONFIGURE_OPTS) CC_FOR_BUILD=$(HOSTCC) \
		CFLAGS="$(TARGET_CFLAGS)" \
		ac_cv_header_regex_h=no \
		./configure \
		--target=$(GNU_TARGET_NAME) \
		--host=$(GNU_TARGET_NAME) \
		--build=$(GNU_HOST_NAME) \
		--prefix=/ \
		--enable-tiny \
	);
	touch $(NANO_DIR)/.configured

$(NANO_DIR)/$(NANO_BINARY): $(NANO_DIR)/.configured
	$(TARGET_CONFIGURE_OPTS) $(MAKE) CC=$(TARGET_CC) -C $(NANO_DIR)

$(TARGET_DIR)/$(NANO_TARGET_BINARY): $(NANO_DIR)/$(NANO_BINARY)
	install -D $(NANO_DIR)/$(NANO_BINARY) $(TARGET_DIR)/$(NANO_TARGET_BINARY)

nano: uclibc $(TARGET_DIR)/$(NANO_TARGET_BINARY)

nano-clean:
	rm -f $(TARGET_DIR)/$(NANO_TARGET_BINARY)
	-$(MAKE) -C $(NANO_DIR) clean

nano-dirclean:
	rm -rf $(NANO_DIR)