Subversion Repositories HelenOS

Rev

Rev 3536 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3536 Rev 4377
Line 24... Line 24...
24
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
#
27
#
28
 
28
 
-
 
29
TMP = distroot
-
 
30
 
29
INIT_TASKS = \
31
INIT_TASKS = \
30
	$(USPACEDIR)/srv/ns/ns \
32
	$(USPACEDIR)/srv/ns/ns \
31
	$(USPACEDIR)/srv/loader/loader \
33
	$(USPACEDIR)/srv/loader/loader \
32
	$(USPACEDIR)/app/init/init \
34
	$(USPACEDIR)/app/init/init \
33
	$(USPACEDIR)/srv/devmap/devmap \
35
	$(USPACEDIR)/srv/devmap/devmap \
34
	$(USPACEDIR)/srv/rd/rd \
36
	$(USPACEDIR)/srv/rd/rd \
35
	$(USPACEDIR)/srv/vfs/vfs 
37
	$(USPACEDIR)/srv/vfs/vfs
36
ifeq ($(RDFMT),tmpfs)
38
ifeq ($(RDFMT),tmpfs)
37
	INIT_TASKS += $(USPACEDIR)/srv/fs/tmpfs/tmpfs
39
	INIT_TASKS += $(USPACEDIR)/srv/fs/tmpfs/tmpfs
38
endif
40
endif
39
ifeq ($(RDFMT),fat)
41
ifeq ($(RDFMT),fat)
40
	INIT_TASKS += $(USPACEDIR)/srv/fs/fat/fat
42
	INIT_TASKS += $(USPACEDIR)/srv/fs/fat/fat
Line 43... Line 45...
43
RD_SRVS = \
45
RD_SRVS = \
44
	$(USPACEDIR)/srv/pci/pci \
46
	$(USPACEDIR)/srv/pci/pci \
45
	$(USPACEDIR)/srv/fb/fb \
47
	$(USPACEDIR)/srv/fb/fb \
46
	$(USPACEDIR)/srv/kbd/kbd \
48
	$(USPACEDIR)/srv/kbd/kbd \
47
	$(USPACEDIR)/srv/console/console \
49
	$(USPACEDIR)/srv/console/console \
-
 
50
	$(USPACEDIR)/srv/fs/tmpfs/tmpfs \
48
	$(USPACEDIR)/srv/fs/fat/fat
51
	$(USPACEDIR)/srv/fs/fat/fat
49
 
52
 
50
RD_APPS = \
53
RD_APPS = \
51
	$(USPACEDIR)/app/trace/trace \
54
	$(USPACEDIR)/app/trace/trace \
52
	$(USPACEDIR)/app/tetris/tetris \
55
	$(USPACEDIR)/app/tetris/tetris \
Line 55... Line 58...
55
	$(USPACEDIR)/app/klog/klog \
58
	$(USPACEDIR)/app/klog/klog \
56
	$(USPACEDIR)/app/bdsh/bdsh
59
	$(USPACEDIR)/app/bdsh/bdsh
57
 
60
 
58
build: $(BASE)/image.iso
61
build: $(BASE)/image.iso
59
 
62
 
60
$(BASE)/image.iso: arch/$(ARCH)/grub/stage2_eltorito arch/$(ARCH)/grub/menu.lst $(KERNELDIR)/kernel.bin $(INIT_TASKS) $(RD_SRVS) $(RD_APPS)
63
$(BASE)/image.iso: arch/$(BARCH)/grub/stage2_eltorito arch/$(BARCH)/grub/menu.lst $(KERNELDIR)/kernel.bin $(INIT_TASKS) $(RD_SRVS) $(RD_APPS)
61
	mkdir -p arch/$(ARCH)/iso/boot/grub
64
	mkdir -p $(TMP)/boot/grub
62
	cp arch/$(ARCH)/grub/stage2_eltorito arch/$(ARCH)/iso/boot/grub/
65
	cp arch/$(BARCH)/grub/stage2_eltorito $(TMP)/boot/grub/
63
ifneq ($(RDFMT),tmpfs)
66
ifneq ($(RDFMT),tmpfs)
64
	cat arch/$(ARCH)/grub/menu.lst | grep -v "tmpfs" >arch/$(ARCH)/iso/boot/grub/menu.lst
67
	cat arch/$(BARCH)/grub/menu.lst | grep -v "tmpfs" > $(TMP)/boot/grub/menu.lst
65
endif
68
endif
66
ifneq ($(RDFMT),fat)
69
ifneq ($(RDFMT),fat)
67
	cat arch/$(ARCH)/grub/menu.lst | grep -v "fat" >arch/$(ARCH)/iso/boot/grub/menu.lst
70
	cat arch/$(BARCH)/grub/menu.lst | grep -v "fat" > $(TMP)/boot/grub/menu.lst
68
endif
71
endif
69
	cp $(KERNELDIR)/kernel.bin arch/$(ARCH)/iso/boot/
72
	cp $(KERNELDIR)/kernel.bin $(TMP)/boot/
70
	for task in $(INIT_TASKS) ; do \
73
	for task in $(INIT_TASKS) ; do \
71
		cp $$task arch/$(ARCH)/iso/boot/ ; \
74
		cp $$task $(TMP)/boot/ ; \
72
	done
75
	done
73
	for file in $(RD_SRVS) ; do \
76
	for file in $(RD_SRVS) ; do \
74
		cp $$file $(USPACEDIR)/dist/srv/ ; \
77
		cp $$file $(USPACEDIR)/dist/srv/ ; \
75
	done
78
	done
76
	for file in $(RD_APPS) ; do \
79
	for file in $(RD_APPS) ; do \
77
		cp $$file $(USPACEDIR)/dist/app/ ; \
80
		cp $$file $(USPACEDIR)/dist/app/ ; \
78
	done
81
	done
79
ifeq ($(RDFMT),tmpfs)
82
ifeq ($(RDFMT),tmpfs)
80
	$(BASE)/tools/mktmpfs.py $(USPACEDIR)/dist/ arch/$(ARCH)/iso/boot/initrd.fs
83
	$(BASE)/tools/mktmpfs.py $(USPACEDIR)/dist/ $(TMP)/boot/initrd.fs
81
endif
84
endif
82
ifeq ($(RDFMT),fat)
85
ifeq ($(RDFMT),fat)
83
	$(BASE)/tools/mkfat.py $(USPACEDIR)/dist/ arch/$(ARCH)/iso/boot/initrd.fs
86
	$(BASE)/tools/mkfat.py $(USPACEDIR)/dist/ $(TMP)/boot/initrd.fs
84
endif
87
endif
85
	$(BASE)/tools/mkhord.py 4096 arch/$(ARCH)/iso/boot/initrd.fs arch/$(ARCH)/iso/boot/initrd.img
88
	$(BASE)/tools/mkhord.py 4096 $(TMP)/boot/initrd.fs $(TMP)/boot/initrd.img
86
	rm arch/$(ARCH)/iso/boot/initrd.fs
89
	rm $(TMP)/boot/initrd.fs
87
	mkisofs -J -r -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o $(BASE)/image.iso arch/$(ARCH)/iso/
90
	mkisofs -J -r -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o $@ $(TMP)/
88
 
91
 
89
clean:
92
clean:
90
	-for file in $(RD_SRVS) ; do \
93
	-for file in $(RD_SRVS) ; do \
91
		rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
94
		rm -f $(USPACEDIR)/dist/srv/`basename $$file` ; \
92
	done
95
	done
93
	-for file in $(RD_APPS) ; do \
96
	-for file in $(RD_APPS) ; do \
94
		rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
97
		rm -f $(USPACEDIR)/dist/app/`basename $$file` ; \
95
	done
98
	done
96
	-rm -fr arch/$(ARCH)/iso
99
	-rm -fr $(TMP)
97
	-rm -f $(BASE)/image.iso
100
	-rm -f $(BASE)/image.iso