1#
2# Makefile for the linux kernel.
3#
4# Note! Dependencies are done automagically by 'make dep', which also
5# removes any old dependencies. DON'T put your own dependencies here
6# unless it's something special (ie not a .c file).
7#
8# Note 2! The CFLAGS definitions are now in the main makefile...
9
10.S.o:
11	$(CC) $(AFLAGS) -traditional -c $< -o $*.o
12
13all: asm-offsets.h kernel.o head.o init_task.o
14
15O_TARGET := kernel.o
16
17export-objs	:= debug.o ebcdic.o irq.o s390_ext.o smp.o s390_ksyms.o
18obj-y	:= entry.o bitmap.o traps.o time.o process.o irq.o \
19            setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \
20            semaphore.o s390fpu.o reipl.o s390_ext.o debug.o
21
22obj-$(CONFIG_MODULES)		+= s390_ksyms.o
23obj-$(CONFIG_SMP)		+= smp.o
24
25#
26# Kernel debugging
27#
28obj-$(CONFIG_REMOTE_DEBUG)	+= gdb-stub.o #gdb-low.o 
29
30.PHONY: asm-offsets.h
31
32entry.S: asm-offsets.h
33
34#
35# Automatic offset generation for assembler files.
36#
37asm-offsets.h: asm-offsets.c
38	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -S $< -o - | grep -- "->" | \
39	(echo "#ifndef __ASM_OFFSETS_H__"; \
40	 echo "#define __ASM_OFFSETS_H__"; \
41	 echo "/*"; \
42	 echo " * DO NOT MODIFY"; \
43	 echo " *"; \
44	 echo " * This file was generated by arch/s390/kernel/Makefile"; \
45	 echo " */"; \
46	 sed -e "s:^->\([^ ]*\) \([^ ]*\) \(.*\):#define \\1 \\2 /* \\3*/:" \
47	     -e "s:->::"; \
48	 echo "#endif" \
49	) > asm-offsets.h
50
51clean:
52	rm -f asm-offsets.h
53
54include $(TOPDIR)/Rules.make
55
56