#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#pragma ident "@(#)Makefile.sfw 1.9 09/07/14 SMI"
NAME=quagga
VERSION=0.99.8
SOURCE=$(NAME)-$(VERSION).tar.gz
SRCDIR=$(NAME)-$(VERSION)
BUILDDIR=$(NAME)-$(MACH)-build
VER=$(SRCDIR)
PATCHES:sh= cat ./PATCHES.sfw | grep -v '^\#' | grep -v '^$' | sed 's/\(.*\)/patches\/\1\.applied/'
LD_OPTIONS=-L${ROOT}/usr/lib -L/usr/sfw/lib -L/usr/lib -R/usr/sfw/lib:/usr/lib
.PARALLEL: .compile
all: runconfig .compile
@find . -name core -exec rm -f {} \;
include ../Makefile.cmd
# configure script paths, e.g. --prefix, --sysconfdir, etc..
# ../../Makefile should provide these directly idealls
CFGSYSCONFDIR= $(CFGETC)/quagga
CFGPREFIX= /usr
CFGLOCALSTATEDIR=/var/run/quagga
CFGINFODIR= $(CFGSFWINFO)
CFGMANDIR= $(CFGSFWMAN)
CFGINCLUDEDIR= $(CFGSFWINCLUDE)
CFGLIBDIR= $(CFGSFWLIB)
# GNU compatible install is needed by auto* and provided with Quagga
INSTALL=../$(SRCDIR)/install-sh
#CC=cc
CPPFLAGS += -I /usr/sfw/include
LDFLAGS +=-lumem
#Sun SOS8 CFLAGS
CFLAGS += -xspace -Xa -xildoff
#debug
CFLAGS += -g -xdebugformat=dwarf -O
#else optimisation
#CFLAGS += -xO4
CFLAGS += -errtags=yes -xc99=%all
CFLAGS += -erroff=E_TRAILING_COMMA_IN_ENUM
CFLAGS += -erroff=E_STATEMENT_NOT_REACHED
CFLAGS += -erroff=E_EMPTY_TRANSLATION_UNIT
#CFLAGS += -DTEXT_DOMAIN="SUNW_OST_OSCMD"
#CFLAGS += -D_TS_ERRNO
#GCC CFLAGS
#CFLAGS = -g -Os -Wall,packed,padded,sign-compare,pointer-arith
install: all
(cd $(BUILDDIR) ; $(GMAKE) \
install MAKE="$(GMAKE)" DESTDIR="$(ROOT)" ; \
$(SH) ../post-install.sh "$(ROOT)" "$(SRCDIR)")
$(BUILDDIR)/config.status: .prep
(cd $(BUILDDIR); env \
LD_OPTIONS="$(LD_OPTIONS)" \
CC=$(CC) "CFLAGS=$(CFLAGS)" "CPPFLAGS=$(CPPFLAGS)" \
MAKE=$(GMAKE) \
PATH=$(SFW_PATH) \
INSTALL="$(INSTALL) -c" \
../$(SRCDIR)/configure --prefix=$(CFGPREFIX) \
--sysconfdir=$(CFGSYSCONFDIR) \
--localstatedir=$(CFGLOCALSTATEDIR) \
--infodir=$(CFGINFODIR) \
--mandir=$(CFGMANDIR) \
--includedir=$(CFGINCLUDEDIR) \
--libdir=$(CFGLIBDIR) \
--with-tags="" \
--with-cflags="$(CFLAGS)" \
--enable-opaque-lsa \
--enable-isisd --enable-trill --disable-watchquagga \
--enable-ospf6d --enable-ripngd \
--enable-user=root --enable-group=root)
.compile:
(cd $(BUILDDIR); $(GMAKE) \
LD_OPTIONS="$(LD_OPTIONS)" \
CC=$(CC) \
"LDFLAGS=$(LDFLAGS)" \
"CFLAGS=$(CFLAGS)" \
"CPPFLAGS=$(CPPFLAGS)" \
PATH=$(SFW_PATH) \
MAKE=$(GMAKE) \
INSTALL="$(INSTALL) -c" )
touch .compile
packages: install .WAIT
(cd $(BUILDDIR)/solaris; $(GMAKE) MAKE="$(GMAKE)" DESTDIR=$(ROOT) packages)
runconfig: $(BUILDDIR)/config.status
.untar: $(SOURCE)
gzip -dc $(SOURCE) | tar xopf -
touch .untar
.patch: $(PATCHES)
touch .patch
$(BUILDDIR):
mkdir $(BUILDDIR)
.prep: .untar .patch $(BUILDDIR)
touch .prep
prep: .prep
clean:
-$(RM) -r $(SRCDIR) $(BUILDDIR) patches/*.applied .untar .patch .prep .compile
%.patch.applied: %.patch
(cd $(SRCDIR); gpatch -p0 < ../$< && cp ../$< ../$@ && touch ../$@)
include ../Makefile.targ