root / Whitix / branches / network / Makefile

Revision 243, 2.3 kB (checked in by mwhitworth, 7 months ago)

Add to makefile.

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 = N
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
19all: cd
20        mkdir -p CdRoot CdRoot/Applications CdRoot/Mount CdRoot/System/Devices CdRoot/System/Include CdRoot/System/Runtime CdRoot/System/Runtime/C
21        make -C user install
22        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
23
24floppy: kern
25       
26ifneq ($(CONFIG_ALLSYMS),Y)
27        strip -s kern
28endif
29
30cd: kern
31        mkdir -p CdRoot/Boot
32        cp arch/$(ARCH)/boot/iso/isoboot CdRoot/Boot/isoboot
33        cp arch/$(ARCH)/boot/setup CdRoot/loader.bin
34        cp kern CdRoot/kern.bin
35        cp about.txt CdRoot/readme.txt
36       
37        nm kern | sort -g > kernel.txt
38
39ifneq ($(CONFIG_ALLSYMS),Y)
40        strip -s kern
41endif
42
43        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
44
45kern: subdirs
46        ld -M -T link.ld arch/$(ARCH)/boot/*.o arch/$(ARCH)/lib/*.o arch/$(ARCH)/kernel/*.o arch/$(ARCH)/mm/*.o devices/*.o devices/net/*.o devices/input/*.o devices/storage/*.o devices/storage/ata/*.o devices/pci/*.o kernel/*.o net/*.o net/inet/*.o video/*.o fs/*.o fs/isofs/*.o fs/vfs/*.o fs/fat/*.o fs/ext3/*.o lib/*.o memory/*.o -o kern > kernel.txt
47
48subdirs:
49        for dir in $(SUBDIRS); do \
50                $(MAKE) -C $$dir || exit 1; \
51        done;
52
53$(SUBDIRS):
54        $(MAKE) -C $@
55
56.PHONY: subdirs $(SUBDIRS)
57
58clean:
59        make -C arch/$(ARCH) clean
60        make -C devices clean
61        make -C fs clean
62        make -C kernel clean
63        make -C lib clean
64        make -C net clean
65        make -C video clean
66        make -C memory clean
67        make -C user clean
68        rm -f cd.iso kern out.txt kernel.txt
69        rm -rf CdRoot
70
71help:
72        @echo =====================
73        @echo = Whitix build help =
74        @echo =====================
75        @echo -
76        @echo "all - build the kernel and userspace"
77        @echo "floppy - build the kernel and construct a floppy image"
78        @echo "clean - remove all intermediate files"
79        @echo "See the readme file for more help"
80
81# Phony targets.
82.PHONY: clean help cd
Note: See TracBrowser for help on using the browser.