Makefile revision 252
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# U.S. Government Rights - Commercial software. Government users are subject
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# to the Sun Microsystems, Inc. standard license agreement and applicable
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# provisions of the FAR and its supplements.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# This distribution may include materials developed by third parties. Sun,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Sun Microsystems, the Sun logo and Solaris are trademarks or registered
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# Makefile to generate libseaExtensions.so
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# usage:
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# "make" : generate library for 64bit / sparc
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# "make ARCH=32" : generate library for 32bit / sparc
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes# "make ARCH=32 MACH=x86" : generate library for 32bit / x86
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes# "make ARCH=amd64" : generate 64bit AMD64 libraries
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes# "make clean" : remove *.o , *.so
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes#
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesMARCH=$(ARCH)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLDFLAGS_sparcv9=-m64 -I$(ROOT)$(CFGPREFIX)/include -I.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLDFLAGS_32=-I$(ROOT)$(CFGPREFIX)/include -I.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLDFLAGS_amd64=-Kpic -m64 -I$(ROOT)$(CFGPREFIX)/include -I.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLDFLAGS=$(LDFLAGS_$(MARCH))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesCFLAGS_32=-Kpic
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesCFLAGS_sparcv9=-Kpic
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesCFLAGS_amd64=-Kpic
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesCFLAGS=$(CFLAGS_$(MARCH))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLDLIBS_sparcv9= -L/usr/lib/sparcv9 -lrpcsvc
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLDLIBS_32= -lrpcsvc
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLDLIBS_amd64 = -L/usr/lib/amd64 -lrpcsvc
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLDLIBS=$(LDLIBS_$(MARCH))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesPROG= libseaExtensions.so
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesSRCS= sunHostPerf.c sunProcesses.c sunSystem.c seaExtensions.c
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesOBJS = $(SRCS:.c=.o)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesall:$(PROG)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes$(PROG): $(OBJS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -G -o $@ $(OBJS)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes.c.o:
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes $(CC) $(CFLAGS) $(LDFLAGS) -g -o $@ -c $<
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesclean:
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes rm -f *.o *.so
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesinstall:
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes if test "$(ARCH)" = "sparcv9" ; then \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes cp $(PROG) $(ROOT)/$(CFGLIB64); \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes elif test "$(ARCH)" = "32" ; then \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes cp $(PROG) $(ROOT)/$(CFGLIB); \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes elif test "$(ARCH)" = "amd64" ; then \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes cp $(PROG) $(ROOT)/$(CFGLIB64); \
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes fi
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes