summaryrefslogtreecommitdiffstats
path: root/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile132
1 files changed, 132 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100644
index 0000000..581dbeb
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,132 @@
1# if you want the ram-disk device, define this to be the
2# size in blocks.
3#
4RAMDISK = #-DRAMDISK=512
5
6# This is a basic Makefile for setting the general configuration
7include Makefile.header
8
9LDFLAGS += -Ttext 0 -e startup_32
10CFLAGS += $(RAMDISK) -Iinclude
11CPP += -Iinclude
12
13#
14# ROOT_DEV specifies the default root-device when making the image.
15# This can be either FLOPPY, /dev/xxxx or empty, in which case the
16# default of /dev/hd6 is used by 'build'.
17#
18ROOT_DEV= #FLOPPY
19
20ARCHIVES=kernel/kernel.o mm/mm.o fs/fs.o
21DRIVERS =kernel/blk_drv/blk_drv.a kernel/chr_drv/chr_drv.a
22MATH =kernel/math/math.a
23LIBS =lib/lib.a
24
25.c.s:
26 @$(CC) $(CFLAGS) -S -o $*.s $<
27.s.o:
28 @$(AS) -o $*.o $<
29.c.o:
30 @$(CC) $(CFLAGS) -c -o $*.o $<
31
32all: Image
33
34Image: boot/bootsect boot/setup tools/system
35 @cp -f tools/system system.tmp
36 @$(STRIP) system.tmp
37 @$(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.property system.tmp tools/kernel
38 @tools/build.sh boot/bootsect boot/setup tools/kernel Image $(ROOT_DEV)
39 @rm system.tmp
40 @rm -f tools/kernel
41 @sync
42
43disk: Image
44 @dd bs=8192 if=Image of=/dev/fd0
45
46boot/head.o: boot/head.s
47 @make head.o -C boot/
48
49tools/system: boot/head.o init/main.o \
50 $(ARCHIVES) $(DRIVERS) $(MATH) $(LIBS)
51 @$(LD) $(LDFLAGS) boot/head.o init/main.o \
52 $(ARCHIVES) \
53 $(DRIVERS) \
54 $(MATH) \
55 $(LIBS) \
56 -o tools/system
57 @nm tools/system | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aU] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)'| sort > System.map
58
59kernel/math/math.a:
60 @make -C kernel/math
61
62kernel/blk_drv/blk_drv.a:
63 @make -C kernel/blk_drv
64
65kernel/chr_drv/chr_drv.a:
66 @make -C kernel/chr_drv
67
68kernel/kernel.o:
69 @make -C kernel
70
71mm/mm.o:
72 @make -C mm
73
74fs/fs.o:
75 @make -C fs
76
77lib/lib.a:
78 @make -C lib
79
80boot/setup: boot/setup.s
81 @make setup -C boot
82
83boot/bootsect: boot/bootsect.s
84 @make bootsect -C boot
85
86tmp.s: boot/bootsect.s tools/system
87 @(echo -n "SYSSIZE = (";ls -l tools/system | grep system \
88 | cut -c25-31 | tr '\012' ' '; echo "+ 15 ) / 16") > tmp.s
89 @cat boot/bootsect.s >> tmp.s
90
91clean:
92 @rm -f Image System.map tmp_make core boot/bootsect boot/setup
93 @rm -f init/*.o tools/system boot/*.o typescript* info bochsout.txt
94 @for i in mm fs kernel lib boot; do make clean -C $$i; done
95info:
96 @make clean
97 @script -q -c "make all"
98 @cat typescript | col -bp | grep -E "warning|Error" > info
99 @cat info
100
101distclean: clean
102 @rm -f tag cscope* linux-0.11.* $(CALLTREE)
103 @(find tools/calltree-2.3 -name "*.o" | xargs -i rm -f {})
104 @make clean -C tools/calltree-2.3
105 @make clean -C tools/bochs/bochs-2.3.7
106
107backup: clean
108 @(cd .. ; tar cf - linux | compress16 - > backup.Z)
109 @sync
110
111dep:
112 @sed '/\#\#\# Dependencies/q' < Makefile > tmp_make
113 @(for i in init/*.c;do echo -n "init/";$(CPP) -M $$i;done) >> tmp_make
114 @cp tmp_make Makefile
115 @for i in fs kernel mm; do make dep -C $$i; done
116
117tag: tags
118tags:
119 @ctags -R
120
121cscope:
122 @cscope -Rbkq
123
124
125
126### Dependencies:
127init/main.o: init/main.c include/unistd.h include/sys/stat.h \
128 include/sys/types.h include/sys/times.h include/sys/utsname.h \
129 include/utime.h include/time.h include/linux/tty.h include/termios.h \
130 include/linux/sched.h include/linux/head.h include/linux/fs.h \
131 include/linux/mm.h include/signal.h include/asm/system.h \
132 include/asm/io.h include/stddef.h include/stdarg.h include/fcntl.h