summaryrefslogtreecommitdiff
path: root/linux/Makefile.linux
diff options
context:
space:
mode:
Diffstat (limited to 'linux/Makefile.linux')
-rw-r--r--linux/Makefile.linux33
1 files changed, 29 insertions, 4 deletions
diff --git a/linux/Makefile.linux b/linux/Makefile.linux
index c1ead321..7fe57f8e 100644
--- a/linux/Makefile.linux
+++ b/linux/Makefile.linux
@@ -24,6 +24,7 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
+# $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.linux,v 1.9 2000/08/04 03:51:47 tsi Exp $
#
# ***** NOTE NOTE NOTE NOTE NOTE *****
# To override the automatic Linux source tree determination, pass the
@@ -53,7 +54,7 @@ PROGS= drmstat
DRMOBJS= init.o memory.o proc.o auth.o context.o drawable.o bufs.o \
lists.o lock.o ioctl.o fops.o vm.o dma.o ctxbitmap.o
-DRMHEADERS= drm.h drmP.h
+DRMHEADERS= drm.h drmP.h compat-pre24.h
GAMMAOBJS= gamma_drv.o gamma_dma.o
GAMMAHEADERS= gamma_drv.h $(DRMHEADERS)
@@ -121,8 +122,11 @@ MODVERSIONS := $(shell gcc -E -I $(TREE) picker.c 2>/dev/null \
| grep -s 'MODVERSIONS = ' | cut -d' ' -f3)
AGP := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
| grep -s 'AGP = ' | cut -d' ' -f3)
+SIS := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
+ | grep -s 'SIS = ' | cut -d' ' -f3)
PARAMS := $(shell if fgrep kill_fasync $(TREE)/linux/fs.h \
- | fgrep -q band; then echo 3; else echo 2; fi)
+ | egrep -q '(band|int, int)'; then echo 3; else echo 2; fi)
+MACHINE := $(shell echo `uname -m`)
ifeq ($(AGP),0)
AGP := $(shell gcc -E -nostdinc -I$(TREE) picker.c 2>/dev/null \
| grep -s 'AGP_MODULE = ' | cut -d' ' -f3)
@@ -131,7 +135,11 @@ endif
ifeq ($(AGP),1)
MODCFLAGS += -DCONFIG_AGP -DCONFIG_AGP_MODULE
DRMOBJS += agpsupport.o
-MODS += mga.o i810.o
+MODS += mga.o
+ifeq ($(MACHINE),i386)
+MODS += i810.o
+endif
+
MGAOBJS= mga_drv.o mga_dma.o mga_bufs.o mga_state.o mga_context.o
MGAHEADERS= mga_drv.h $(DRMHEADERS)
@@ -140,9 +148,23 @@ I810OBJS= i810_drv.o i810_dma.o i810_bufs.o i810_context.o
I810HEADERS= i810_drv.h $(DRMHEADERS)
endif
+ifeq ($(SIS),1)
+# It appears that the SiS driver makes calls to sis_malloc and sis_free, and
+# that these calls are only defined if CONFIG_FB_SIS is selected. So, key
+# off that to determine if we should attempt to build the SiS driver.
+#
+# A better way would be to detect the appropriate definitions in the header
+# file to see if we can, at least, compile the driver.
+MODS += sis.o
+
+SISOBJS= sis_drv.o sis_context.o sis_ds.o sis_mm.o
+SISHEADERS= sis_drv.h sis_ds.h sis_drm.h $(DRMHEADERS)
+endif
+
all::;@echo === KERNEL HEADERS IN $(TREE)
-all::;@echo === SMP=${SMP} MODVERSIONS=${MODVERSIONS} AGP=${AGP}
+all::;@echo === SMP=${SMP} MODVERSIONS=${MODVERSIONS} AGP=${AGP} SIS=${SIS}
all::;@echo === kill_fasync has $(PARAMS) parameters
+all::;@echo === Compiling for machine $(MACHINE)
all:: $(LIBS) $(MODS) $(PROGS)
endif
@@ -180,6 +202,9 @@ r128_drv.o: r128_drv.c
r128.o: $(R128OBJS) $(LIBS)
$(LD) -r $^ -o $@
+sis.o: $(SISOBJS) $(LIBS)
+ $(LD) -r $^ -o $@
+
ifeq ($(AGP),1)
mga_drv.o: mga_drv.c
$(CC) $(MODCFLAGS) -DEXPORT_SYMTAB -I$(TREE) -c $< -o $@