blob: 20d363bd70041d1022dd57a8f40a5405655efa90 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001OBJ = built-in.o
2
3.S.o:
Sam Ravnborg222d3942007-10-15 21:59:31 +02004 $(CC) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
Linus Torvalds1da177e2005-04-16 15:20:36 -07005
Matthew Wilcox64ac24e2008-03-07 21:55:58 -05006OBJS = ptrace.o sigcontext.o checksum.o miscthings.o misc.o \
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 ptrace_user.o sysrq.o
8
matt mooney9b8c24f2011-01-14 06:12:33 -08009asflags-y := -DCONFIG_PPC32 -I. -I$(srctree)/arch/ppc/kernel
Linus Torvalds1da177e2005-04-16 15:20:36 -070010
11all: $(OBJ)
12
13$(OBJ): $(OBJS)
14 rm -f $@
15 $(LD) $(LINKFLAGS) --start-group $^ --end-group -o $@
16
17ptrace_user.o: ptrace_user.c
matt mooney9b8c24f2011-01-14 06:12:33 -080018 $(CC) -D__KERNEL__ $(USER_CFLAGS) $(ccflags-y) -c -o $@ $<
Linus Torvalds1da177e2005-04-16 15:20:36 -070019
20sigcontext.o: sigcontext.c
matt mooney9b8c24f2011-01-14 06:12:33 -080021 $(CC) $(USER_CFLAGS) $(ccflags-y) -c -o $@ $<
Linus Torvalds1da177e2005-04-16 15:20:36 -070022
Linus Torvalds1da177e2005-04-16 15:20:36 -070023checksum.S:
24 rm -f $@
WANG Cong47afa1d2008-02-04 22:31:23 -080025 ln -s $(srctree)/arch/ppc/lib/$@ $@
Linus Torvalds1da177e2005-04-16 15:20:36 -070026
27mk_defs.c:
28 rm -f $@
WANG Cong47afa1d2008-02-04 22:31:23 -080029 ln -s $(srctree)/arch/ppc/kernel/$@ $@
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
31ppc_defs.head:
32 rm -f $@
WANG Cong47afa1d2008-02-04 22:31:23 -080033 ln -s $(srctree)/arch/ppc/kernel/$@ $@
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
35ppc_defs.h: mk_defs.c ppc_defs.head \
WANG Cong47afa1d2008-02-04 22:31:23 -080036 $(srctree)/include/asm-ppc/mmu.h \
37 $(srctree)/include/asm-ppc/processor.h \
38 $(srctree)/include/asm-ppc/pgtable.h \
39 $(srctree)/include/asm-ppc/ptrace.h
Linus Torvalds1da177e2005-04-16 15:20:36 -070040# $(CC) $(CFLAGS) -S mk_defs.c
41 cp ppc_defs.head ppc_defs.h
42# for bk, this way we can write to the file even if it's not checked out
43 echo '#define THREAD 608' >> ppc_defs.h
44 echo '#define PT_REGS 8' >> ppc_defs.h
45 echo '#define CLONE_VM 256' >> ppc_defs.h
46# chmod u+w ppc_defs.h
47# grep '^#define' mk_defs.s >> ppc_defs.h
48# rm mk_defs.s
49
50# the asm link is horrible, and breaks the other targets. This is also
51# not going to work with parallel makes.
52
53checksum.o: checksum.S
54 rm -f asm
WANG Cong47afa1d2008-02-04 22:31:23 -080055 ln -s $(srctree)/include/asm-ppc asm
matt mooney9b8c24f2011-01-14 06:12:33 -080056 $(CC) $(asflags-y) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070057 rm -f asm
58
59misc.o: misc.S ppc_defs.h
60 rm -f asm
WANG Cong47afa1d2008-02-04 22:31:23 -080061 ln -s $(srctree)/include/asm-ppc asm
matt mooney9b8c24f2011-01-14 06:12:33 -080062 $(CC) $(asflags-y) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070063 rm -f asm
64
Matthew Wilcox64ac24e2008-03-07 21:55:58 -050065clean-files := $(OBJS) ppc_defs.h checksum.S mk_defs.c