root / Whitix / branches / hybrid / Makefile

Revision 547, 2.8 kB (checked in by mwhitworth, 2 months ago)

Update main makefile to reflect new modular kernel.

Line 
1#===============================#
2#=   CONFIGURATION OPTIONS     =#
3#===============================#
4
5MAKEFLAGS += --no-print-directory
6
7# Change this to build for a different arch
8ARCH = i386
9
10#Change to N to produce a smaller kernel if debug functionality is not required
11CONFIG_ALLSYMS = Y
12
13#Make sure all makefiles can see everything
14export ARCH
15
16# All directories that are to be built or cleaned.
17SUBDIRS = arch/$(ARCH) devices fs kernel lib memory net video user
18
19DIRMODULES = CdRoot/System/Modules CdRoot/System/Modules/Core CdRoot/System/Modules/Input CdRoot/System/Modules/Network CdRoot/System/Modules/Storage CdRoot/System/Modules/Filesystems CdRoot/System/Modules/Video
20DIRLIST = CdRoot CdRoot/Applications CdRoot/Mount CdRoot/System/Devices CdRoot/System/Include CdRoot/System/Runtime CdRoot/System/Runtime/C CdRoot/System/Startup/
21
22all: cd
23        mkdir -p $(DIRLIST)
24        make -C user install
25        mkisofs -o cd.iso -b Boot/isoboot -no-emul-boot -c Boot/boot.cat -boot-load-size 4 -boot-info-table -iso-level 3 -l CdRoot
26
27floppy: kern
28       
29ifneq ($(CONFIG_ALLSYMS),Y)
30        strip -s kern
31endif
32
33cd: kern
34        mkdir -p CdRoot/Boot
35        cp arch/$(ARCH)/boot/iso/isoboot CdRoot/Boot/isoboot
36        cp arch/$(ARCH)/boot/setup CdRoot/Boot/KeLoader
37        cp kern CdRoot/Boot/Kernel
38        cp Boot.modules CdRoot/Boot/Boot.modules
39        mv CdRoot/System/Modules/Filesystems/cdfs.sys CdRoot/System/Modules/Core/cdfs.sys
40        mv CdRoot/System/Modules/Storage/ata_ide.sys CdRoot/System/Modules/Core/ata_ide.sys
41        mv CdRoot/System/Modules/Video/console.sys CdRoot/System/Modules/Core/
42        cp about.txt CdRoot/readme.txt
43       
44        nm kern | sort -u > kernel.txt
45
46ifneq ($(CONFIG_ALLSYMS),Y)
47        strip -s kern -R .comment
48endif
49
50        mkisofs -o cd.iso -b Boot/isoboot -no-emul-boot -c Boot/boot.cat -boot-load-size 4 -boot-info-table -iso-level 3 -l CdRoot
51
52kern: subdirs
53        ld -M -T link.ld arch/$(ARCH)/boot/*.o arch/$(ARCH)/lib/*.o arch/$(ARCH)/kernel/*.o arch/$(ARCH)/mm/*.o kernel/*.o lib/*.o memory/*.o video/*.o -o kern > kernel.txt
54        mkdir -p $(DIRMODULES)
55        make -C net modules_install
56        make -C fs modules_install
57        make -C devices modules_install
58        make -C memory modules_install
59        make -C video modules_install
60        make -C kernel modules_install
61
62subdirs:
63        for dir in $(SUBDIRS); do \
64                $(MAKE) -C $$dir || exit 1; \
65        done;
66
67$(SUBDIRS):
68        $(MAKE) -C $@
69
70.PHONY: subdirs $(SUBDIRS)
71
72clean:
73        make -C arch/$(ARCH) clean
74        make -C devices clean
75        make -C fs clean
76        make -C kernel clean
77        make -C lib clean
78        make -C net clean
79        make -C video clean
80        make -C memory clean
81        make -C user clean
82        rm -f cd.iso kern out.txt kernel.txt
83        rm -rf CdRoot
84
85help:
86        @echo =====================
87        @echo = Whitix build help =
88        @echo =====================
89        @echo -
90        @echo "all - build the kernel and userspace"
91        @echo "floppy - build the kernel and construct a floppy image"
92        @echo "clean - remove all intermediate files"
93        @echo "See the readme file for more help"
94
95# Phony targets.
96.PHONY: clean help cd
Note: See TracBrowser for help on using the browser.