Makefile revision 7adeeb5aeae42d3b6a4686f45f1fcd4a78b5a459
443N/A#
443N/A# CDDL HEADER START
443N/A#
598N/A# The contents of this file are subject to the terms of the
443N/A# Common Development and Distribution License, Version 1.0 only
443N/A# (the "License"). You may not use this file except in compliance
443N/A# with the License.
443N/A#
443N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
443N/A# or http://www.opensolaris.org/os/licensing.
443N/A# See the License for the specific language governing permissions
443N/A# and limitations under the License.
443N/A#
443N/A# When distributing Covered Code, include this CDDL HEADER in each
443N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
443N/A# If applicable, add the following below this CDDL HEADER, with the
443N/A# fields enclosed by brackets "[]" replaced with your own identifying
443N/A# information: Portions Copyright [yyyy] [name of copyright owner]
443N/A#
443N/A# CDDL HEADER END
443N/A#
443N/A#
443N/A# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
443N/A# Use is subject to license terms.
443N/A#
443N/A#ident "%Z%%M% %I% %E% SMI"
443N/A
443N/APROG= getconf
443N/AXPG4PROG= getconf
443N/AXPG6PROG= getconf
443N/AX4= objs.xpg4
443N/AX6= objs.xpg6
443N/AOBJS= getconf.o
443N/AXPG4EXOBJS= $(X4)/getconf.o
443N/AXPG6EXOBJS= $(X6)/getconf.o
443N/A
443N/Ainclude ../Makefile.cmd
443N/A
443N/AXPG4EXOBJS += values-xpg4.o
443N/ACFLAGS += $(CCVERBOSE)
443N/A# XPG4
443N/A$(XPG4) := CFLAGS += -D_XOPEN_SOURCE -I$(SRC)/lib/libc/inc
443N/A
443N/A# XPG6MODE: Depending on the version of the compiler, the value of
443N/A# __STDC_VERSION__ may differ even in the presence of the same compilation
443N/A# options. The default compilation mode for Sun compilers that support the
443N/A# C99 standard is -xc99=all,no_lib. C99MODE= is equivalent to -xc99=all,no_lib.
443N/A# This translates to C99 semantics without the C99 library specific behaviors
443N/A# and dependencies.
443N/A#
443N/A# For pre-5.7 compilers (unless patched with 117551-04 or 117552-05), in the
443N/A# default compilation mode, __STDC_VERSION__ was defined to be 199901L. For
443N/A# 5.7 and on compilers, __STDC_VERSION__ defaults to 199409L in order to
443N/A# maintain source compatibility. Neither of these cases results in the
443N/A# importing of /usr/lib/values-xpg6.o, so we need to either manually import
443N/A# it via linking with a local version of the object, or set -xc99=%all which
443N/A# by default imports /usr/lib/values-xpg6.o. C99MODE=C99_ENABLE is equivalent
598N/A# to -xc99=all. If C99_ENABLE is defined and we also attempt to link with a
443N/A# local version of values-xpg6.o, an error will occur due to multiple
443N/A# definitions for __xpg4 and __xpg6. Because /usr/lib/values-xpg6.o was
443N/A# delivered in Solaris 10 and is a stable interface, there is no need to
443N/A# build and link with a local version of the object.
443N/A#
443N/A# The gcc compiler behaves differently and requires -std=gnu99.
443N/A#
443N/A# For XPG4, we need to link with a local version of values-xpg4.o because
443N/A# the compiler only imports this by default (from /usr/lib/values-xpg4.o)
443N/A# if we use the c89 utility as opposed to cc.
443N/A
443N/AXPG6MODE = $(C99_ENABLE)
443N/A$(XPG6) := C99MODE = $(XPG6MODE)
443N/A$(XPG6) := CFLAGS += -D_XOPEN_SOURCE=600 -I$(SRC)/lib/libc/inc
598N/A
598N/A.KEEP_STATE:
598N/A
598N/Aall: $(PROG) $(XPG4) $(XPG6)
598N/A
598N/A$(PROG): $(OBJS)
598N/A $(LINK.c) -o $@ $(OBJS) $(LDLIBS)
598N/A $(POST_PROCESS)
598N/A
598N/A$(XPG4): $(X4) $(XPG4EXOBJS)
598N/A $(LINK.c) -o $@ $(XPG4EXOBJS) $(LDLIBS)
598N/A $(POST_PROCESS)
598N/A
598N/A$(XPG6): $(X6) $(XPG6EXOBJS)
598N/A $(LINK.c) -o $@ $(XPG6EXOBJS) $(LDLIBS)
598N/A $(POST_PROCESS)
598N/A
443N/A
$(XPG4EXOBJS): $(X4)
$(X4)/%.o: %.c
$(COMPILE.c) -o $@ $<
$(X4):
-@mkdir -p $@
$(XPG6EXOBJS): $(X6)
$(X6)/%.o: %.c
$(COMPILE.c) -o $@ $<
$(X6):
-@mkdir -p $@
install: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTXPG6PROG)
values-xpg4.o: ../../lib/common/common/values-xpg4.c
$(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
clean:
-@rm -rf $(OBJS) $(XPG4EXOBJS) $(XPG6EXOBJS) $(X4) $(X6) \
$(PROG) $(XPG4) $(XPG6)
lint: lint_PROG
include ../Makefile.targ