File Makefile.in of Package ndiswrapper
#
# SUSE specific makefile for the ndiswrapper kernel module (2.6 kernels)
# Andreas Gruenbacher, SUSE Labs, January 2004
#
KERNEL_SOURCE ?= /lib/modules/$(shell uname -r)/build
NDISWRAPPER_VERSION=@DRV_VERSION@
EXTRA_VERSION=
CPPFLAGS += -DDRIVER_VERSION=\"$(NDISWRAPPER_VERSION)\" \
-DEXTRA_VERSION=\"$(EXTRA_VERSION)\"
# This module only works on x86.
ifeq ($(CONFIG_X86),y)
obj-m := ndiswrapper.o
ndiswrapper-objs := hal.o iw_ndis.o loader.o crt.o ndis.o \
ntoskernel.o ntoskernel_io.o pe_linker.o pnp.o proc.o rtl.o \
wrapmem.o wrapndis.o wrapper.o usb.o
clean-files += ndis_exports.h hal_exports.h ntoskernel_exports.h \
ntoskernel_io_exports.h usb_exports.h
ifeq ($(CONFIG_X86_64),y)
ndiswrapper-objs += win2lin_stubs.o
clean-files += win2lin_stubs.h
else
ndiswrapper-objs += divdi3.o
endif
endif
$(obj)/ndis.o: $(src)/ndis_exports.h
$(obj)/hal.o: $(src)/hal_exports.h
$(obj)/ntoskernel.o: $(src)/ntoskernel_exports.h
$(obj)/ntoskernel_io.o: $(src)/ntoskernel_io_exports.h
$(obj)/crt.o: $(src)/crt.c $(src)/ndis.h $(src)/crt_exports.h
$(obj)/proc.o: $(src)/proc.c $(src)/ndis.h $(src)/iw_ndis.h $(src)/wrapndis.h
$(obj)/rtl.o: $(src)/rtl.c $(src)/ndis.h $(src)/rtl_exports.h
$(obj)/usb.o: $(src)/usb_exports.h
$(obj)/wrapper.o: $(src)/wrapper.c $(src)/wrapndis.h $(src)/iw_ndis.h \
$(src)/ntoskernel.h $(src)/loader.h
$(obj)/win2lin_stubs.o: $(src)/win2lin_stubs.h
.PHONY: modules install clean modules_add
modules modules_install clean:
$(MAKE) -C $(KERNEL_SOURCE) $@ SUBDIRS=$(CURDIR)
install : modules_install
gen_exports: crt_exports.h ndis_exports.h hal_exports.h ntoskernel_exports.h \
ntoskernel_io_exports.h usb_exports.h
# generate exports symbol table from C files
$(obj)/%_exports.h: $(src)/%.c
@if :; then \
echo "/* automatically generated from $< */"; \
echo "#ifdef CONFIG_X86_64"; \
sed -n \
-e 's/.*WIN_FUNC(\([^\,]\+\) *\, *\([0-9]\+\)).*/\
WIN_FUNC_DECL(\1, \2)/p' \
-e 's/.*WIN_FUNC_PTR(\([^\,]\+\) *\, *\([0-9]\+\)).*/\
WIN_FUNC_DECL(\1, \2)/p' \
$< | sed -e 's/[ \t ]\+//' | sort -u; \
echo "#endif"; \
echo "struct wrap_export $(shell basename $< .c)_exports[] = {";\
sed -n \
-e 's/.*WIN_FUNC(_win_\([^\,]\+\) *\, *\([0-9]\+\)).*/\
WIN_WIN_SYMBOL(\1,\2),/p' \
-e 's/.*WIN_FUNC(\([^\,]\+\) *\, *\([0-9]\+\)).*/\
WIN_SYMBOL(\1,\2),/p' \
-e 's/.*WIN_SYMBOL_MAP(\("[^"]\+"\)[ ,\n]\+\([^)]\+\)).*/\
{\1,(generic_func)\2},/p' \
$< | sed -e 's/[ \t ]*/ /' | sort -u; \
echo " {NULL, NULL}"; \
echo "};"; \
fi > $@
$(obj)/win2lin_stubs.h: $(src)/hal.c $(src)/crt.c $(src)/ndis.c \
$(src)/ntoskernel.c $(src)/ntoskernel_io.c $(src)/usb.c \
$(src)/pnp.c $(src)/rtl.c $(src)/wrapndis.c
@if :; then \
for file in $^; do \
echo; \
echo "# automatically generated from $$file"; \
sed -n \
-e 's/.*WIN_FUNC(\([^\,]\+\) *\, *\([0-9]\+\)).*/\
win2lin(\1, \2)/p' \
-e 's/.*WIN_FUNC_PTR(\([^\,]\+\) *\, *\([0-9]\+\)).*/\
win2lin(\1, \2)/p' \
$$file | sed -e 's/[ \t ]\+//' | sort -u; \
done; \
fi > $@