7. Linux

3.Make driver module

(1)Copy the driver source file (cb31_cb.c)

Copy the driver source file named cb31_cb.c to the directory which includes PCMCIA Client Driver source.(The directory normally means pcmcia clients directory)

If there is the extracted driver source file named cb31_cb.c in the directory /root/cb31, type the command as written below.

#cd /usr/src/linux-2-2.12/pcmcia-cs-3.0.14/clients

#cp /root/cb31/cb31_cb.c .

The cb31_cb.c file will be copied.

(2)Edit Makefile

Add the three lines below to Makefile in the clients directory to compile cb31_cb.

cb31_cb.o : cb31_cb.c

$(CC) -MD -c $(XFLAGS) $(CPPFLAGS) I$(LINUX) $ <-o $@ @mkdir -p .depfiles ; mv cb31_cb.d.depfiles

(3)Execute Makefile

Compile cb31_cb with make command.

# make cb31_cb.o

(Caution)

If you get the following error message,

Makefile:8: ../config.mk:No such file or directory

make: *** Nu rule to make target ‘../conifg.mk’. Stop

Move up one directory and execute [make config].You will get config.mk.

Move back to the clients directory and execute make command.

#cd ..

#make config

#cd clients

Linux

65