Makefile 6.53 KB
Newer Older
1
#
2 3 4
# ROOT_DEV specifies the default root-device when making the image.
# This can be either FLOPPY, /dev/xxxx or empty, in which case the
# default of FLOPPY is used by 'build'.
5 6
#

7
ROOT_DEV = /dev/hdb1
8

9 10 11 12 13
#
# uncomment this if you want kernel profiling: the profile_shift is the
# granularity of the profiling (5 = 32-byte granularity)
#

14
PROFILING =# -DPROFILE_SHIFT=2
15

16 17 18
#
# uncomment the correct keyboard:
#
19 20 21 22 23 24 25 26 27 28 29 30 31 32
# The value of KBDFLAGS should be or'ed together from the following
# bits, depending on which features you want enabled.
# 0x80 - Off: the Alt key will set bit 7 if pressed together with
#             another key.
#        On:  the Alt key will NOT set the high bit; an escape
#             character is prepended instead.
# The least significant bits control if the following keys are "dead".
# The key is dead by default if the bit is on.
# 0x01 - backquote (`)
# 0x02 - accent acute
# 0x04 - circumflex (^)
# 0x08 - tilde (~)
# 0x10 - dieresis (umlaut)

33
KEYBOARD = -DKBD_FINNISH -DKBDFLAGS=0
34
# KEYBOARD = -DKBD_FINNISH_LATIN1 -DKBDFLAGS=0x9F
35
# KEYBOARD = -DKBD_US -DKBDFLAGS=0
36 37 38 39 40 41 42 43 44 45
# KEYBOARD = -DKBD_GR -DKBDFLAGS=0
# KEYBOARD = -DKBD_GR_LATIN1 -DKBDFLAGS=0x9F
# KEYBOARD = -DKBD_FR -DKBDFLAGS=0
# KEYBOARD = -DKBD_FR_LATIN1 -DKBDFLAGS=0x9F
# KEYBOARD = -DKBD_UK -DKBDFLAGS=0
# KEYBOARD = -DKBD_DK -DKBDFLAGS=0
# KEYBOARD = -DKBD_DK_LATIN1 -DKBDFLAGS=0x9F
# KEYBOARD = -DKBD_DVORAK -DKBDFLAGS=0
# KEYBOARD = -DKBD_SG -DKBDFLAGS=0
# KEYBOARD = -DKBD_SG_LATIN1 -DKBDFLAGS=0x9F
46 47
# KEYBOARD = -DKBD_SF -DKBDFLAGS=0
# KEYBOARD = -DKBD_SF_LATIN1 -DKBDFLAGS=0x9F
48
# KEYBOARD = -DKBD_NO -DKBDFLAGS=0
49

50
#
51
# comment this line if you don't want the emulation-code
52 53
#

54
MATH_EMULATION = -DKERNEL_MATH_EMULATION
55

56
#
57 58 59
# Comment out this line if you don't want the 16MB kernel limit - but
# note that some of the SCSI drivers may have problems with anything
# else due to DMA limits.  The drivers should check, but they don't.
60 61 62 63 64 65
#
# EVEN IF YOU HAVE > 16MB, YOU SHOULD EDIT THIS ONLY IF YOU ARE 100%
# SURE YOU AREN'T USING ANY DEVICE THAT DOES UNCHECKED DMA!!  THE
# FLOPPY DRIVER IS OK, BUT OTHERS MIGHT HAVE PROBLEMS.
#

66 67 68 69 70 71 72 73 74 75
LIMIT_MEMORY = -DMAX_16M

#
# If you want to preset the SVGA mode, uncomment the next line and
# set SVGA_MODE to whatever number you want.
# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
# The number is the same as you would ordinarily press at bootup.
#

SVGA_MODE=	-DSVGA_MODE=1
76

77
#
78
# standard CFLAGS
79 80
#

81
CFLAGS = -Wall -O6 -fomit-frame-pointer $(LIMIT_MEMORY)
82

Linus Torvalds's avatar
Linus Torvalds committed
83 84 85 86
#
# if you want the ram-disk device, define this to be the
# size in blocks.
#
87

88
#RAMDISK = -DRAMDISK=512
89

Linus Torvalds's avatar
Linus Torvalds committed
90 91
AS86	=as86 -0 -a
LD86	=ld86 -0
92

93 94
AS	=as
LD	=ld
95
HOSTCC	=gcc -static
96
CC	=gcc -DKERNEL
97
MAKE	=make
98
CPP	=$(CC) -E $(LIMIT_MEMORY)
99 100 101
AR	=ar

ARCHIVES	=kernel/kernel.o mm/mm.o fs/fs.o net/net.o
102
FILESYSTEMS	=fs/filesystems.a
103 104
DRIVERS		=kernel/blk_drv/blk_drv.a kernel/chr_drv/chr_drv.a \
		 kernel/blk_drv/scsi/scsi.a
105
MATH		=kernel/FPU-emu/math.a
106
LIBS		=lib/lib.a
107 108 109
SUBDIRS		=kernel mm fs net lib

KERNELHDRS	=/usr/src/linux/include
110 111

.c.s:
112
	$(CC) $(CFLAGS) -S -o $*.s $<
113 114 115
.s.o:
	$(AS) -c -o $*.o $<
.c.o:
116
	$(CC) $(CFLAGS) -c -o $*.o $<
117

118 119
all:	Version Image

120 121
lilo: Image
	if [ -f /vmlinux ]; then mv /vmlinux /vmlinux.old; fi
122 123
	cat Image > /vmlinux
	/etc/lilo/install
124

125
linuxsubdirs: dummy
126
	@for i in $(SUBDIRS); do (cd $$i && echo $$i && $(MAKE)) || exit; done
127

128 129
Version:
	@./makever.sh
130
	@echo \#define UTS_RELEASE \"0.98.pl5-`cat .version`\" > tools/version.h
131 132 133 134
	@echo \#define UTS_VERSION \"`date +%D`\" >> tools/version.h
	@echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> tools/version.h
	@echo \#define LINUX_COMPILE_BY \"`whoami`\" >> tools/version.h
	@echo \#define LINUX_COMPILE_HOST \"`hostname`\" >> tools/version.h
135

136
Image: boot/bootsect boot/setup tools/system tools/build
137 138 139 140
	cp tools/system system.tmp
	strip system.tmp
	tools/build boot/bootsect boot/setup system.tmp $(ROOT_DEV) > Image
	rm system.tmp
141 142
	sync

Linus Torvalds's avatar
Linus Torvalds committed
143
disk: Image
144
	dd bs=8192 if=Image of=/dev/fd0
Linus Torvalds's avatar
Linus Torvalds committed
145

146
tools/build: tools/build.c
147
	$(HOSTCC) $(CFLAGS) \
148 149 150 151
	-o tools/build tools/build.c

boot/head.o: boot/head.s

152 153 154
boot/head.s: boot/head.S
	$(CPP) -traditional boot/head.S -o boot/head.s

155 156
tools/version.o: tools/version.c tools/version.h

157 158 159
init/main.o: init/main.c
	$(CC) $(CFLAGS) $(PROFILING) -c -o $*.o $<

160 161
tools/system:	boot/head.o init/main.o tools/version.o linuxsubdirs
	$(LD) $(LDFLAGS) -M boot/head.o init/main.o tools/version.o \
162 163 164 165 166 167
		$(ARCHIVES) \
		$(FILESYSTEMS) \
		$(DRIVERS) \
		$(MATH) \
		$(LIBS) \
		-o tools/system > System.map
168

Linus Torvalds's avatar
Linus Torvalds committed
169 170 171
boot/setup: boot/setup.s
	$(AS86) -o boot/setup.o boot/setup.s
	$(LD86) -s -o boot/setup boot/setup.o
172

173
boot/setup.s:	boot/setup.S include/linux/config.h Makefile
174
	$(CPP) -traditional $(SVGA_MODE) boot/setup.S -o boot/setup.s
Linus Torvalds's avatar
Linus Torvalds committed
175

176
boot/bootsect.s: boot/bootsect.S include/linux/config.h
Linus Torvalds's avatar
Linus Torvalds committed
177 178
	$(CPP) -traditional boot/bootsect.S -o boot/bootsect.s

Linus Torvalds's avatar
Linus Torvalds committed
179 180 181
boot/bootsect:	boot/bootsect.s
	$(AS86) -o boot/bootsect.o boot/bootsect.s
	$(LD86) -s -o boot/bootsect boot/bootsect.o
182

183 184 185
fs: dummy
	$(MAKE) linuxsubdirs SUBDIRS=fs

186 187 188 189 190 191
mm: dummy
	$(MAKE) linuxsubdirs SUBDIRS=mm

kernel: dummy
	$(MAKE) linuxsubdirs SUBDIRS=kernel

192
clean:
Linus Torvalds's avatar
Linus Torvalds committed
193
	rm -f Image System.map tmp_make core boot/bootsect boot/setup \
194
		boot/bootsect.s boot/setup.s boot/head.s init/main.s
195
	rm -f init/*.o tools/system tools/build boot/*.o tools/*.o
196
	for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean); done
197 198

backup: clean
199
	cd .. && tar cf - linux | compress - > backup.Z
200 201
	sync

202
depend dep:
203
	sed '/\#\#\# Dependencies/q' < Makefile > tmp_make
204
	for i in init/*.c;do echo -n "init/";$(CPP) -M $$i;done >> tmp_make
205
	cp tmp_make Makefile
206
	for i in $(SUBDIRS); do (cd $$i && $(MAKE) dep) || exit; done
207

208 209
dummy:

210
### Dependencies:
211 212 213 214 215 216 217 218 219 220
init/main.o : init/main.c /usr/lib/gcc-lib/i386-linux/2.2.2d/include/stdarg.h /usr/include/asm/system.h \
  /usr/include/asm/io.h /usr/include/linux/mktime.h /usr/include/linux/types.h \
  /usr/include/linux/fcntl.h /usr/include/linux/config.h /usr/include/linux/config.dist.h \
  /usr/include/linux/sched.h /usr/include/linux/head.h /usr/include/linux/fs.h \
  /usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
  /usr/include/linux/vfs.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
  /usr/include/linux/ext_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/minix_fs_sb.h \
  /usr/include/linux/ext_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/mm.h \
  /usr/include/linux/kernel.h /usr/include/linux/signal.h /usr/include/linux/time.h \
  /usr/include/linux/param.h /usr/include/linux/resource.h /usr/include/linux/vm86.h \
221 222
  /usr/include/linux/math_emu.h /usr/include/linux/tty.h /usr/include/linux/termios.h \
  /usr/include/linux/unistd.h /usr/include/linux/string.h