Makefile revision c13de8f6a88563211bd4432ca11ca38ed3bf0fc0
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock#
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock# CDDL HEADER START
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock#
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock# The contents of this file are subject to the terms of the
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock# Common Development and Distribution License (the "License").
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock# You may not use this file except in compliance with the License.
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock#
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock# or http://www.opensolaris.org/os/licensing.
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock# See the License for the specific language governing permissions
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock# and limitations under the License.
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock#
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock# When distributing Covered Code, include this CDDL HEADER in each
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock# If applicable, add the following below this CDDL HEADER, with the
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock# fields enclosed by brackets "[]" replaced with your own identifying
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock# information: Portions Copyright [yyyy] [name of copyright owner]
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock#
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock# CDDL HEADER END
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock#
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock#
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock# Use is subject to license terms.
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock#
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock# ident "%Z%%M% %I% %E% SMI"
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock#
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockPROG= file
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockXPG4PROG= file
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockMAGIC= magic
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockELFCAP= $(SRC)/common/elfcap
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockSGSRTCID= $(SRC)/common/sgsrtcid
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockLOBJS= file.o magicutils.o
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockOBJS= $(LOBJS) elfcap.o
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockXPG4OBJS= $(OBJS:%.o=xpg4_%.o)
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockSRCS= $(LOBJS:%.o=%.c) $(ELFCAP)/elfcap.c
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockinclude ../Makefile.cmd
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockPOFILE= file_all.po
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockPOFILES= $(LOBJS:%.o=%.po)
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockLDLIBS += -lelf
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockCPPFLAGS += -DCAP_UPPERCASE -I$(ELFCAP) -I$(SGSRTCID)
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock$(XPG4) := CFLAGS += -DXPG4
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrockROOTETCMAGIC= $(MAGIC:%=$(ROOTETC)/%)
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock$(ROOTETCMAGIC) := FILEMODE = $(LIBFILEMODE)
.PARALLEL: $(OBJS) $(XPG4OBJS) $(POFILES)
.KEEP_STATE:
all: $(PROG) $(XPG4) $(MAGIC)
$(PROG) : $(OBJS)
$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
$(POST_PROCESS)
$(XPG4) : $(XPG4OBJS)
$(LINK.c) $(XPG4OBJS) -o $@ $(LDLIBS)
$(POST_PROCESS)
xpg4_%.o: %.c
$(COMPILE.c) -o $@ $<
elfcap.o: $(ELFCAP)/elfcap.c
$(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
xpg4_elfcap.o: $(ELFCAP)/elfcap.c
$(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
$(POFILE): $(POFILES)
$(RM) $@
cat $(POFILES) > $@
install: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTETCMAGIC)
clean:
$(RM) $(OBJS) $(XPG4OBJS)
lint: lint_SRCS
include ../Makefile.targ