2000-01-17 12:04:55 +01:00
|
|
|
#**************************************************************************
|
|
|
|
#*
|
|
|
|
#* X11-specific rules files, used to compile the X11 graphics driver
|
|
|
|
#* when supported by the current platform
|
|
|
|
#*
|
|
|
|
#**************************************************************************
|
|
|
|
|
|
|
|
#########################################################################
|
|
|
|
#
|
|
|
|
# Try to detect an X11 setup.
|
|
|
|
#
|
|
|
|
# We simply try to detect a `X11R6/bin', `X11R5/bin' or `X11/bin' in
|
|
|
|
# the current path.
|
|
|
|
#
|
|
|
|
ifneq ($(findstring X11R6$(SEP)bin,$(PATH)),)
|
2000-03-05 02:14:19 +01:00
|
|
|
xversion := X11R6
|
2000-01-17 12:04:55 +01:00
|
|
|
else
|
2000-03-05 02:14:19 +01:00
|
|
|
ifneq ($(findstring X11R5$(SEP)bin,$(PATH)),)
|
|
|
|
xversion := X11R5
|
|
|
|
else
|
|
|
|
ifneq ($(findstring X11$(SEP)bin,$(PATH)),)
|
|
|
|
xversion := X11
|
|
|
|
endif
|
|
|
|
endif
|
2000-01-17 12:04:55 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef xversion
|
2000-03-05 02:14:19 +01:00
|
|
|
X11_PATH := $(subst ;, ,$(PATH)) $(subst :, ,$(PATH))
|
|
|
|
X11_PATH := $(filter %$(xversion)$(SEP)bin,$(X11_PATH))
|
|
|
|
X11_PATH := $(X11_PATH:%$(SEP)bin=%)
|
2000-01-17 12:04:55 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
##########################################################################
|
|
|
|
#
|
|
|
|
# Update some variables to compile the X11 graphics module. Note that
|
|
|
|
# X11 is available on Unix, or on OS/2. However, it only compiles with
|
|
|
|
# gcc on the latter platform, which is why it is safe to use the flags
|
2000-02-21 18:46:24 +01:00
|
|
|
# `-L' and `-l' in GRAPH_LINK
|
2000-01-17 12:04:55 +01:00
|
|
|
#
|
|
|
|
ifneq ($(X11_PATH),)
|
|
|
|
|
2000-03-05 02:14:19 +01:00
|
|
|
X11_INCLUDE := $(X11_PATH:%=%$(SEP)include)
|
|
|
|
X11_LIB := $(X11_PATH:%=%$(SEP)lib)
|
2000-01-17 12:04:55 +01:00
|
|
|
|
2000-03-05 02:14:19 +01:00
|
|
|
# the GRAPH_LINK variable is expanded each time an executable is linked
|
|
|
|
# against the graphics library.
|
|
|
|
#
|
|
|
|
GRAPH_LINK += $(X11_LIB:%=-L%) -lX11
|
2000-01-17 12:04:55 +01:00
|
|
|
|
2000-03-05 02:14:19 +01:00
|
|
|
# Solaris needs a -lsocket in GRAPH_LINK ..
|
|
|
|
#
|
|
|
|
UNAME := $(shell uname)
|
|
|
|
ifneq ($(findstring $(UNAME),SunOS Solaris),)
|
|
|
|
GRAPH_LINK += -lsocket
|
|
|
|
endif
|
2000-01-17 12:04:55 +01:00
|
|
|
|
|
|
|
|
2000-03-05 02:14:19 +01:00
|
|
|
# add the X11 driver object file to the graphics library
|
|
|
|
#
|
|
|
|
GRAPH_OBJS += $(OBJ_)grx11.$O
|
2000-01-17 12:04:55 +01:00
|
|
|
|
|
|
|
|
2000-03-05 02:14:19 +01:00
|
|
|
GR_X11 := $(GRAPH_)x11
|
|
|
|
GR_X11_ := $(GR_X11)$(SEP)
|
2000-01-17 12:04:55 +01:00
|
|
|
|
2000-03-05 02:14:19 +01:00
|
|
|
DEVICES += X11
|
|
|
|
DEVICE_INCLUDES += $(GR_X11)
|
2000-01-17 12:04:55 +01:00
|
|
|
|
2000-03-05 02:14:19 +01:00
|
|
|
# the rule used to compile the X11 driver
|
|
|
|
#
|
|
|
|
$(OBJ_)grx11.$O: $(GR_X11_)grx11.c $(GR_X11_)grx11.h
|
|
|
|
$(CC) $(CFLAGS) $(GRAPH_INCLUDES:%=$I%) $I$(GR_X11) \
|
|
|
|
$(X11_INCLUDE:%=$I%) $T$@ $<
|
2000-01-17 12:04:55 +01:00
|
|
|
endif
|
|
|
|
|
2000-03-05 02:14:19 +01:00
|
|
|
# EOF
|