home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / src / linux-headers-2.6.17-6 / drivers / macintosh / mol / Makefile
Encoding:
Makefile  |  2006-08-11  |  1.9 KB  |  54 lines

  1. # -*- makefile -*-
  2.  
  3. PERFOBJS_    := _fault.o _dev.o _misc.o _mmu.o init.o emu.o mmu.o \
  4.            mmu_fb.o mmu_io.o mmu_tracker.o skiplist.o mtable.o \
  5.            fault.o context.o ptaccess.o misc.o _traps.o hook.o \
  6.            _actions.o
  7.  
  8. mol-objs        := $(PERFOBJS_) _performance.o
  9. obj-$(CONFIG_MOL)    := mol.o
  10.  
  11. targets := reloc_table.h asm_offsets.h _performance.c
  12.  
  13. PERFOBJS    = $(addprefix $(obj)/, $(PERFOBJS_))
  14. MOL_ASMFLAGS    = $(CPPFLAGS) $(ASMFLAGS) $(INCLUDES) -D__ASSEMBLY__
  15.  
  16.  
  17. $(obj)/hook.o:         $(src)/reloc_table.h
  18. $(obj)/_traps.o:    $(src)/asm_offsets.h $(src)/traps.S $(src)/*.S
  19.  
  20. $(src)/reloc_table.h: $(obj)/_traps.o
  21.     @$(RM) $@ $@.tmp ; echo "/* WARNING! DO NOT EDIT! AUTOMATICALLY GENERATED! */" > $@.tmp
  22.     @$(src)/relbuild.pl $< $(src)/traps.S >> $@.tmp
  23.     @$(STRIP) -S -x $<
  24.     @mv $@.tmp $@
  25.  
  26. $(obj)/_%.o: $(src)/%.S
  27.     @echo "  AS [x]   $@"
  28.     @$(RM) $@ $@.s
  29.     @$(CPP) $(MOL_ASMFLAGS) $< | m4 > $@.m4
  30.     @ASFILTER="| $(src)/asfilter" test -x $(src)/asfilter || ASFILTER="" ; cat $@.m4 $$ASFILTER > $@.s
  31.     @$(AS) $@.s $(AS_FLAGS) -o $@
  32.     @$(RM) $@.s $@.m4
  33.  
  34.  
  35. $(src)/asm_offsets.h:    $(src)/archinclude.h $(src)/kernel_vars.h $(src)/mac_registers.h
  36. $(src)/asm_offsets.h:    $(src)/asm_offsets.c $(src)/asm_offsets.inc
  37.     @$(RM) $(src)/tmp-offsets.c $@ ; cat $^ > $(src)/tmp-offsets.c
  38.     @$(CC) $(CPPFLAGS) $(CFLAGS) -I$(src) -Wall -S $(src)/tmp-offsets.c -o $(src)/tmp-offsets.s
  39.     @echo "/* WARNING! Automatically generated from 'shared/asm_offsets.c' - DO NOT EDIT! */" > $@
  40.     @grep '^#' $(src)/tmp-offsets.s >> $@
  41.     @$(RM) $(src)/tmp-offsets.*
  42.  
  43.  
  44. $(src)/_performance.c: $(PERFOBJS)
  45.     @$(RM) $@ $@.tmp; echo "/* WARNING! DO NOT EDIT! AUTOMATICALLY GENERATED! */" > $@.tmp
  46.     @echo "#include \"performance.h\"" >> $@.tmp
  47.     @$(NM) $(PERFOBJS) | awk -- '/gPerf__/ { print "unsigned long "$$2";" }' >> $@.tmp
  48.     @echo "perf_info_t g_perf_info_table[] = {" >> $@.tmp
  49.     @$(NM) $(PERFOBJS) | awk -- '/gPerf__/ { print "  { \""$$2"\",&"$$2"}," }' >> $@.tmp
  50.     @echo "  {0,0} };" >> $@.tmp
  51.     @cat $@.tmp | sed s/_gPerf/gPerf/g > $@
  52.     @$(RM) $@.tmp
  53.  
  54.