This makefile is designed to be called either when compiling the kernel
source tree (that's the kbuild section, if KERNELVERSION is defined) or
when called from the command line from the working directory with the
source (in this case, ~/Downloads/ov51x-jpeg-1.5.9): let's assume the
second case is what we're after.

Normally, 'make all' is what you would need.  But the makefile needs the
kernel source tree (e.g. package linux-source-[version]) or at least the
kernel headers (package linux-headers-[version]) and uses the linux kbuild
infrastucture there.  This makefile assumes that the kernel source tree is
available in /lib/modules/[version]/build.

So, the prerequisites:
1. what version kernel are you compiling for?
$ uname -r

2. do you have the source tree for that kernel?  In Debian, Ubuntu et al.:
$ dpkg -l 'linux-source-*' 'linux-headers-*'
... if not, install at linux-headers-[version]

3. are the kernel headers where the makefile expects (linux-headers-* uses
this directoy)?
$ ls -l /lib/modules/$(uname -r)/build
... if not, either make a symlink or edit the makefile to use the absolute
path for the kernel source tree (that's the KDIR variable in the
makefile).

4. if all the above check out, you are in good shape.  Try:
$ sudo make all
... *should* work.  This will compile the module and install the module
into the /lib/modules/[version] tree.

5. Update your module dependencies and load the module.
$ sudo depmod
$ sudo modprobe ov51x-jpeg

BTW, makefiles are curt and make use of funny punctuation instead of
human-readable functions.  I remember I lost an afternoon debugging
because my Makefile had spaces (ASCII 32) where it needed tabs (ASCII 12).

Good luck!

Stephen Benoit
[email protected]

> On 11-10-19 11:51 AM, spam spammer wrote:
>> aquarelle@Marvin:~/Downloads/ov51x-jpeg-1.5.9$ make modules
>> make: *** No rule to make target `modules'.  Stop.
>
> It is broken, even the ubuntu package is broken with same error. I don't
> know enough about makefiles to troubleshoot it.
>
> FYI, an easier way to install this on ubuntu, if it were not broken is:
>
> sudo m-a a-i ov51x-jpeg-source
>
> m-a is module-assistant a-i is "auto install"
>
> Sorry I can't help more.
>
> Jeremy
>
> PS: here is makefile in case someone else can help
>
> =============================
>
>
> OVCAM_KVER := $(shell uname -r)
> OVCAM_MAJMIN := $(shell echo $(OVCAM_KVER) | cut -d . -f 1-2)
>
> ifeq ($(OVCAM_MAJMIN),2.6)
>
> ifneq ($(KERNELRELEASE),)
> #
> # Make rules for use from within 2.6 kbuild system
> #
> obj-m    += ov51x-jpeg.o
>
> ov51x-jpeg-objs := ov51x-jpeg-core.o ov511-decomp.o ov518-decomp.o
> ov519-decomp.o
>
> else  # We were called from command line
>
> KDIR    := /lib/modules/$(shell uname -r)/build
> PWD    := $(shell pwd)
> all:
>      $(MAKE) -C $(KDIR) M=$(PWD) modules
>
> install: all
>      $(MAKE) -C $(KDIR) M=$(PWD) modules_install
>      depmod -a
>
> clean:
>      rm -rf .*.cmd  *.mod.c *.ko *.o .tmp_versions Module.symvers *~
> core *.i *.cmd .ov51x-jpeg-core.o.d
> endif
>
> endif
>
> _______________________________________________
> mlug mailing list
> [email protected]
> https://listes.koumbit.net/cgi-bin/mailman/listinfo/mlug-listserv.mlug.ca
>
>


_______________________________________________
mlug mailing list
[email protected]
https://listes.koumbit.net/cgi-bin/mailman/listinfo/mlug-listserv.mlug.ca

Reply via email to