aboutsummaryrefslogtreecommitdiffstats
path: root/package/less/less.mk
blob: 9b9b9c1a604893e993b3b0be1ff1b141abd5ebf9 (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
#############################################################
#
# less
#
#############################################################
LESS_VERSION:=394
LESS_SOURCE:=less-$(LESS_VERSION).tar.gz
LESS_SITE:=http://www.greenwoodsoftware.com/less
LESS_DIR:=$(BUILD_DIR)/less-$(LESS_VERSION)
LESS_BINARY:=less
LESS_TARGET_BINARY:=usr/bin/less

$(DL_DIR)/$(LESS_SOURCE):
	$(call DOWNLOAD,$(LESS_SITE),$(LESS_SOURCE))

$(LESS_DIR)/.source: $(DL_DIR)/$(LESS_SOURCE)
	$(ZCAT) $(DL_DIR)/$(LESS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	touch $@

$(LESS_DIR)/.configured: $(LESS_DIR)/.source
	(cd $(LESS_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 $@

$(LESS_DIR)/$(LESS_BINARY): $(LESS_DIR)/.configured
	$(MAKE) CC=$(TARGET_CC) -C $(LESS_DIR)

$(TARGET_DIR)/$(LESS_TARGET_BINARY): $(LESS_DIR)/$(LESS_BINARY)
	$(MAKE) prefix=$(TARGET_DIR)/usr -C $(LESS_DIR) install
ifneq ($(BR2_HAVE_MANPAGES),y)
	rm -Rf $(TARGET_DIR)/usr/man
endif

less: uclibc ncurses $(TARGET_DIR)/$(LESS_TARGET_BINARY)

less-source: $(DL_DIR)/$(LESS_SOURCE)

less-clean:
	$(MAKE) prefix=$(TARGET_DIR)/usr -C $(LESS_DIR) uninstall
	-$(MAKE) -C $(LESS_DIR) clean

less-dirclean:
	rm -rf $(LESS_DIR)

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_LESS),y)
TARGETS+=less
endif