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
10USE_STANDARD_AS_RULE	:= true
11
12ifdef CONFIG_PPC64BRIDGE
13EXTRA_AFLAGS		:= -Wa,-mppc64bridge
14endif
15ifdef CONFIG_4xx
16EXTRA_AFLAGS		:= -Wa,-m405
17endif
18
19# Code in these files is used before the kernel is moved to its final position
20CFLAGS_prom_init.o	+= -mrelocatable-lib
21CFLAGS_btext.o		+= -mrelocatable-lib
22
23# Start off with 'head.o', change as needed.
24HEAD-y				:= head.o
25HEAD-$(CONFIG_6xx)		+= idle_6xx.o
26HEAD-$(CONFIG_40x)		:= head_4xx.o
27HEAD-$(CONFIG_44x)		:= head_44x.o
28HEAD-$(CONFIG_8xx)		:= head_8xx.o
29
30all: $(HEAD-y) kernel.o
31
32O_TARGET := kernel.o
33
34export-objs			:= ppc_ksyms.o time.o ocp.o ppc4xx_setup.o \
35					ppc4xx_dma.o ppc4xx_sgdma.o \
36					ppc4xx_stbdma.o
37
38obj-y				:= entry.o traps.o irq.o idle.o time.o misc.o \
39					process.o signal.o ptrace.o align.o \
40					semaphore.o syscalls.o setup.o \
41					cputable.o ppc_htab.o
42ifneq ($(CONFIG_6xx),y)
43obj-y				+= idle_gen.o
44endif
45obj-$(CONFIG_6xx)		+= l2cr.o cpu_setup_6xx.o
46obj-$(CONFIG_MODULES)		+= ppc_ksyms.o
47obj-$(CONFIG_PCI)		+= pci.o
48obj-$(CONFIG_PCI)		+= pci-dma.o
49obj-$(CONFIG_KGDB)		+= ppc-stub.o
50obj-$(CONFIG_PPCBUG_NVRAM)	+= prep_nvram.o
51obj-$(CONFIG_SMP)		+= smp.o
52obj-$(CONFIG_TAU)		+= temp.o
53ifeq ($(CONFIG_SERIAL)$(CONFIG_GEN550),yy)
54obj-$(CONFIG_KGDB)		+= gen550_kgdb.o gen550_dbg.o
55obj-$(CONFIG_SERIAL_TEXT_DEBUG)	+= gen550_dbg.o
56endif
57obj-$(CONFIG_PPC_OCP)		+= ocp.o
58obj-$(CONFIG_40x)		+= ppc4xx_setup.o ppc4xx_pic.o
59obj-$(CONFIG_4xx)		+= todc_time.o
60obj-$(CONFIG_STBXXX_DMA)	+= ppc4xx_stbdma.o
61ifeq ($(CONFIG_PCI),y)
62obj-$(CONFIG_40x)		+= ppc405_pci.o
63obj-$(CONFIG_4xx)		+= indirect_pci.o pci_auto.o
64endif
65obj-$(CONFIG_44x)		+= ppc4xx_pic.o ibm44x_common.o
66obj-$(CONFIG_440GP)		+= ibm440gp_common.o
67obj-$(CONFIG_440GX)		+= ibm440gx_common.o
68obj-$(CONFIG_PPC4xx_DMA)	+= ppc4xx_dma.o
69obj-$(CONFIG_PPC4xx_EDMA)	+= ppc4xx_sgdma.o
70obj-$(CONFIG_8xx)		+= m8xx_setup.o ppc8xx_pic.o
71obj-$(CONFIG_8xx_WDT)		+= m8xx_wdt.o
72ifeq ($(CONFIG_8xx),y)
73obj-$(CONFIG_PCI)		+= qspan_pci.o
74ifndef CONFIG_MATH_EMULATION
75obj-y				+= softemu8xx.o
76endif
77endif
78obj-$(CONFIG_MBX)		+= i8259.o
79obj-$(CONFIG_ALL_PPC)		+= prom_init.o prom.o open_pic.o \
80					indirect_pci.o i8259.o
81obj-$(CONFIG_GEMINI)		+= open_pic.o
82obj-$(CONFIG_LOPEC)		+= mpc10x_common.o indirect_pci.o pci_auto.o \
83					open_pic.o i8259.o todc_time.o
84obj-$(CONFIG_PAL4)		+= indirect_pci.o pci_auto.o todc_time.o
85obj-$(CONFIG_PPLUS)		+= pplus_common.o open_pic.o i8259.o \
86				   indirect_pci.o todc_time.o pci_auto.o
87obj-$(CONFIG_PRPMC750)		+= open_pic.o indirect_pci.o pci_auto.o \
88					pplus_common.o
89obj-$(CONFIG_SANDPOINT)		+= i8259.o open_pic.o mpc10x_common.o \
90					pci_auto.o indirect_pci.o todc_time.o
91obj-$(CONFIG_SPRUCE)		+= indirect_pci.o pci_auto.o todc_time.o
92obj-$(CONFIG_8260)		+= m8260_setup.o cpm2_pic.o
93obj-$(CONFIG_BOOTX_TEXT)	+= btext.o
94
95include $(TOPDIR)/Rules.make
96
97entry.o: entry.S ppc_defs.h
98misc.o: misc.S ppc_defs.h
99l2cr.o: l2cr.S ppc_defs.h
100head.o: head.S ppc_defs.h
101head_4xx.o: head_4xx.S ppc_defs.h
102head_44x.o: head_44x.S ppc_defs.h
103head_8xx.o: head_8xx.S ppc_defs.h
104idle_6xx.o: idle_6xx.S ppc_defs.h
105
106ppc_defs.h: mk_defs.c ppc_defs.head \
107		$(TOPDIR)/include/asm/mmu.h \
108		$(TOPDIR)/include/asm/processor.h \
109		$(TOPDIR)/include/asm/pgtable.h \
110		$(TOPDIR)/include/asm/ptrace.h
111	$(CC) $(CFLAGS) -S mk_defs.c
112	cp ppc_defs.head ppc_defs.h
113# for bk, this way we can write to the file even if it's not checked out
114	chmod u+w ppc_defs.h
115	grep '^#define' mk_defs.s >> ppc_defs.h
116	rm mk_defs.s
117
118find_name : find_name.c
119	$(HOSTCC) $(HOSTCFLAGS) -o find_name find_name.c
120
121checks: checks.c
122	$(HOSTCC) -I$(HPATH) $(HOSTCFLAGS) -D__KERNEL__ -fno-builtin -o checks checks.c
123	./checks
124