summaryrefslogtreecommitdiffstats
path: root/rules/bootdisk.make
blob: 30511ed937fc82d40c5c78c0b8b2755241680e6a (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# $Id: bootdisk.make,v 1.1 2003/04/24 08:06:33 jst Exp $
#
# (c) 2002 by Pengutronix e.K., Hildesheim, Germany
# See CREDITS for details about who has contributed to this project. 
#
# For further information about the PTXDIST project and license conditions
# see the README file.
#

#
# We provide this package
#
ifeq (y, $(PTXCONF_GRUB_BOOTDISK))
PACKAGES += bootdisk
endif

#
# Paths and names 
#
BOOTDISK			=
BOOTDISK_URL			=
BOOTDISK_SOURCE			=
BOOTDISK_DIR			= $(TOPDIR)/bootdisk
BOOTDISK_EXTRACT		=

# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

bootdisk_get: $(STATEDIR)/bootdisk.get

$(STATEDIR)/bootdisk.get:
	touch $@

# ----------------------------------------------------------------------------
# Extract
# ----------------------------------------------------------------------------

bootdisk_extract: $(STATEDIR)/bootdisk.extract

$(STATEDIR)/bootdisk.extract: $(STATEDIR)/bootdisk.get
	@echo
	@echo ------------------------
	@echo target: bootdisk.extract
	@echo ------------------------
	@echo
	touch $@

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

bootdisk_prepare: $(STATEDIR)/bootdisk.prepare

$(STATEDIR)/bootdisk.prepare: $(STATEDIR)/bootdisk.extract
	@echo
	@echo ------------------------
	@echo target: bootdisk.prepare
	@echo ------------------------
	@echo
	touch $@

# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------

bootdisk_compile: $(STATEDIR)/bootdisk.compile

$(STATEDIR)/bootdisk.compile: $(STATEDIR)/bootdisk.prepare 
	@echo
	@echo ------------------------
	@echo target: bootdisk.compile
	@echo ------------------------
	@echo
	touch $@

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

bootdisk_install: $(STATEDIR)/bootdisk.install

$(STATEDIR)/bootdisk.install: $(STATEDIR)/bootdisk.compile
	@echo
	@echo ------------------------
	@echo target: bootdisk.install
	@echo ------------------------
	@echo
	touch $@

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

bootdisk_targetinstall: $(STATEDIR)/bootdisk.targetinstall

bootdisk_targetinstall_deps =  $(STATEDIR)/bootdisk.install
bootdisk_targetinstall_deps += $(STATEDIR)/kernel.compile
bootdisk_targetinstall_deps += $(STATEDIR)/grub.compile
bootdisk_targetinstall_deps += $(STATEDIR)/e2fsprogs.compile
bootdisk_targetinstall_deps += $(STATEDIR)/ncurses.compile

$(STATEDIR)/bootdisk.targetinstall: $(bootdisk_targetinstall_deps)
	@echo
	@echo ------------------------------
	@echo target: bootdisk.targetinstall
	@echo ------------------------------
	@echo
        ifeq (y, $(PTXCONF_GRUB_BOOTDISK))
	mkdir -p $(BOOTDISK_DIR)
	mkdir -p $(BOOTDISK_DIR)/boot
	mkdir -p $(BOOTDISK_DIR)/boot/grub
	mkdir -p $(BOOTDISK_DIR)/bin
	mkdir -p $(BOOTDISK_DIR)/lib
	# FIXME: make this architecture independend
	install $(KERNEL_DIR)/arch/i386/boot/bzImage $(BOOTDISK_DIR)/boot/
	install $(GRUB_DIR)/stage1/stage1 $(BOOTDISK_DIR)/boot/grub/
	install $(GRUB_DIR)/stage2/stage2 $(BOOTDISK_DIR)/boot/grub/
	install $(GRUB_DIR)/grub/grub $(BOOTDISK_DIR)/bin/
	strip $(BOOTDISK_DIR)/bin/grub
	# FIXME: make this a config option
	install $(SRCDIR)/grub-menu-flash-ptx1.lst $(BOOTDISK_DIR)/boot/grub/menu-flash.lst
	install $(SRCDIR)/grub-menu-disk-ptx1.lst  $(BOOTDISK_DIR)/boot/grub/menu-disk.lst
	ln -sf menu-disk.lst $(BOOTDISK_DIR)/boot/grub/menu.lst
	install $(E2FSPROGS_DIR)/misc/mke2fs $(BOOTDISK_DIR)/bin/
	install $(NCURSES_DIR)/lib/libncurses.so.5.2 $(BOOTDISK_DIR)/lib/
	strip $(BOOTDISK_DIR)/lib/libncurses.so.5.2
        endif
	# FIXME: is this the correct file for this rule? 
        ifeq (y, $(PTXCONF_PTXFLASH))
	mkdir -p $(ROOTDIR)/sbin
	install $(SRCDIR)/ptxflash $(ROOTDIR)/sbin/
        endif
	touch $@

# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------

bootdisk_clean: 
	rm -rf $(STATEDIR)/bootdisk.* $(BOOTDISK_DIR)

# vim: syntax=make