# # This is the Makefile to build the STV0680 driver outside # of the kernel tree. Naturally, compiler options below # may not match ones that you use to compile the kernel. # So be warned and use whatever options you need instead. # # The location of the kernel headers: LINUX_HEADERS=/usr/src/linux/include # This is the directory into which the modules will be installed. # The magic invocation will return something like this: # /lib/modules/2.4.0/kernel/drivers/usb #KVER = $(shell grep UTS_RELEASE $(LINUX_HEADERS)/linux/version.h|cut -f 2 -d'"') ifeq ($(LINUXVERSION),) LINUXVERSION = $(shell uname -r) endif MODDIR := /lib/modules/$(LINUXVERSION)/kernel/drivers/usb CC = gcc CPP = g++ CFLAGS = -D__KERNEL__ -I$(LINUX_HEADERS) -Wall -Wstrict-prototypes \ -O2 -fomit-frame-pointer -pipe -march=i586 -falign-functions=4 \ -fno-strict-aliasing -DMODULE # -DMODVERSIONS -include $(LINUX_HEADERS)/linux/modversions.h CPPFLAGS = -g -Wall -O2 include /usr/src/linux/.config ifdef CONFIG_MODVERSIONS CFLAGS += -DMODVERSIONS -include /usr/src/linux/include/linux/modversions.h endif SRCS = mmvideo.c PROG = mmvideo.o OBJECTS = mmvideo.o mmvideotest all : mmvideo.o mmvideotest mmvideommap mmvideo.o : mmvideo.c $(CC) $(CFLAGS) -c mmvideo.c -o mmvideo.o mmvideotest: mmvideotest.cpp $(HOME)/XLIB/gui++.o Image.o Image_JPG.o $(CPP) $(CPPFLAGS) -o $@ $^ -I$(HOME)/XLIB -L/usr/X11R6/lib -lX11 \ -lm -ljpeg -lpthread mmvideommap: mmvideommap.cpp $(HOME)/XLIB/gui++.o Image.o Image_JPG.o $(CPP) $(CPPFLAGS) -o $@ $^ -I$(HOME)/XLIB -L/usr/X11R6/lib -lX11 \ -lm -ljpeg -lpthread gui++.o: gui++.cpp $(CPP) $(CPPFLAGS) -o $@ -c $^ Image.o: Image.cpp $(CPP) $(CPPFLAGS) -o $@ -c $^ Image_JPG.o: Image_JPG.cpp $(CPP) $(CPPFLAGS) -o $@ -c $^ full: clean all clean: rm -f $(OBJECTS) *.o core