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 / net / ndiswrapper / Makefile
Encoding:
Makefile  |  2006-08-11  |  2.8 KB  |  87 lines

  1. OBJS := hal.o iw_ndis.o loader.o misc_funcs.o ndis.o ntoskernel.o \
  2.     ntoskernel_io.o pe_linker.o proc.o usb.o wrapper.o pnp.o \
  3.     wrapndis.o wrapmem.o
  4.  
  5. CFLAGS += -DDRIVER_VERSION=\"1.22\" -freg-struct-return
  6.  
  7. ifeq ($(CONFIG_X86_64),y)
  8. OBJS += win2lin_stubs.o
  9. else
  10. OBJS += divdi3.o
  11. endif
  12.  
  13. obj-$(CONFIG_NDISWRAPPER) := ndiswrapper.o
  14. ndiswrapper-objs := $(OBJS)
  15.  
  16.  
  17. targets :=    win2lin_stubs.h        \
  18.         hal_exports.h         \
  19.         misc_funcs_exports.h     \
  20.         ndis_exports.h         \
  21.         ntoskernel_exports.h     \
  22.         usb_exports.h         \
  23.         wrapper_exports.h    \
  24.         ntoskernel_io_exports.h
  25.  
  26.  
  27. $(obj)/win2lin_stubs.o: $(obj)/win2lin_stubs.h $(src)/win2lin_stubs.S
  28. $(obj)/win2lin_stubs.h: $(src)/hal.c $(src)/misc_funcs.c $(src)/ndis.c \
  29.         $(src)/ntoskernel.c $(src)/ntoskernel_io.c $(src)/pnp.c \
  30.         $(src)/wrapndis.c $(src)/usb.c
  31.     @for file in $^; do \
  32.         echo; \
  33.         echo "# automatically generated from $$file"; \
  34.         sed -n \
  35.             -e 's/.*WIN_FUNC(\([^\,]\+\) *\, *\([0-9]\+\)).*/\
  36.                win2lin(\1, \2)/p'   \
  37.             -e 's/.*WIN_FUNC_PTR(\([^\,]\+\) *\, *\([0-9]\+\)).*/\
  38.                win2lin(\1, \2)/p'   \
  39.             $$file | sed -e 's/[ \t      ]\+//' | sort -u; \
  40.     done > $@
  41.  
  42.  
  43. $(obj)/hal.o: $(obj)/hal_exports.h
  44. $(obj)/hal_exports.h: $(src)/hal.c
  45.  
  46. $(obj)/misc_funcs.o: $(obj)/misc_funcs_exports.h
  47. $(obj)/misc_funcs_exports.h: $(src)/misc_funcs.c
  48.  
  49. $(obj)/ndis.o: $(obj)/ndis_exports.h
  50. $(obj)/ndis_exports.h: $(src)/ndis.c
  51.  
  52. $(obj)/ntoskernel.o: $(obj)/ntoskernel_exports.h
  53. $(obj)/ntoskernel_exports.h: $(src)/ntoskernel.c
  54.  
  55. $(obj)/usb.o: $(obj)/usb_exports.h
  56. $(obj)/usb_exports.h: $(src)/usb.c
  57.  
  58. $(obj)/wrapper.o: $(obj)/wrapper_exports.h
  59. $(obj)/wrapper_exports.h: $(src)/wrapper.c
  60.  
  61. $(obj)/ntoskernel_io.o: $(obj)/ntoskernel_io_exports.h
  62. $(obj)/ntoskernel_io_exports.h: $(src)/ntoskernel_io.c
  63.  
  64.  
  65. quiet_cmd_exports = EXPORTS $@
  66.       cmd_exports = \
  67.         ( \
  68.                 echo "/* automatically generated from $< */"; \
  69.                 echo '\#ifdef CONFIG_X86_64'; \
  70.                 sed -n \
  71.                         -e 's/.*WIN_FUNC(\([^\,]\+\) *\, *\([0-9]\+\)).*/WIN_FUNC_DECL(\1, \2)/p' \
  72.                         -e 's/.*WIN_FUNC_PTR(\([^\,]\+\) *\, *\([0-9]\+\)).*/WIN_FUNC_DECL(\1, \2)/p' \
  73.                    $< | sed -e 's/[ \t  ]\+//' | sort -u; \
  74.                 echo '\#endif'; \
  75.                 echo "struct wrap_export $(shell basename $< .c)_exports[] = {";\
  76.                 sed -n \
  77.                         -e 's/.*WIN_FUNC(_win_\([^\,]\+\) *\, *\([0-9]\+\)).*/WIN_WIN_SYMBOL(\1,\2),/p' \
  78.                         -e 's/.*WIN_FUNC(\([^\,]\+\) *\, *\([0-9]\+\)).*/WIN_SYMBOL(\1,\2),/p' \
  79.                         -e 's/.*WIN_SYMBOL_MAP(\("[^"]\+"\)[ ,\n]\+\([^)]\+\)).*/{\1,(generic_func)\2},/p'  \
  80.                            $< | sed -e 's/[ \t  ]*/   /' | sort -u; \
  81.                 echo '   {NULL, NULL}'; \
  82.                 echo '};'; \
  83.         ) > $@
  84.  
  85. $(obj)/%_exports.h: $(src)/%.c FORCE
  86.     $(call if_changed,exports)
  87.