# Name : Makefile.generic # # Copyright : 2002 by Imagination Technologies Ltd. All rights reserved. # No part of this software, either material or conceptual # may be copied or distributed, transmitted, transcribed, # stored in a retrieval system or translated into any # human or computer language in any form by any means, # electronic, mechanical, manual or other-wise, or # disclosed to third parties without the express written # permission of Imagination Technologies Ltd, Unit 8, HomePark # Industrial Estate, King's Langley, Hertfordshire, # WD4 8LZ, U.K. # # Description : external makefile for relinking to arbitrary kernels ifndef KERNELROOT KERNELROOT = /usr/src/linux-$(shell uname -r) endif ifneq ($(shell if test -d $(KERNELROOT); then echo yes; fi),yes) KERNELROOT = /usr/src/linux endif ifneq ($(shell if test -d $(KERNELROOT); then echo yes; fi),yes) error: $(error kernel source not found in $$KERNELROOT, /usr/src/linux-$(shell uname -r), or /usr/src/linux) endif SRC = hostfunc.c kernmem.c mmap.c module.c module_drm.c virtmem.c OBJS = $(SRC:.c=.o) CFLAGS = $(KERNFLAGS) -O2 CFLAGS += -DMODULE -DMODVERSIONS -include $(KERNELROOT)/include/linux/modversions.h CFLAGS += -D__KERNEL__ -I$(KERNELROOT)/include CFLAGS += -DLINUX -DGCC_IA32 -DSUPPORT_AGP -Idrm HAVE_VMA=$(shell grep remap_page_range $(KERNELROOT)/include/linux/mm.h | grep -c vma) ifeq ($(HAVE_VMA),0) CFLAGS += -DHAVE_VMA=0 else CFLAGS += -DHAVE_VMA=1 endif powervr.o: $(OBJS) $(LD) -r $^ libPOWERVR.a -o $@ install: powervr.o mkdir -p /lib/modules/`uname -r`/kernel/drivers/char/drm install -m 0444 powervr.o /lib/modules/`uname -r`/kernel/drivers/char/drm install -m 0755 lib{PVR2D,PVR2OS,PVRMMAP,SGL2,SGLMID7B}.so /usr/lib install -m 0444 powervr_drv.o /usr/X11R6/lib/modules/drivers install -m 0444 powervr_dri.so /usr/X11R6/lib/modules/dri install -m 0444 XF86KyroSampleConfig /etc/X11 install -m 0644 powervr_kyro.ini /etc ln -fs /usr/lib/libPVR2D.so /usr/X11R6/lib/modules/drivers mkdir -p /usr/share/doc/powervr install -m 0444 README LICENSE.TXT /usr/share/doc/powervr /sbin/depmod /sbin/ldconfig /sbin/modprobe powervr uninstall: -/sbin/rmmod powervr /bin/rm -f /usr/lib/lib{PVR2D,PVR2OS,PVRMMAP,SGL2,SGLMID7B}.so /bin/rm -f /usr/X11R6/lib/modules/drivers/libPVR2D.so /bin/rm -f /usr/X11R6/lib/modules/drivers/powervr_drv.o /bin/rm -f /usr/X11R6/lib/modules/dri/powervr_dri.so /bin/rm -f /etc/X11/XF86KyroSampleConfig /bin/rm -f /etc/powervr_kyro.ini /bin/rm -rf /usr/share/doc/powervr /sbin/depmod /sbin/ldconfig clean: /bin/rm -f $(OBJS) powervr.o