Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # This script can be used to build "jumbo" modules that contain the |
| 4 | # base PARIDE support, one protocol module and one high-level driver. |
| 5 | # |
| 6 | echo -n "High level driver [pcd] : " |
| 7 | read X |
| 8 | HLD=${X:-pcd} |
| 9 | # |
| 10 | echo -n "Protocol module [bpck] : " |
| 11 | read X |
| 12 | PROTO=${X:-bpck} |
| 13 | # |
| 14 | echo -n "Use MODVERSIONS [y] ? " |
| 15 | read X |
| 16 | UMODV=${X:-y} |
| 17 | # |
| 18 | echo -n "For SMP kernel [n] ? " |
| 19 | read X |
| 20 | USMP=${X:-n} |
| 21 | # |
| 22 | echo -n "Support PARPORT [n] ? " |
| 23 | read X |
| 24 | UPARP=${X:-n} |
| 25 | # |
| 26 | echo |
| 27 | # |
| 28 | case $USMP in |
| 29 | y* | Y* ) FSMP="-DCONFIG_SMP" |
| 30 | ;; |
| 31 | *) FSMP="" |
| 32 | ;; |
| 33 | esac |
| 34 | # |
| 35 | MODI="-include ../../../include/linux/modversions.h" |
| 36 | # |
| 37 | case $UMODV in |
| 38 | y* | Y* ) FMODV="-DMODVERSIONS $MODI" |
| 39 | ;; |
| 40 | *) FMODV="" |
| 41 | ;; |
| 42 | esac |
| 43 | # |
| 44 | case $UPARP in |
| 45 | y* | Y* ) FPARP="-DCONFIG_PARPORT" |
| 46 | ;; |
| 47 | *) FPARP="" |
| 48 | ;; |
| 49 | esac |
| 50 | # |
| 51 | TARG=$HLD-$PROTO.o |
| 52 | FPROTO=-DCONFIG_PARIDE_`echo "$PROTO" | tr [a-z] [A-Z]` |
| 53 | FK="-D__KERNEL__ -I ../../../include" |
| 54 | FLCH=-D_LINUX_CONFIG_H |
| 55 | # |
| 56 | echo cc $FK $FSMP $FLCH $FPARP $FPROTO $FMODV -Wall -O2 -o Jb.o -c paride.c |
| 57 | cc $FK $FSMP $FLCH $FPARP $FPROTO $FMODV -Wall -O2 -o Jb.o -c paride.c |
| 58 | # |
| 59 | echo cc $FK $FSMP $FMODV -Wall -O2 -o Jp.o -c $PROTO.c |
| 60 | cc $FK $FSMP $FMODV -Wall -O2 -o Jp.o -c $PROTO.c |
| 61 | # |
| 62 | echo cc $FK $FSMP $FMODV -DMODULE -DPARIDE_JUMBO -Wall -O2 -o Jd.o -c $HLD.c |
| 63 | cc $FK $FSMP $FMODV -DMODULE -DPARIDE_JUMBO -Wall -O2 -o Jd.o -c $HLD.c |
| 64 | # |
| 65 | echo ld -r -o $TARG Jp.o Jb.o Jd.o |
| 66 | ld -r -o $TARG Jp.o Jb.o Jd.o |
| 67 | # |
| 68 | # |
| 69 | rm Jp.o Jb.o Jd.o |
| 70 | # |