summaryrefslogtreecommitdiff
path: root/package/sysvinit/sysvinit.mk
blob: 6309e3e195fa876842b4b7500b0d1c8e9e38fa87 (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
#############################################################
#
# sysvinit
#
#############################################################
SYSVINIT_VERSION:=2.86
SYSVINIT_SOURCE:=sysvinit-$(SYSVINIT_VERSION).tar.gz
SYSVINIT_SITE:=ftp://ftp.cistron.nl/pub/people/miquels/software
SYSVINIT_DIR:=$(BUILD_DIR)/sysvinit-$(SYSVINIT_VERSION)
SYSVINIT_CAT:=$(ZCAT)
SYSVINIT_BINARY:=src/init
SYSVINIT_TARGET_BINARY:=sbin/init

$(DL_DIR)/$(SYSVINIT_SOURCE):
	$(call DOWNLOAD,$(SYSVINIT_SITE),$(SYSVINIT_SOURCE))

sysvinit-unpacked: $(SYSVINIT_DIR)/.unpacked
$(SYSVINIT_DIR)/.unpacked: $(DL_DIR)/$(SYSVINIT_SOURCE)
	$(SYSVINIT_CAT) $(DL_DIR)/$(SYSVINIT_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	toolchain/patch-kernel.sh $(SYSVINIT_DIR) package/sysvinit/ sysvinit-\*.patch
	touch $@

$(SYSVINIT_DIR)/$(SYSVINIT_BINARY): $(SYSVINIT_DIR)/.unpacked
	CFLAGS="$(TARGET_CFLAGS)" $(MAKE) CC=$(TARGET_CC) -C $(SYSVINIT_DIR)/src

$(TARGET_DIR)/$(SYSVINIT_TARGET_BINARY): $(SYSVINIT_DIR)/$(SYSVINIT_BINARY)
	for x in halt init shutdown; do \
		install -D $(SYSVINIT_DIR)/src/$$x $(TARGET_DIR)/sbin/$$x || exit 1; \
	done

sysvinit: ncurses $(TARGET_DIR)/$(SYSVINIT_TARGET_BINARY)

sysvinit-source: $(DL_DIR)/$(SYSVINIT_SOURCE)

sysvinit-clean:
	for x in halt init shutdown; do \
		rm -f $(TARGET_DIR)/sbin/$$x || exit 1; \
	done
	-$(MAKE) -C $(SYSVINIT_DIR) clean

sysvinit-dirclean:
	rm -rf $(SYSVINIT_DIR)
#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_SYSVINIT),y)
TARGETS+=sysvinit
endif