open-src/app/Makefile.inc
author Niveditha Rau <Niveditha.Rau@Sun.COM>
Thu, 24 Jan 2008 14:07:47 -0800
changeset 293 e848b36488ae
parent 255 32600afcc112
child 355 a3a81e9c227d
permissions -rw-r--r--
6653913 Replace xmag, xcalc with the opensrc version from X.Org [build fix] . Add LIB_LD_OPTIONS to Makefile.inc . Add the path to find libXaw7 in the proto dir, if not found in /usr/X11/lib/xorgcfg

# -*- Makefile -*- rules common to most X.Org application modules
#
# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
# Use subject to license terms.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, provided that the above
# copyright notice(s) and this permission notice appear in all copies of
# the Software and that both the above copyright notice(s) and this
# permission notice appear in supporting documentation.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# 
# Except as contained in this notice, the name of a copyright holder
# shall not be used in advertising or otherwise to promote the sale, use
# or other dealings in this Software without prior written authorization
# of the copyright holder.
#
# @(#)Makefile.inc	1.7	08/01/24
#

PWD:sh=pwd
TOP=$(PWD)/../..

# Source tarball
SOURCE_TARBALL_NAME=$(APP_NAME)-$(APP_VERS).tar.bz2
SOURCE_TARBALL_DIR=app

# Directory created by unpacking source
SOURCE_DIR=$(BUILD_DIR)/$(APP_NAME)-$(APP_VERS)

include $(TOP)/common/Makefile.inc

# Where to install files
APP_prefix=$(X11_DIR)

# Command line options to GNU autoconf configure script
CONFIG_OPTS = --prefix=$(APP_prefix) --mandir='$${prefix}/share/man' \
	$(APP_CONFIG_OPTS)

LIB_LD_OPTIONS = $(LIB_REQUIRED_LDFLAGS) \
	-L$(PROTODIR)$(X11_DIR)/lib$(LIBSUBDIR) $(LIB_ADD_LD_OPTIONS)

# Environment variable options to GNU autoconf configure script
CONFIG_ENV = CC=$(CC) CFLAGS="$(PROG_CFLAGS)" LD="$(LD) $(LDFLAGS)" \
	CPPFLAGS="-I $(PROTODIR)$(X11_INCLUDES_DIR) $(APP_ADD_CPPFLAGS)" \
	LDFLAGS="$(PROG_LDFLAGS) -L$(PROTODIR)$(X11_DIR)/lib$(ARCHLIBSUBDIR) $(APP_ADD_LDFLAGS)" \
	PKG_CONFIG_PATH=$(PROTODIR)/usr/lib/$(ARCHLIBSUBDIR)/pkgconfig:$(TOP)/common/pc-files/$(BUILD_DIR) \
	$(APP_CONFIG_ENV)

# Run configure script
$(SOURCE_DIR)/Makefile: $(UNPACK_TARGET)
	(cd $(SOURCE_DIR) ; chmod a+x configure ; \
	 $(CONFIG_ENV) ./configure $(CONFIG_OPTS) )

# Binary built in tree
APP_BIN=$(SOURCE_DIR)/src/$(APP_NAME)

build_gen: $(APP_BIN)

$(APP_BIN): $(SOURCE_DIR)/Makefile
	(cd $(SOURCE_DIR) ; $(LIBPATHS) LD_OPTIONS="$(LIB_LD_OPTIONS)" $(MAKE) $(MFLAGS) )

install_gen: $(APP_BIN)
	(cd $(SOURCE_DIR) ; $(LIBPATHS) LD_OPTIONS="$(LIB_LD_OPTIONS)" $(MAKE) $(MFLAGS) -e DESTDIR=$(PROTODIR) install)