head 1.2; access; symbols libdrm-1_0_4:1.2 AGPGART_2_0:1.1.1.1 TUNGSTEN:1.1.1; locks; strict; comment @# @; 1.2 date 2003.01.13.15.30.27; author jhartmann; state Exp; branches; next 1.1; 1.1 date 2003.01.11.02.19.38; author jhartmann; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2003.01.11.02.19.38; author jhartmann; state Exp; branches; next ; desc @@ 1.2 log @Add dri port of testagp application for public use @ text @# # Makefile for building the agpgart module standalone. # # Modelled closely on the drm kernel Makefile.linux in the XFree86 source # tree. # # .SUFFIXES: MODS = agpgart.o PROGS = testagp testdriagp AGPHEADERS = agp.h agp_lists.h agp_query.h agp_vm.h agp_info.h \ agp_generic.h agp_context.h AGPLINHEADERS = agp_backend.h AGPOBJS = agpgart_be.o agpgart_fe.o agp_vm.o agp_generic.o agp_probe.o \ agp_lists.o agp_query.o agp_context.o WARNINGS = -Wall -Wwrite-strings -Wpointer-arith -Wcast-align \ -Wstrict-prototypes -Wnested-externs \ -Wpointer-arith CFLAGS = -O2 $(WARNINGS) PRGCFLAGS = $(CFLAGS) -g -ansi -pedantic -DPOSIX_C_SOURCE=199309L \ -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE MODCFLAGS = $(CFLAGS) -D__KERNEL__ -DMODULE -fomit-frame-pointer # First, locate correct tree for this kernel version. If we find a # matching tree, we assume that we can rely on that tree's autoconf.h. # This may not be correct, but it is the best assumption we can make. VERSION := $(shell uname -r) # For Red Hat... RHVERS := $(shell uname -r)custom A := /lib/modules/$(VERSION)/build/include B := /usr/src/linux-$(VERSION)/include C := /usr/src/linux/include D := /usr/include V := $(shell gcc -E -nostdinc -I$A picker.c 2>/dev/null \ | grep -s 'RELEASE = ' | cut -d' ' -f3) ifeq ($(V),"$(VERSION)") TREE := $A else ifeq ($(V),"$(RHVERS)") TREE := $A else V := $(shell gcc -E -nostdinc -I$B picker.c 2>/dev/null \ | grep -s 'RELEASE = ' | cut -d' ' -f3) ifeq ($(V),"$(VERSION)") TREE := $B else ifeq ($(V),"$(RHVERS)") TREE := $B else V := $(shell gcc -E -nostdinc -I$C picker.c 2>/dev/null \ | grep -s 'RELEASE = ' | cut -d' ' -f3) ifeq ($(V),"$(VERSION)") TREE := $C else V := $(shell gcc -E -nostdinc -I$D picker.c 2>/dev/null \ | grep -s 'RELEASE = ' | cut -d' ' -f3) ifeq ($(V),"$(VERSION)") TREE := $D else TREE := 0 endif endif endif endif endif endif ifeq ($(TREE),0) all::; @@echo Error: Could not locate kernel tree in $A $B $C $D else SMP := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \ | grep -s 'SMP = ' | cut -d' ' -f3) MODULES := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \ | grep -s 'MODULES = ' | cut -d' ' -f3) MODVERSIONS := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \ | grep -s 'MODVERSIONS = ' | cut -d' ' -f3) MACHINE := $(shell echo `uname -m`) endif all::;@@echo === KERNEL HEADERS IN $(TREE) all::;@@echo === SMP=${SMP} MODULES=${MODULES} MODVERSIONS=${MODVERSIONS} all::;@@echo === Compiling for machine $(MACHINE) ifeq ($(MODULES),0) all::;@@echo all::;@@echo "*** Kernel modules must be configured. Build aborted." all::;@@echo else all:: linux $(MODS) $(PROGS) endif ifeq ($(SMP),1) MODCFLAGS += -D__SMP__ endif ifeq ($(MODVERSIONS),1) MODCFLAGS += -DMODVERSIONS -include $(TREE)/linux/modversions.h endif DOMUNMAP := $(shell grep do_munmap $(TREE)/linux/mm.h | grep -c acct) ifeq ($(DOMUNMAP), 1) MODCFLAGS += -D__USE_FOUR_MUNMAP__ endif agpgart.o: $(AGPOBJS) $(LD) -r $^ -o $@@ testagp: testagp.c agplib.c $(CC) -I. -o $@@ $^ testdriagp: testagp.c drilib.o $(CC) -I. -o $@@ $^ dristat: dristat.c $(CC) $(PRGCFLAGS) -I. -o $@@ $< drilib.o: drilib.c $(CC) $(PRGCFLAGS) -I. -c $< %.o: %.c $(CC) $(MODCFLAGS) -DEXPORT_SYMTAB -I. -I$(TREE) -c $< -o $@@ $(AGPOBJS): $(AGPHEADERS) linux: rm -f linux ln -s . linux distclean: rm -f *~ rm -f *.o rm -f linux rm -f $(PROGS) clean: rm -f *.o rm -f linux rm -f $(PROGS) @ 1.1 log @Initial revision @ text @d13 1 a13 1 PROGS = testagp d28 3 d120 10 a129 2 testagp: testagp.c $(CC) -I. -o $@@ $< @ 1.1.1.1 log @Import of Agpgart 2.0 module @ text @@