Makefile.inc revision 1061
98N/A# -*- Makefile -*- rules common to all X.Org drivers
98N/A#
957N/A# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
98N/A#
98N/A# Permission is hereby granted, free of charge, to any person obtaining a
919N/A# copy of this software and associated documentation files (the "Software"),
919N/A# to deal in the Software without restriction, including without limitation
919N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
919N/A# and/or sell copies of the Software, and to permit persons to whom the
919N/A# Software is furnished to do so, subject to the following conditions:
919N/A#
919N/A# The above copyright notice and this permission notice (including the next
919N/A# paragraph) shall be included in all copies or substantial portions of the
919N/A# Software.
919N/A#
919N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
919N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
919N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
919N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
919N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
919N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
919N/A# DEALINGS IN THE SOFTWARE.
98N/A#
98N/A#
98N/A
98N/APWD:sh=pwd
967N/ATOP=$(PWD)/../../..
98N/A
493N/AMODTYPE=driver
493N/A
493N/A### Include common definitions
967N/Ainclude $(TOP)/open-src/common/Makefile.init
493N/A
957N/A# Determine from MODULE_NAME if this is a video or input driver
957N/ADRIVER_CLASS_V=$(MODULE_NAME:xf86-video-%=video)
957N/ADRIVER_CLASS=$(DRIVER_CLASS_V:xf86-input-%=input)
957N/ADRIVER_NAME=$(MODULE_NAME:xf86-$(DRIVER_CLASS)-%=%)
957N/A
970N/A# Hierarchical parent for pkg names in this area
970N/AMODTYPE_PKGHIER=x11/server/xorg/driver
970N/AMODTYPE_PKGHIER_SET=yes
970N/A
970N/A# Default pkg names for drivers - map xf86- to xorg- in names
970N/AMODULE_PKGTAIL_DEFAULT = $(MODULE_PKGTAIL_SET:yes=$(POUND_SIGN))
970N/A$(MODULE_PKGTAIL_DEFAULT) MODULE_PKGTAIL=$(MODULE_NAME:xf86-%=xorg-%)
970N/A$(MODULE_PKGTAIL_DEFAULT) MODULE_PKGTAIL_SET=yes
970N/A
970N/A# Package classification - must be a valid value recognized by pkg gui
970N/AMODULE_PKGCLASS_input = Drivers/Other Peripherals
970N/AMODULE_PKGCLASS_video = Drivers/Display
970N/AMODULE_PKGCLASS_DEFAULT = $(MODULE_PKGCLASS_SET:yes=$(POUND_SIGN))
970N/A$(MODULE_PKGCLASS_DEFAULT) MODULE_PKGCLASS=$(MODULE_PKGCLASS_$(DRIVER_CLASS))
970N/A$(MODULE_PKGCLASS_DEFAULT) MODULE_PKGCLASS_SET=yes
970N/A
493N/A# Build 64-bit on SPARC, 32-bit & 64-bit on x86, to match Xorg server builds
963N/ABUILD_TYPES_DEFAULT = $(BUILD_TYPES_SET:yes=$(POUND_SIGN))
963N/A$(BUILD_TYPES_DEFAULT) BUILD_TYPES_sparc=64
963N/A$(BUILD_TYPES_DEFAULT) BUILD_TYPES_i386=32 64
963N/A$(BUILD_TYPES_DEFAULT) BUILD_TYPES=$(BUILD_TYPES_$(MACH))
963N/A$(BUILD_TYPES_DEFAULT) BUILD_TYPES_SET=yes
98N/A
493N/A# Additional command line options to GNU autoconf configure script
493N/AMODTYPE_CONFIG_OPTS = \
851N/A --docdir='$(X11_DOC_DIR)' \
851N/A --with-xorg-module-dir='$(X11_SERVERMODS_DIR)$(SERVERMOD_subdir)'
98N/A
493N/AMODTYPE_BUILD_32_FLAGS=ARCHBINSUBDIR="$(SUBDIR32)"
493N/AMODTYPE_BUILD_64_FLAGS=ARCHBINSUBDIR="$(SUBDIR64)"
98N/A
957N/A# Override module subdirs to be modules/xxx/amd64, not modules/amd64/xxx
957N/ADRIVER_DIR_input=$(X11_SERVERMODS_DIR)/input$(SERVERMOD_subdir)
957N/ADRIVER_DIR_video=$(X11_SERVERMODS_DIR)/drivers$(SERVERMOD_subdir)
957N/ADRIVER_DIR=$(DRIVER_DIR_$(DRIVER_CLASS))
957N/A
957N/AMODTYPE_MAKEFLAGS= \
957N/A inputdir='$(DRIVER_DIR_input)' \
957N/A driversdir='$(DRIVER_DIR_video)' \
957N/A $(DRIVER_NAME)_drv_ladir='$(DRIVER_DIR)'
957N/AMODTYPE_ADD_CONFIGURE_TARGETS = fix-moduledirs
851N/A
591N/A# Set comments in ELF binaries to help identify versions/builds
591N/AMODTYPE_ADD_BUILD_TARGETS=set-elf-comments
591N/A
493N/AMODTYPE_CPPFLAGS= \
606N/A -I$(PROTODIR)/usr/include \
606N/A -I$(PROTODIR)/usr/include/pixman-1 \
705N/A -I$(PROTODIR)$(XORG_SDK_INCLUDES_DIR) \
705N/A -I$(PROTODIR)$(X11_INCLUDES_DIR)/drm \
705N/A -I$(PROTODIR)$(X11_INCLUDES_DIR)/X11/dri
98N/A
493N/AMODTYPE_CFLAGS=$(PROG_CFLAGS)
98N/A
705N/AASM_IL_DIR = $(PROTODIR)$(XORG_SDK_INCLUDES_DIR)
705N/AMODTYPE_CFLAGS_suncc_i386_32 = $(ASM_IL_DIR)/solaris-ia32.il
705N/AMODTYPE_CFLAGS_suncc_i386_64 = $(ASM_IL_DIR)/solaris-amd64.il
705N/AMODTYPE_CFLAGS_suncc_sparc_32 = $(ASM_IL_DIR)/solaris-sparcv8plus.il
705N/AMODTYPE_CFLAGS_suncc_sparc_64 = $(ASM_IL_DIR)/solaris-sparcv8plus.il
705N/AMODTYPE_CFLAGS += $(MODTYPE_CFLAGS_$(MODULE_COMPILER)_$(MACH)_$(BUILD_TYPE))
705N/A
851N/A# Replaces @symbol_visibilty@ in xorg-server.pc, since that fails when
851N/A# some drivers are compiled with a different compiler than the server
851N/AMODTYPE_CFLAGS_suncc_common = -xldscope=hidden
851N/AMODTYPE_CFLAGS_gcc_common = # -fvisibility=hidden - doesn't work with gcc 3.4.3
851N/AMODTYPE_CFLAGS += $(MODTYPE_CFLAGS_$(MODULE_COMPILER)_common)
851N/A
965N/AMODTYPE_LDFLAGS=$(LDFLAGS) -Wl,-B,direct -R/lib$(ARCHLIBSUBDIR)
98N/A
493N/AMODTYPE_LD_OPTIONS=-z defs $(X11_SERVERLIBS_LDFLAGS) \
967N/A -M $(TOP)/open-src/xserver/xorg/$(BUILD_DIR)/mapfile-Xorg-externs -lc
98N/A
493N/A# Need to fix libtool interference with our linker flags
493N/ADELIBTOOLIZE=yes
98N/A
493N/A### Include common rules
967N/Ainclude $(TOP)/open-src/common/Makefile.inc
963N/A
963N/A# Clean up old 64-bit builds from before we stopped building them
967N/A# for some drivers - depends on $(CLEAN_RULES) to avoid errors from
967N/A# rm -r when two rules try to remove the same directory at once
963N/Aclean: clean_old64
963N/A
967N/Aclean_old64: $(CLEAN_RULES)
963N/A -rm -rf $(BUILD_DIR_64)