1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
###############################################################################
# Makefile by Carlo Wood (and others)
ifeq ($(OPT_CFLAGS),)
# Determine the machine type
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
# Setup machine dependant compiler flags
ifeq ($(ARCH), i386)
OPT_CFLAGS = -O2 -m486 -fomit-frame-pointer \
-fno-strength-reduce \
-malign-loops=2 -malign-jumps=2 -malign-functions=2
endif
ifeq ($(ARCH), alpha)
OPT_CFLAGS = -O2 -mno-fp-regs -mcpu=ev4 \
-ffixed-8 \
-Wa,-mev6 \
-fomit-frame-pointer -fno-strict-aliasing
endif
endif # ifeq ($OPT_CFLAGS),)
CFLAGS := -DMODULE -D__KERNEL__ -I$(KSRC)/include $(OPT_CFLAGS)
###############################################################################
# You should never need to change anything below.
all: sanity 3dfx.o
# Sanity checks
sanity:
@( \
if [ ! -e $(KSRC) ]; then \
echo "Expect kernel source at location $(KSRC)"; \
echo "Sym.link $(KSRC) -> where you have your sources"; \
exit -1; \
fi; \
if [ ! -r $(KSRC)/include ]; then \
echo "Expect readable headers in $(KSRC)/include"; \
exit -1; \
fi; \
if [ ! -r $(KSRC)/include/linux/version.h ]; then \
echo "Missing $(KSRC)/include/linux/version.h"; \
echo "Configure and install the kernel first"; \
exit -1; \
fi; \
)
###############################################################################
# kernel 2.1+
3dfx.o: 3dfx_driver.c Makefile
$(CC) $(CFLAGS) -c -o $@ 3dfx_driver.c
###############################################################################
install:
mkdir -p /lib/modules/$(KVERS)/misc
cp 3dfx.o /lib/modules/$(KVERS)/misc/3dfx.o
@( \
if [ -e /lib/modules/$(KVERS)/modules.dep ]; then \
indep=`grep 'misc/3dfx.o:' /lib/modules/$(KVERS)/modules.dep`; \
if [ -z "$$indep" ]; then \
echo "/lib/modules/$(KVERS)/misc/3dfx.o:" >> /lib/modules/$(KVERS)/modules.dep; \
echo "" >> /lib/modules/$(KVERS)/modules.dep; \
fi; \
fi; \
if [ ! -c /dev/3dfx ]; then \
mknod /dev/3dfx c 107 0; \
chmod go+w /dev/3dfx; \
fi; \
if [ "$(RPM_INSTALL)" = "1" ]; then \
echo "/lib/modules/$(KVERS)/misc/3dfx.o"; \
else \
inconf=`grep 'alias char-major-107 3dfx' /etc/conf.modules`; \
if [ -z "$$inconf" ]; then \
echo "alias char-major-107 3dfx" >> /etc/conf.modules; \
fi; \
fi; \
)
###############################################################################
# This is for debugging purposes by the developers:
clean:
rm -f *.o *.s
3dfx.s: 3dfx_driver.c Makefile
$(CC) $(CFLAGS) -S -c 3dfx_driver.c
tar:
tar czf ../../SOURCES/Dev3Dfx-2.5.tar.gz 3dfx_driver.c Makefile
debug:
make OPT_CFLAGS="-g -Wall -Wstrict-prototypes -DDEBUG"
|