[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Sheflug] winmodems under linux



Steve J. Turnbull wrote:

>Look at the comments in ptmodule.c.  If there aren't any, oh well.

>You could post

>	   (1) the Makefile
>        (2) ptmodule.c


Here's the Makefile:


#
# Makefile for the PCtel module
#
# Note! The CFLAGS definition is now inherited from the
# parent makefile.
#


HPATH   	= ../../include
FINDHPATH	= $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net

HOSTCC  	=gcc -I$(HPATH)
HOSTCFLAGS	=-O -fomit-frame-pointer

CROSS_COMPILE 	=

COL_DEBUG_FLAGS =

AS	=$(CROSS_COMPILE)as
LD	=$(CROSS_COMPILE)ld
CC	=$(CROSS_COMPILE)gcc -D__KERNEL__ -DMODULE -Wall $(HOSTCFLAGS) -I$(HPATH)
${COL_DEBUG_FLAGS}
CPP	=$(CC) -E
AR	=$(CROSS_COMPILE)ar
NM	=$(CROSS_COMPILE)nm
STRIP	=$(CROSS_COMPILE)strip
MAKE	=make

EXTRA_LDFLAGS	:=


# object files directory

O_TARGET := ../../lib/pctel.o

# object files
O_OBJS	:= \
	ptmodule.o \

OX_OBJS := \
	../../lib/control.a \
	../../lib/hal.a \
	../../lib/dsp.a \
	../../lib/ptserial.a

all_targets: $(O_TARGET) $(L_TARGET)

%.s: %.c
	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -S $< -o $@

%.o: %.c
	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<

%.o: %.s
	$(AS) $(ASFLAGS) $(EXTRA_CFLAGS) -o $@ $<

ifdef O_TARGET
ALL_O = $(O_OBJS) $(OX_OBJS)
$(O_TARGET): $(ALL_O) Makefile
	rm -f $@
	$(LD) -r $(EXTRA_LDFLAGS) -o $@ $(ALL_O)
endif


clean:
	rm -f *.o
ifdef L_TARGET
	rm -f $(L_TARGET)
endif
ifdef O_TARGET
	rm -f $(O_TARGET)
endif


Here's the ptmodule.c file (I can see what I need to do from the comment,
but I don't know how to do it):


/*
 *	For the definition of __module_kernel_version[] so that
 *	the modem driver can be compatible with various Linux kernel
 *	versions.
 *
 *	This file is to be linked with the rest of the libraries in
 *	the distribution package.
 */

#include <linux/version.h>
const char __module_kernel_version[] __attribute__((section(".modinfo"))) =
"kernel_version=" UTS_RELEASE;
#ifdef MODVERSIONS
const char __module_using_checksums[] __attribute__((section(".modinfo"))) =
"using_checksums=1";
#endif


Cheers,

Dean

---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word 
 "unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.