1 # $Id: Makefile,v 1.54 2000/05/12 23:51:24 davem 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...
11 $(CPP
) $(AFLAGS
) -ansi
$< -o
$*.s
14 $(CC
) $(AFLAGS
) -ansi
-c
$< -o
$*.o
16 all: kernel.o head.o init_task.o
19 O_OBJS
:= process.o setup.o cpu.o idprom.o \
20 traps.o devices.o auxio.o \
21 irq.o ptrace.o time.o sys_sparc.o signal.o \
22 unaligned.o central.o pci.o starfire.o semaphore.o \
23 power.o sbus.o iommu_common.o
24 OX_OBJS
:= sparc64_ksyms.o
27 O_OBJS
+= ebus.o pci_common.o pci_iommu.o \
28 pci_psycho.o pci_sabre.o
31 ifdef CONFIG_SUNOS_EMUL
32 O_OBJS
+= sys_sunos32.o sunos_ioctl32.o
34 ifdef CONFIG_SOLARIS_EMUL
35 O_OBJS
+= sys_sunos32.o sunos_ioctl32.o
40 O_OBJS
+= smp.o trampoline.o
43 ifdef CONFIG_SPARC32_COMPAT
44 O_OBJS
+= sys32.o sys_sparc32.o signal32.o ioctl32.o
47 ifdef CONFIG_BINFMT_ELF32
48 O_OBJS
+= binfmt_elf32.o
51 ifdef CONFIG_BINFMT_AOUT32
52 O_OBJS
+= binfmt_aout32.o
55 head.o
: head.S ttable.S itlb_base.S dtlb_base.S dtlb_backend.S dtlb_prot.S \
56 etrap.S rtrap.S winfixup.S entry.S
57 $(CC
) $(AFLAGS
) -ansi
-c
$*.S
-o
$*.o
60 # This is just to get the dependencies...
62 binfmt_elf32.o
: $(TOPDIR
)/fs
/binfmt_elf.c
65 CMODEL_CFLAG
:= -mmedlow
67 CMODEL_CFLAG
:= -mcmodel
=medlow
71 @echo
"/* Automatically generated. Do not edit. */" > asm_offsets.h
72 @echo
"#ifndef __ASM_OFFSETS_H__" >> asm_offsets.h
73 @echo
-e
"#define __ASM_OFFSETS_H__\n" >> asm_offsets.h
74 @echo
-e
"#include <linux/config.h>\n" >> asm_offsets.h
75 @echo
'#if defined(__KERNEL__) && !defined(__ASSEMBLY__)' >> asm_offsets.h
76 @if
$(CC
) -c
-m64
-mcmodel
=medlow
-o
/dev
/null
/dev
/null
>/dev
/null
2>&1; then \
77 echo
'# if !((__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))' >> asm_offsets.h
; \
79 echo
'# if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)' >> asm_offsets.h
; \
81 @echo
-e
"# error Please issue 'make check_asm' in linux top-level directory first\n# endif\n#endif\n" >> asm_offsets.h
82 @echo
-e
"#ifndef CONFIG_SMP\n" >> asm_offsets.h
83 @echo
"#include <linux/config.h>" > tmp.c
84 @echo
"#undef __SMP__" >> tmp.c
85 @echo
"#undef CONFIG_SMP" >> tmp.c
86 @echo
"#include <linux/sched.h>" >> tmp.c
87 $(CPP
) $(CPPFLAGS
) tmp.c
-o tmp.i
88 @echo
"/* Automatically generated. Do not edit. */" > check_asm.c
89 @echo
"#include <linux/config.h>" >> check_asm.c
90 @echo
"#undef __SMP__" >> check_asm.c
91 @echo
"#undef CONFIG_SMP" >> check_asm.c
92 @echo
"#include <linux/sched.h>" >> check_asm.c
93 @echo
'struct task_struct _task;' >> check_asm.c
94 @echo
'struct mm_struct _mm;' >> check_asm.c
95 @echo
'struct thread_struct _thread;' >> check_asm.c
96 @echo
'int main(void) {' >> check_asm.c
97 $(SH
) .
/check_asm.sh task tmp.i check_asm.c
98 $(SH
) .
/check_asm.sh mm tmp.i check_asm.c
99 $(SH
) .
/check_asm.sh thread tmp.i check_asm.c
100 @echo
'return 0; }' >> check_asm.c
102 #$(CC) -o check_asm check_asm.c
103 # <hack> Until we can do this natively, a hack has to take place
104 $(CC
) $(CPPFLAGS
) $(CMODEL_CFLAG
) -ffixed-g4
-S
-o check_asm.s check_asm.c
105 $(HOSTCC
) -Wa
,-Av9a
-o check_asm check_asm.s
108 .
/check_asm
>> asm_offsets.h
109 @
rm -f check_asm check_asm.c
110 @echo
-e
"\n#else /* CONFIG_SMP */\n" >> asm_offsets.h
111 @echo
-e
"#ifndef SPIN_LOCK_DEBUG\n" >>asm_offsets.h
112 @echo
"#include <linux/config.h>" > tmp.c
113 @echo
"#undef CONFIG_SMP" >> tmp.c
114 @echo
"#define CONFIG_SMP 1" >> tmp.c
115 @echo
"#include <linux/sched.h>" >> tmp.c
116 $(CPP
) $(CPPFLAGS
) tmp.c
-o tmp.i
117 @echo
"/* Automatically generated. Do not edit. */" > check_asm.c
118 @echo
"#include <linux/config.h>" >> check_asm.c
119 @echo
"#undef CONFIG_SMP" >> check_asm.c
120 @echo
"#define CONFIG_SMP 1" >> check_asm.c
121 @echo
"#include <linux/sched.h>" >> check_asm.c
122 @echo
'struct task_struct _task;' >> check_asm.c
123 @echo
'struct mm_struct _mm;' >> check_asm.c
124 @echo
'struct thread_struct _thread;' >> check_asm.c
125 @echo
'int main(void) {' >> check_asm.c
126 $(SH
) .
/check_asm.sh task tmp.i check_asm.c
127 $(SH
) .
/check_asm.sh mm tmp.i check_asm.c
128 $(SH
) .
/check_asm.sh thread tmp.i check_asm.c
129 @echo
'return 0; }' >> check_asm.c
131 #$(CC) -D__SMP__ -o check_asm check_asm.c
132 # <hack> Until we can do this natively, a hack has to take place
133 $(CC
) $(CPPFLAGS
) $(CMODEL_CFLAG
) -ffixed-g4
-S
-o check_asm.s check_asm.c
134 $(HOSTCC
) -Wa
,-Av9a
-o check_asm check_asm.s
137 .
/check_asm
>> asm_offsets.h
138 @
rm -f check_asm check_asm.c
139 @echo
-e
"\n#else /* SPIN_LOCK_DEBUG */\n" >> asm_offsets.h
140 @echo
"#include <linux/sched.h>" > tmp.c
141 $(CPP
) $(CPPFLAGS
) -DSPIN_LOCK_DEBUG tmp.c
-o tmp.i
142 @echo
"/* Automatically generated. Do not edit. */" > check_asm.c
143 @echo
"#include <linux/config.h>" >> check_asm.c
144 @echo
"#undef CONFIG_SMP" >> check_asm.c
145 @echo
"#define CONFIG_SMP 1" >> check_asm.c
146 @echo
"#include <linux/sched.h>" >> check_asm.c
147 @echo
'struct task_struct _task;' >> check_asm.c
148 @echo
'struct mm_struct _mm;' >> check_asm.c
149 @echo
'struct thread_struct _thread;' >> check_asm.c
150 @echo
'int main(void) {' >> check_asm.c
151 $(SH
) .
/check_asm.sh task tmp.i check_asm.c
152 $(SH
) .
/check_asm.sh mm tmp.i check_asm.c
153 $(SH
) .
/check_asm.sh thread tmp.i check_asm.c
154 @echo
'return 0; }' >> check_asm.c
156 #$(CC) -D__SMP__ -DSPIN_LOCK_DEBUG -o check_asm check_asm.c
157 # <hack> Until we can do this natively, a hack has to take place
158 $(CC
) $(CPPFLAGS
) -DSPIN_LOCK_DEBUG
$(CMODEL_CFLAG
) -ffixed-g4
-S
-o check_asm.s check_asm.c
159 $(HOSTCC
) -Wa
,-Av9a
-o check_asm check_asm.s
162 .
/check_asm
>> asm_offsets.h
163 @
rm -f check_asm check_asm.c
164 @echo
-e
"#endif /* SPIN_LOCK_DEBUG */\n" >> asm_offsets.h
165 @echo
-e
"#endif /* CONFIG_SMP */\n" >> asm_offsets.h
166 @echo
"#endif /* __ASM_OFFSETS_H__ */" >> asm_offsets.h
167 @if
test -r
$(HPATH
)/asm
/asm_offsets.h
; then \
168 if cmp
-s asm_offsets.h
$(HPATH
)/asm
/asm_offsets.h
; then \
169 echo
$(HPATH
)/asm
/asm_offsets.h is unchanged
; \
170 rm -f asm_offsets.h
; \
172 mv
-f asm_offsets.h
$(HPATH
)/asm
/asm_offsets.h
; \
175 mv
-f asm_offsets.h
$(HPATH
)/asm
/asm_offsets.h
; \
179 include $(TOPDIR
)/Rules.make