* add p cc
[mascara-docs.git] / i386 / linux / linux-2.3.21 / arch / sparc64 / kernel / Makefile
blob34f52698e7ad7aea7daf9bc05242abe5a0d75423
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...
10 .S.s:
11 $(CPP) -D__ASSEMBLY__ $(AFLAGS) -ansi $< -o $*.s
13 .S.o:
14 $(CC) -D__ASSEMBLY__ $(AFLAGS) -ansi -c $< -o $*.o
16 all: kernel.o head.o init_task.o
18 O_TARGET := kernel.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 \
25 power.o
26 OX_OBJS := sparc64_ksyms.o
28 ifdef CONFIG_PCI
29 O_OBJS += ebus.o
30 endif
32 ifdef CONFIG_SMP
33 O_OBJS += smp.o trampoline.o
34 endif
36 ifdef CONFIG_SPARC32_COMPAT
37 O_OBJS += sys32.o sys_sparc32.o signal32.o ioctl32.o
38 endif
40 ifdef CONFIG_BINFMT_ELF32
41 O_OBJS += binfmt_elf32.o
42 endif
44 ifdef CONFIG_BINFMT_AOUT32
45 O_OBJS += binfmt_aout32.o
46 endif
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
57 ifneq ($(IS_EGCS),y)
58 CMODEL_CFLAG := -mmedlow
59 else
60 CMODEL_CFLAG := -mcmodel=medlow
61 endif
63 check_asm: dummy
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; \
71 else \
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
92 @rm -f tmp.[ci]
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
97 @rm -f check_asm.s
98 # </hack>
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
121 @rm -f tmp.[ci]
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
126 @rm -f check_asm.s
127 # </hack>
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
146 @rm -f tmp.[ci]
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
151 @rm -f check_asm.s
152 # </hack>
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; \
162 else \
163 mv -f asm_offsets.h $(HPATH)/asm/asm_offsets.h; \
164 fi; \
165 else \
166 mv -f asm_offsets.h $(HPATH)/asm/asm_offsets.h; \
170 include $(TOPDIR)/Rules.make