Makefile 1.7 KB

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