Makefile revision 7014882c6a3672fd0e5d60200af8643ae53c5928
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# CDDL HEADER START
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# The contents of this file are subject to the terms of the
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# Common Development and Distribution License (the "License").
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# You may not use this file except in compliance with the License.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# or http://www.opensolaris.org/os/licensing.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# See the License for the specific language governing permissions
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# and limitations under the License.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# When distributing Covered Code, include this CDDL HEADER in each
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# If applicable, add the following below this CDDL HEADER, with the
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# fields enclosed by brackets "[]" replaced with your own identifying
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# information: Portions Copyright [yyyy] [name of copyright owner]
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# CDDL HEADER END
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes#
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes# Use is subject to license terms.
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes#
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesPROG= file
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesXPG4PROG= file
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesMAGIC= magic
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesELFCAP= $(SRC)/common/elfcap
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesSGSRTCID= $(SRC)/common/sgsrtcid
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesLOBJS= file.o elf_read32.o elf_read64.o magicutils.o
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesOBJS= $(LOBJS) elfcap.o
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesXPG4OBJS= $(OBJS:%.o=xpg4_%.o)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesSRCS= file.c elf_read.c magicutils.c $(ELFCAP)/elfcap.c
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesinclude ../Makefile.cmd
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
9558e9fdb620dd6f42ca93beac6c3ab734086706bnicholesCERRWARN += -_gcc=-Wno-uninitialized
9558e9fdb620dd6f42ca93beac6c3ab734086706bnicholesCERRWARN += -_gcc=-Wno-type-limits
9558e9fdb620dd6f42ca93beac6c3ab734086706bnicholes
9558e9fdb620dd6f42ca93beac6c3ab734086706bnicholesPOFILE= file_all.po
9558e9fdb620dd6f42ca93beac6c3ab734086706bnicholesPOFILES= $(SRCS:%.c=%.po)
9558e9fdb620dd6f42ca93beac6c3ab734086706bnicholes
9558e9fdb620dd6f42ca93beac6c3ab734086706bnicholes# The debug binary can be built using the flag
9558e9fdb620dd6f42ca93beac6c3ab734086706bnicholes# -D COPTFLAG=-g CGLOBALSTATIC=
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# This will avoid the multiple symbols definition error
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes# for static global variables in elf_read32.o and elf_read64.o
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesLDLIBS += -lelf
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesCPPFLAGS += -I$(ELFCAP) -I$(SGSRTCID)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes$(XPG4) := CFLAGS += -DXPG4
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesROOTETCMAGIC= $(MAGIC:%=$(ROOTETC)/%)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes$(ROOTETCMAGIC) := FILEMODE = $(LIBFILEMODE)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes.PARALLEL: $(OBJS) $(XPG4OBJS) $(POFILES)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes.KEEP_STATE:
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesall: $(PROG) $(XPG4) $(MAGIC)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes$(PROG) : $(OBJS)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(POST_PROCESS)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes$(XPG4) : $(XPG4OBJS)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(LINK.c) $(XPG4OBJS) -o $@ $(LDLIBS)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(POST_PROCESS)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes%.o: %.c
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(COMPILE.c) -o $@ $<
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes%32.o: %.c
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(COMPILE.c) -o $@ $<
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes%64.o: %.c
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(COMPILE.c) -D_ELF64 -o $@ $<
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesxpg4_%.o: %.c
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(COMPILE.c) -o $@ $<
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesxpg4_%32.o: %.c
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(COMPILE.c) -o $@ $<
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesxpg4_%64.o: %.c
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(COMPILE.c) -D_ELF64 -o $@ $<
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholeselfcap.o: $(ELFCAP)/elfcap.c
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesxpg4_elfcap.o: $(ELFCAP)/elfcap.c
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes$(POFILE): $(POFILES)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(RM) $@
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes cat $(POFILES) > $@
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesinstall: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTETCMAGIC)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesclean:
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes $(RM) $(OBJS) $(XPG4OBJS)
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholeslint: lint_SRCS
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholesinclude ../Makefile.targ
d5b12fe8ae917e654a33247fd4e59dc9e75170aebnicholes