1 # $Id: Makefile,v 1.46 1999/08/31 04:39:34 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
) -D__ASSEMBLY__
$(AFLAGS
) -ansi
$< -o
$*.s
14 $(CC
) -D__ASSEMBLY__
$(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 ioport.o \
21 irq.o ptrace.o time.o sys_sparc.o signal.o \
22 unaligned.o sys_sunos32.o sunos_ioctl32.o \
23 central.o pci.o pci_common.o pci_iommu.o \
24 pci_psycho.o pci_sabre.o starfire.o semaphore.o \
26 OX_OBJS
:= sparc64_ksyms.o
33 O_OBJS
+= smp.o trampoline.o
36 ifdef CONFIG_SPARC32_COMPAT
37 O_OBJS
+= sys32.o sys_sparc32.o signal32.o ioctl32.o
40 ifdef CONFIG_BINFMT_ELF32
41 O_OBJS
+= binfmt_elf32.o
44 ifdef CONFIG_BINFMT_AOUT32
45 O_OBJS
+= binfmt_aout32.o
48 head.o
: head.S ttable.S itlb_base.S dtlb_base.S dtlb_backend.S dtlb_prot.S \
49 etrap.S rtrap.S winfixup.S entry.S
50 $(CC
) -D__ASSEMBLY__
$(AFLAGS
) -ansi
-c
$*.S
-o
$*.o
53 # This is just to get the dependencies...
55 binfmt_elf32.o
: $(TOPDIR
)/fs
/binfmt_elf.c
58 CMODEL_CFLAG
:= -mmedlow
60 CMODEL_CFLAG
:= -mcmodel
=medlow
64 @echo
"/* Automatically generated. Do not edit. */" > asm_offsets.h
65 @echo
"#ifndef __ASM_OFFSETS_H__" >> asm_offsets.h
66 @echo
-e
"#define __ASM_OFFSETS_H__\n" >> asm_offsets.h
67 @echo
-e
"#include <linux/config.h>\n" >> asm_offsets.h
68 @echo
'#if defined(__KERNEL__) && !defined(__ASSEMBLY__)' >> asm_offsets.h
69 @if
$(CC
) -c
-m64
-mcmodel
=medlow
-o
/dev
/null
/dev
/null
>/dev
/null
2>&1; then \
70 echo
'# if !((__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))' >> asm_offsets.h
; \
72 echo
'# if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)' >> asm_offsets.h
; \
74 @echo
-e
"# error Please issue 'make check_asm' in linux top-level directory first\n# endif\n#endif\n" >> asm_offsets.h
75 @echo
-e
"#ifndef CONFIG_SMP\n" >> asm_offsets.h
76 @echo
"#include <linux/config.h>" > tmp.c
77 @echo
"#undef CONFIG_SMP" >> tmp.c
78 @echo
"#include <linux/sched.h>" >> tmp.c
79 $(CC
) -E tmp.c
-o tmp.i
80 @echo
"/* Automatically generated. Do not edit. */" > check_asm.c
81 @echo
"#include <linux/config.h>" >> check_asm.c
82 @echo
"#undef CONFIG_SMP" >> check_asm.c
83 @echo
"#include <linux/sched.h>" >> check_asm.c
84 @echo
'struct task_struct _task;' >> check_asm.c
85 @echo
'struct mm_struct _mm;' >> check_asm.c
86 @echo
'struct thread_struct _thread;' >> check_asm.c
87 @echo
'int main(void) {' >> check_asm.c
88 $(SH
) .
/check_asm.sh task tmp.i check_asm.c
89 $(SH
) .
/check_asm.sh mm tmp.i check_asm.c
90 $(SH
) .
/check_asm.sh thread tmp.i check_asm.c
91 @echo
'return 0; }' >> check_asm.c
93 #$(CC) -o check_asm check_asm.c
94 # <hack> Until we can do this natively, a hack has to take place
95 $(CC
) $(CMODEL_CFLAG
) -ffixed-g4
-S
-o check_asm.s check_asm.c
96 $(HOSTCC
) -Wa
,-Av9a
-o check_asm check_asm.s
99 .
/check_asm
>> asm_offsets.h
100 @
rm -f check_asm check_asm.c
101 @echo
-e
"\n#else /* CONFIG_SMP */\n" >> asm_offsets.h
102 @echo
-e
"#ifndef SPIN_LOCK_DEBUG\n" >>asm_offsets.h
103 @echo
"#include <linux/config.h>" > tmp.c
104 @echo
"#undef CONFIG_SMP" >> tmp.c
105 @echo
"#define CONFIG_SMP 1" >> tmp.c
106 @echo
"#include <linux/sched.h>" >> tmp.c
107 $(CC
) -D__SMP__
-E tmp.c
-o tmp.i
108 @echo
"/* Automatically generated. Do not edit. */" > check_asm.c
109 @echo
"#include <linux/config.h>" >> check_asm.c
110 @echo
"#undef CONFIG_SMP" >> check_asm.c
111 @echo
"#define CONFIG_SMP 1" >> check_asm.c
112 @echo
"#include <linux/sched.h>" >> check_asm.c
113 @echo
'struct task_struct _task;' >> check_asm.c
114 @echo
'struct mm_struct _mm;' >> check_asm.c
115 @echo
'struct thread_struct _thread;' >> check_asm.c
116 @echo
'int main(void) {' >> check_asm.c
117 $(SH
) .
/check_asm.sh task tmp.i check_asm.c
118 $(SH
) .
/check_asm.sh mm tmp.i check_asm.c
119 $(SH
) .
/check_asm.sh thread tmp.i check_asm.c
120 @echo
'return 0; }' >> check_asm.c
122 #$(CC) -D__SMP__ -o check_asm check_asm.c
123 # <hack> Until we can do this natively, a hack has to take place
124 $(CC
) -D__SMP__
$(CMODEL_CFLAG
) -ffixed-g4
-S
-o check_asm.s check_asm.c
125 $(HOSTCC
) -Wa
,-Av9a
-o check_asm check_asm.s
128 .
/check_asm
>> asm_offsets.h
129 @
rm -f check_asm check_asm.c
130 @echo
-e
"\n#else /* SPIN_LOCK_DEBUG */\n" >> asm_offsets.h
131 @echo
"#include <linux/sched.h>" > tmp.c
132 $(CC
) -D__SMP__
-DSPIN_LOCK_DEBUG
-E tmp.c
-o tmp.i
133 @echo
"/* Automatically generated. Do not edit. */" > check_asm.c
134 @echo
"#include <linux/config.h>" >> check_asm.c
135 @echo
"#undef CONFIG_SMP" >> check_asm.c
136 @echo
"#define CONFIG_SMP 1" >> check_asm.c
137 @echo
"#include <linux/sched.h>" >> check_asm.c
138 @echo
'struct task_struct _task;' >> check_asm.c
139 @echo
'struct mm_struct _mm;' >> check_asm.c
140 @echo
'struct thread_struct _thread;' >> check_asm.c
141 @echo
'int main(void) {' >> check_asm.c
142 $(SH
) .
/check_asm.sh task tmp.i check_asm.c
143 $(SH
) .
/check_asm.sh mm tmp.i check_asm.c
144 $(SH
) .
/check_asm.sh thread tmp.i check_asm.c
145 @echo
'return 0; }' >> check_asm.c
147 #$(CC) -D__SMP__ -DSPIN_LOCK_DEBUG -o check_asm check_asm.c
148 # <hack> Until we can do this natively, a hack has to take place
149 $(CC
) -D__SMP__
-DSPIN_LOCK_DEBUG
$(CMODEL_CFLAG
) -ffixed-g4
-S
-o check_asm.s check_asm.c
150 $(HOSTCC
) -Wa
,-Av9a
-o check_asm check_asm.s
153 .
/check_asm
>> asm_offsets.h
154 @
rm -f check_asm check_asm.c
155 @echo
-e
"#endif /* SPIN_LOCK_DEBUG */\n" >> asm_offsets.h
156 @echo
-e
"#endif /* CONFIG_SMP */\n" >> asm_offsets.h
157 @echo
"#endif /* __ASM_OFFSETS_H__ */" >> asm_offsets.h
158 @if
test -r
$(HPATH
)/asm
/asm_offsets.h
; then \
159 if cmp
-s asm_offsets.h
$(HPATH
)/asm
/asm_offsets.h
; then \
160 echo
$(HPATH
)/asm
/asm_offsets.h is unchanged
; \
161 rm -f asm_offsets.h
; \
163 mv
-f asm_offsets.h
$(HPATH
)/asm
/asm_offsets.h
; \
166 mv
-f asm_offsets.h
$(HPATH
)/asm
/asm_offsets.h
; \
170 include $(TOPDIR
)/Rules.make