1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-17 12:25:03 +00:00
mpv/drivers/Makefile
diego f8f7b06cbf Build tdfx_vid.o and tdfx_vid_tst by default under Linux 2.4.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22673 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-03-17 01:20:53 +00:00

45 lines
1.1 KiB
Makefile

KERNEL_DIR=/lib/modules/`uname -r`/build
KERNEL_INCLUDES= $(KERNEL_DIR)/include
INCLUDES = -I$(KERNEL_INCLUDES) -I$(KERNEL_INCLUDES)/asm
VERSION = $(shell grep UTS_RELEASE $(KERNEL_INCLUDES)/linux/version.h | cut -d '"' -f2)
MDIR = /lib/modules/$(VERSION)/misc
ifneq (,$(findstring 2.6, $(VERSION)))
MGA_VID_OBJ = mga_vid.ko
CFLAGS = -O2 -D__KERNEL__ -DMODULE $(INCLUDES) -Wall -include $(KERNEL_INCLUDES)/config/modversions.h
all: $(MGA_VID_OBJ) mga_vid_test
else
MGA_VID_OBJ = mga_vid.o
CFLAGS = -O2 -D__KERNEL__ -DMODULE $(INCLUDES) -Wall -include $(KERNEL_INCLUDES)/linux/modversions.h
all: $(MGA_VID_OBJ) mga_vid_test tdfx_vid.o tdfx_vid_tst
endif
mga_vid.o: mga_vid.c mga_vid.h
$(CC) $(CFLAGS) -c $<
mga_vid.ko: mga_vid.c mga_vid.h
$(MAKE) -C $(KERNEL_DIR) SUBDIRS=$(PWD) modules
mga_vid_test: mga_vid_test.c
$(CC) -O -o $@ $<
tdfx_vid.o: tdfx_vid.c 3dfx.h
$(CC) $(CFLAGS) -c $<
tdfx_vid_tst: tdfx_vid_tst.c
$(CC) -O -o $@ $<
install: $(MGA_VID_OBJ)
-mkdir -p $(MDIR)
install -m 644 $(MGA_VID_OBJ) $(MDIR)
depmod -a
dep depend:
clean:
rm -f *.o *~ *.ko mga_vid_test tdfx_vid_tst
distclean: clean
.PHONY: all install dep depend clean distclean