Makefile 1.18 KB
Newer Older
1
#
2
# Makefile for the linux kernel.
3 4 5 6 7
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
8
# Note 2! The CFLAGS definitions are now in the main makefile...
9

10 11
.S.s:
	$(CPP) -traditional $< -o $*.s
12
.c.s:
13
	$(CC) $(CFLAGS) -S $<
14 15 16
.s.o:
	$(AS) -c -o $*.o $<
.c.o:
17 18
	$(CC) $(CFLAGS) -c $<

19
SUBDIRS	= chr_drv blk_drv FPU-emu
20

21
OBJS  = sched.o sys_call.o traps.o irq.o dma.o fork.o \
22
	panic.o printk.o vsprintf.o sys.o exit.o \
23 24
	signal.o mktime.o ptrace.o ioport.o itimer.o \
	info.o
25 26

all: kernel.o kernelsubdirs
27

28 29 30 31
kernel.o: $(OBJS)
	$(LD) -r -o kernel.o $(OBJS)
	sync

32
kernelsubdirs: dummy
33
	@for i in $(SUBDIRS); do (cd $$i && echo $$i && $(MAKE)) || exit; done
34

35 36 37 38
sys_call.s: sys_call.S

sys_call.o: sys_call.s

39
sched.o: sched.c
40
	$(CC) $(CFLAGS) $(PROFILING) -fno-omit-frame-pointer -c $<
41

42
clean:
43
	rm -f core *.o *.a *.s
44
	for i in $(SUBDIRS); do (cd $$i && $(MAKE) clean); done
45 46

dep:
47
	$(CPP) -M *.c > .depend
48
	for i in $(SUBDIRS); do (cd $$i && $(MAKE) dep) || exit; done
49 50

dummy:
51

52 53 54 55 56 57 58
#
# include a dependency file if one exists
#
ifeq (.depend,$(wildcard .depend))
include .depend
endif