summaryrefslogtreecommitdiff
path: root/package/dash/dash.mk
blob: 827db855ef8abd2a292a84bdbe53c0247607823c (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
#############################################################
#
# dash
#
#############################################################
DASH_VER:=0.5.3
DASH_SOURCE:=dash_$(DASH_VER).orig.tar.gz
DASH_SITE:=http://ftp.debian.org/debian/pool/main/d/dash
DASH_CAT:=$(ZCAT)
DASH_DIR:=$(BUILD_DIR)/dash-$(DASH_VER)
DASH_PATCH1:=dash_$(DASH_VER)-7.diff.gz
DASH_BINARY:=src/dash
DASH_TARGET_BINARY:=bin/dash

$(DL_DIR)/$(DASH_SOURCE):
	$(WGET) -P $(DL_DIR) $(DASH_SITE)/$(DASH_SOURCE)

$(DL_DIR)/$(DASH_PATCH1):
	$(WGET) -P $(DL_DIR) $(DASH_SITE)/$(DASH_PATCH1)

dash-source: $(DL_DIR)/$(DASH_SOURCE) $(DL_DIR)/$(DASH_PATCH1)

$(DASH_DIR)/.unpacked: $(DL_DIR)/$(DASH_SOURCE) $(DL_DIR)/$(DASH_PATCH1)
	$(DASH_CAT) $(DL_DIR)/$(DASH_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	$(ZCAT) $(DL_DIR)/$(DASH_PATCH1) | patch -p1 -d $(DASH_DIR)
	touch $(DASH_DIR)/.unpacked

$(DASH_DIR)/.configured: $(DASH_DIR)/.unpacked
	(cd $(DASH_DIR); rm -rf config.cache; \
		$(TARGET_CONFIGURE_OPTS) \
		CFLAGS="$(TARGET_CFLAGS)" \
		LDFLAGS="$(TARGET_LDFLAGS)" \
		./configure \
		--target=$(GNU_TARGET_NAME) \
		--host=$(GNU_TARGET_NAME) \
		--build=$(GNU_HOST_NAME) \
		--prefix=/usr \
		--exec-prefix=/usr \
		--bindir=/usr/bin \
		--sbindir=/usr/sbin \
		--libexecdir=/usr/lib \
		--sysconfdir=/etc \
		--datadir=/usr/share \
		--localstatedir=/var \
		--mandir=/usr/man \
		--infodir=/usr/info \
	);
	touch $(DASH_DIR)/.configured

$(DASH_DIR)/$(DASH_BINARY): $(DASH_DIR)/.configured
	$(MAKE1) CC=$(TARGET_CC) CC_FOR_BUILD="$(HOSTCC)" -C $(DASH_DIR)
	touch -c $(DASH_DIR)/$(DASH_BINARY)

$(TARGET_DIR)/$(DASH_TARGET_BINARY): $(DASH_DIR)/$(DASH_BINARY)
	cp -a $(DASH_DIR)/$(DASH_BINARY) $(TARGET_DIR)/$(DASH_TARGET_BINARY)
	touch -c $(TARGET_DIR)/$(DASH_TARGET_BINARY)

dash: uclibc $(TARGET_DIR)/$(DASH_TARGET_BINARY)

dash-clean:
	$(MAKE1) CC=$(TARGET_CC) -C $(DASH_DIR) clean
	rm -f $(TARGET_DIR)/$(DASH_TARGET_BINARY)

dash-dirclean:
	rm -rf $(DASH_DIR)

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(strip $(BR2_PACKAGE_DASH)),y)
TARGETS+=dash
endif