comparison Makefile @ 27191:0c39ee17759a

Introduce DRIVER_OBJS variable for list of all driver targets.
author diego
date Sun, 06 Jul 2008 13:41:08 +0000
parents ec54fc8ebe83
children 9cbd4395dfca
comparison
equal deleted inserted replaced
27190:ec54fc8ebe83 27191:0c39ee17759a
980 KERNEL_INC = /lib/modules/`uname -r`/build/include 980 KERNEL_INC = /lib/modules/`uname -r`/build/include
981 KERNEL_VERSION = $(shell grep RELEASE $(KERNEL_INC)/linux/version.h | cut -d'"' -f2) 981 KERNEL_VERSION = $(shell grep RELEASE $(KERNEL_INC)/linux/version.h | cut -d'"' -f2)
982 KERNEL_CFLAGS = -O2 -D__KERNEL__ -DMODULE -Wall -I$(KERNEL_INC) -include $(KERNEL_INC)/linux/modversions.h 982 KERNEL_CFLAGS = -O2 -D__KERNEL__ -DMODULE -Wall -I$(KERNEL_INC) -include $(KERNEL_INC)/linux/modversions.h
983 KERNEL_OBJS = $(addprefix drivers/, mga_vid.o tdfx_vid.o radeon_vid.o rage128_vid.o) 983 KERNEL_OBJS = $(addprefix drivers/, mga_vid.o tdfx_vid.o radeon_vid.o rage128_vid.o)
984 MODULES_DIR = /lib/modules/$(KERNEL_VERSION)/misc 984 MODULES_DIR = /lib/modules/$(KERNEL_VERSION)/misc
985 985 DRIVER_OBJS = $(KERNEL_OBJS) drivers/mga_vid_test drivers/tdfx_vid_test
986 drivers: $(KERNEL_OBJS) drivers/mga_vid_test drivers/tdfx_vid_test 986
987 987 drivers: $(DRIVER_OBJS)
988 $(KERNEL_OBJS) drivers/mga_vid_test drivers/tdfx_vid_test: CFLAGS = $(KERNEL_CFLAGS) 988
989 $(DRIVER_OBJS): CFLAGS = $(KERNEL_CFLAGS)
989 drivers/mga_vid.o: drivers/mga_vid.c drivers/mga_vid.h 990 drivers/mga_vid.o: drivers/mga_vid.c drivers/mga_vid.h
990 drivers/tdfx_vid.o: drivers/tdfx_vid.c drivers/3dfx.h 991 drivers/tdfx_vid.o: drivers/tdfx_vid.c drivers/3dfx.h
991 drivers/radeon_vid.o drivers/rage128_vid.o: CFLAGS += -fomit-frame-pointer -fno-strict-aliasing -fno-common -ffast-math 992 drivers/radeon_vid.o drivers/rage128_vid.o: CFLAGS += -fomit-frame-pointer -fno-strict-aliasing -fno-common -ffast-math
992 drivers/radeon_vid.o: drivers/radeon_vid.c drivers/radeon.h drivers/radeon_vid.h 993 drivers/radeon_vid.o: drivers/radeon_vid.c drivers/radeon.h drivers/radeon_vid.h
993 drivers/rage128_vid.o: drivers/radeon_vid.c drivers/radeon.h drivers/radeon_vid.h 994 drivers/rage128_vid.o: drivers/radeon_vid.c drivers/radeon.h drivers/radeon_vid.h
994 $(CC) $(CFLAGS) -DRAGE128 -c $< -o $@ 995 $(CC) $(CFLAGS) -DRAGE128 -c $< -o $@
995 996
996 install-drivers: drivers 997 install-drivers: $(DRIVER_OBJS)
997 -mkdir -p $(MODULES_DIR) 998 -mkdir -p $(MODULES_DIR)
998 install -m 644 $(KERNEL_OBJS) $(MODULES_DIR) 999 install -m 644 $(KERNEL_OBJS) $(MODULES_DIR)
999 depmod -a 1000 depmod -a
1000 -mknod /dev/mga_vid c 178 0 1001 -mknod /dev/mga_vid c 178 0
1001 -mknod /dev/tdfx_vid c 178 0 1002 -mknod /dev/tdfx_vid c 178 0
1002 -mknod /dev/radeon_vid c 178 0 1003 -mknod /dev/radeon_vid c 178 0
1003 -ln -s /dev/radeon_vid /dev/rage128_vid 1004 -ln -s /dev/radeon_vid /dev/rage128_vid
1004 1005
1005 driversclean: 1006 driversclean:
1006 rm -f drivers/*.o drivers/*~ drivers/mga_vid_test drivers/tdfx_vid_test 1007 rm -f $(DRIVER_OBJS) drivers/*~
1007 1008
1008 dhahelper: vidix/dhahelper/dhahelper.o vidix/dhahelper/test 1009 dhahelper: vidix/dhahelper/dhahelper.o vidix/dhahelper/test
1009 1010
1010 vidix/dhahelper/dhahelper.o vidix/dhahelper/test: CFLAGS = $(KERNEL_CFLAGS) 1011 vidix/dhahelper/dhahelper.o vidix/dhahelper/test: CFLAGS = $(KERNEL_CFLAGS)
1011 vidix/dhahelper/dhahelper.o: vidix/dhahelper/dhahelper.c vidix/dhahelper/dhahelper.h 1012 vidix/dhahelper/dhahelper.o: vidix/dhahelper/dhahelper.c vidix/dhahelper/dhahelper.h