Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | OBJ = built-in.o |
| 2 | |
| 3 | .S.o: |
Sam Ravnborg | 222d394 | 2007-10-15 21:59:31 +0200 | [diff] [blame] | 4 | $(CC) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | |
| 6 | OBJS = ptrace.o sigcontext.o semaphore.o checksum.o miscthings.o misc.o \ |
| 7 | ptrace_user.o sysrq.o |
| 8 | |
WANG Cong | 47afa1d | 2008-02-04 22:31:23 -0800 | [diff] [blame] | 9 | EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(srctree)/arch/ppc/kernel |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | |
| 11 | all: $(OBJ) |
| 12 | |
| 13 | $(OBJ): $(OBJS) |
| 14 | rm -f $@ |
| 15 | $(LD) $(LINKFLAGS) --start-group $^ --end-group -o $@ |
| 16 | |
| 17 | ptrace_user.o: ptrace_user.c |
| 18 | $(CC) -D__KERNEL__ $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< |
| 19 | |
| 20 | sigcontext.o: sigcontext.c |
| 21 | $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< |
| 22 | |
| 23 | semaphore.c: |
| 24 | rm -f $@ |
WANG Cong | 47afa1d | 2008-02-04 22:31:23 -0800 | [diff] [blame] | 25 | ln -s $(srctree)/arch/ppc/kernel/$@ $@ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | |
| 27 | checksum.S: |
| 28 | rm -f $@ |
WANG Cong | 47afa1d | 2008-02-04 22:31:23 -0800 | [diff] [blame] | 29 | ln -s $(srctree)/arch/ppc/lib/$@ $@ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | |
| 31 | mk_defs.c: |
| 32 | rm -f $@ |
WANG Cong | 47afa1d | 2008-02-04 22:31:23 -0800 | [diff] [blame] | 33 | ln -s $(srctree)/arch/ppc/kernel/$@ $@ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | |
| 35 | ppc_defs.head: |
| 36 | rm -f $@ |
WANG Cong | 47afa1d | 2008-02-04 22:31:23 -0800 | [diff] [blame] | 37 | ln -s $(srctree)/arch/ppc/kernel/$@ $@ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | |
| 39 | ppc_defs.h: mk_defs.c ppc_defs.head \ |
WANG Cong | 47afa1d | 2008-02-04 22:31:23 -0800 | [diff] [blame] | 40 | $(srctree)/include/asm-ppc/mmu.h \ |
| 41 | $(srctree)/include/asm-ppc/processor.h \ |
| 42 | $(srctree)/include/asm-ppc/pgtable.h \ |
| 43 | $(srctree)/include/asm-ppc/ptrace.h |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | # $(CC) $(CFLAGS) -S mk_defs.c |
| 45 | cp ppc_defs.head ppc_defs.h |
| 46 | # for bk, this way we can write to the file even if it's not checked out |
| 47 | echo '#define THREAD 608' >> ppc_defs.h |
| 48 | echo '#define PT_REGS 8' >> ppc_defs.h |
| 49 | echo '#define CLONE_VM 256' >> ppc_defs.h |
| 50 | # chmod u+w ppc_defs.h |
| 51 | # grep '^#define' mk_defs.s >> ppc_defs.h |
| 52 | # rm mk_defs.s |
| 53 | |
| 54 | # the asm link is horrible, and breaks the other targets. This is also |
| 55 | # not going to work with parallel makes. |
| 56 | |
| 57 | checksum.o: checksum.S |
| 58 | rm -f asm |
WANG Cong | 47afa1d | 2008-02-04 22:31:23 -0800 | [diff] [blame] | 59 | ln -s $(srctree)/include/asm-ppc asm |
Sam Ravnborg | 222d394 | 2007-10-15 21:59:31 +0200 | [diff] [blame] | 60 | $(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | rm -f asm |
| 62 | |
| 63 | misc.o: misc.S ppc_defs.h |
| 64 | rm -f asm |
WANG Cong | 47afa1d | 2008-02-04 22:31:23 -0800 | [diff] [blame] | 65 | ln -s $(srctree)/include/asm-ppc asm |
Sam Ravnborg | 222d394 | 2007-10-15 21:59:31 +0200 | [diff] [blame] | 66 | $(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | rm -f asm |
| 68 | |
| 69 | clean-files := $(OBJS) ppc_defs.h checksum.S semaphore.c mk_defs.c |