Makefile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. OBJ = built-in.o
  2. .S.o:
  3. $(CC) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
  4. OBJS = ptrace.o sigcontext.o checksum.o miscthings.o misc.o \
  5. ptrace_user.o sysrq.o
  6. EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(srctree)/arch/ppc/kernel
  7. all: $(OBJ)
  8. $(OBJ): $(OBJS)
  9. rm -f $@
  10. $(LD) $(LINKFLAGS) --start-group $^ --end-group -o $@
  11. ptrace_user.o: ptrace_user.c
  12. $(CC) -D__KERNEL__ $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
  13. sigcontext.o: sigcontext.c
  14. $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
  15. checksum.S:
  16. rm -f $@
  17. ln -s $(srctree)/arch/ppc/lib/$@ $@
  18. mk_defs.c:
  19. rm -f $@
  20. ln -s $(srctree)/arch/ppc/kernel/$@ $@
  21. ppc_defs.head:
  22. rm -f $@
  23. ln -s $(srctree)/arch/ppc/kernel/$@ $@
  24. ppc_defs.h: mk_defs.c ppc_defs.head \
  25. $(srctree)/include/asm-ppc/mmu.h \
  26. $(srctree)/include/asm-ppc/processor.h \
  27. $(srctree)/include/asm-ppc/pgtable.h \
  28. $(srctree)/include/asm-ppc/ptrace.h
  29. # $(CC) $(CFLAGS) -S mk_defs.c
  30. cp ppc_defs.head ppc_defs.h
  31. # for bk, this way we can write to the file even if it's not checked out
  32. echo '#define THREAD 608' >> ppc_defs.h
  33. echo '#define PT_REGS 8' >> ppc_defs.h
  34. echo '#define CLONE_VM 256' >> ppc_defs.h
  35. # chmod u+w ppc_defs.h
  36. # grep '^#define' mk_defs.s >> ppc_defs.h
  37. # rm mk_defs.s
  38. # the asm link is horrible, and breaks the other targets. This is also
  39. # not going to work with parallel makes.
  40. checksum.o: checksum.S
  41. rm -f asm
  42. ln -s $(srctree)/include/asm-ppc asm
  43. $(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
  44. rm -f asm
  45. misc.o: misc.S ppc_defs.h
  46. rm -f asm
  47. ln -s $(srctree)/include/asm-ppc asm
  48. $(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
  49. rm -f asm
  50. clean-files := $(OBJS) ppc_defs.h checksum.S mk_defs.c