Import 2.1.42pre1
[davej-history.git] / arch / sparc64 / kernel / Makefile
blob199360a5f26a2ffd98479c50c231d1cc23622cae
1 # $Id: Makefile,v 1.22 1997/05/27 19:30:17 jj Exp $
2 # Makefile for the linux kernel.
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).
8 # Note 2! The CFLAGS definitions are now in the main makefile...
10 .S.s:
11 $(CPP) -D__ASSEMBLY__ -ansi $< -o $*.s
13 .S.o:
14 $(CC) -D__ASSEMBLY__ -ansi -c $< -o $*.o
16 all: kernel.o head.o init_task.o
18 O_TARGET := kernel.o
19 O_OBJS := etrap.o rtrap.o hack.o process.o setup.o cpu.o idprom.o \
20 systbls.o traps.o entry.o devices.o auxio.o ioport.o \
21 irq.o ptrace.o time.o sys_sparc.o signal.o winfixup.o
22 OX_OBJS := sparc64_ksyms.o
24 ifdef CONFIG_SPARC32_COMPAT
25 O_OBJS += sys_sparc32.o signal32.o ioctl32.o
26 endif
28 ifdef CONFIG_BINFMT_ELF32
29 O_OBJS += binfmt_elf32.o
30 endif
32 head.o: head.S ttable.S itlb_miss.S dtlb_miss.S dtlb_prot.S
33 $(CC) -D__ASSEMBLY__ -ansi -c $*.S -o $*.o
36 # This is just to get the dependencies...
38 binfmt_elf32.o: $(TOPDIR)/fs/binfmt_elf.c
40 check_asm: dummy
41 @echo "#include <linux/sched.h>" > tmp.c
42 $(CC) -E tmp.c -o tmp.i
43 @echo "/* Automatically generated. Do not edit. */" > check_asm.c; echo "#include <linux/sched.h>" >> check_asm.c; echo 'struct task_struct _task; struct mm_struct _mm; struct thread_struct _thread; int main(void) { printf ("/* Automatically generated. Do not edit. */\n#ifndef __ASM_OFFSETS_H__\n#define __ASM_OFFSETS_H__\n\n");' >> check_asm.c
44 $(SH) ./check_asm.sh task tmp.i check_asm.c
45 $(SH) ./check_asm.sh mm tmp.i check_asm.c
46 $(SH) ./check_asm.sh thread tmp.i check_asm.c
47 @echo 'printf ("\n#endif /* __ASM_OFFSETS_H__ */\n"); return 0; }' >> check_asm.c
48 @rm -f tmp.[ci]
49 #$(CC) -o check_asm check_asm.c
50 # <hack> Until we can do this natively, a hack has to take place
51 $(CC) -mmedlow -S -o check_asm.s check_asm.c
52 $(HOSTCC) -o check_asm check_asm.s
53 @rm -f check_asm.s
54 # </hack>
55 ./check_asm > asm_offsets.h
56 @if test -r $(HPATH)/asm/asm_offsets.h; then if cmp -s asm_offsets.h $(HPATH)/asm/asm_offsets.h; then echo $(HPATH)/asm/asm_offsets.h is unchanged; rm -f asm_offsets.h; else mv -f asm_offsets.h $(HPATH)/asm/asm_offsets.h; fi; else mv -f asm_offsets.h $(HPATH)/asm/asm_offsets.h; fi
57 @rm -f check_asm check_asm.c
60 include $(TOPDIR)/Rules.make