Blame ShmemApps/apps/Makefile

Packit 857059
# BEGIN_ICS_COPYRIGHT8 ****************************************
Packit 857059
# 
Packit 857059
# Copyright (c) 2015-2017, Intel Corporation
Packit 857059
# 
Packit 857059
# Redistribution and use in source and binary forms, with or without
Packit 857059
# modification, are permitted provided that the following conditions are met:
Packit 857059
# 
Packit 857059
#     * Redistributions of source code must retain the above copyright notice,
Packit 857059
#       this list of conditions and the following disclaimer.
Packit 857059
#     * Redistributions in binary form must reproduce the above copyright
Packit 857059
#       notice, this list of conditions and the following disclaimer in the
Packit 857059
#       documentation and/or other materials provided with the distribution.
Packit 857059
#     * Neither the name of Intel Corporation nor the names of its contributors
Packit 857059
#       may be used to endorse or promote products derived from this software
Packit 857059
#       without specific prior written permission.
Packit 857059
# 
Packit 857059
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Packit 857059
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit 857059
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Packit 857059
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
Packit 857059
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit 857059
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Packit 857059
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Packit 857059
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Packit 857059
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit 857059
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit 857059
# 
Packit 857059
# END_ICS_COPYRIGHT8   ****************************************
Packit 857059
Packit 857059
# Makefile for SHMEM application/benchmark source for end user system
Packit 857059
# targets:
Packit 857059
#	full	- build all targets.
Packit 857059
#	quick	- build commonly used apps.
Packit 857059
#	all		- synonym for quick
Packit 857059
#	clobber - remove all built files.
Packit 857059
#
Packit 857059
#	The following targets build the matching applications. If the
Packit 857059
#	application name differs from the target name, it is listed
Packit 857059
#	in parens.
Packit 857059
#
Packit 857059
#	HELLO
Packit 857059
#
Packit 857059
Packit 857059
ifndef SHMEM_PREFIX
Packit 857059
SOS_DEVEL_RPM=sandia-openshmem_gcc_hfi-devel
Packit 857059
export SHMEM_PREFIX=$(shell rpm -ql $(SOS_DEVEL_RPM) |grep -e "bin/oshcc" |sed -e "s%/bin/oshcc%%")
Packit 857059
ifeq ($(SHMEM_PREFIX),)
Packit 857059
$(error SHMEM_PREFIX not set)
Packit 857059
endif
Packit 857059
Packit 857059
endif
Packit 857059
Packit 857059
Packit 857059
ifndef SHMEMCC
Packit 857059
export SHMEMCC=$(SHMEM_PREFIX)/bin/oshcc
Packit 857059
endif
Packit 857059
ifndef SHMEM_INCLUDE_DIR
Packit 857059
export SHMEM_INCLUDE_DIR=$(SHMEM_PREFIX)/include
Packit 857059
endif
Packit 857059
ifndef SHMEM_LIB_DIR
Packit 857059
export SHMEM_LIB_DIR=$(SHMEM_PREFIX)/lib64
Packit 857059
endif
Packit 857059
Packit 857059
all:: INCLUDES LIBS CMDS
Packit 857059
.PHONY: all
Packit 857059
Packit 857059
HELLO: SHOWSHMEM
Packit 857059
	@echo "Building SHMEM Hello..."
Packit 857059
	$(SHMEMCC) -I$(SHMEM_INCLUDE_DIR) -o shmem-hello shmem-hello.c;
Packit 857059
	@echo
Packit 857059
.PHONY: HELLO
Packit 857059
Packit 857059
cleandepend clean:: clobber
Packit 857059
.PHONY: cleandepend clean
Packit 857059
Packit 857059
clobber::
Packit 857059
	rm -f shmem-hello shmem-hello.o
Packit 857059
	rm -f .shmem_prefix
Packit 857059
.PHONY: clobber
Packit 857059
Packit 857059
SHOWSHMEM:
Packit 857059
	@echo "Using SHMEM_PREFIX=$(SHMEM_PREFIX)"
Packit 857059
	echo "$(SHMEM_PREFIX)" > .shmem_prefix
Packit 857059
.PHONY: SHOWSHMEM
Packit 857059
Packit 857059
depend::
Packit 857059
force::
Packit 857059
INCLUDES::
Packit 857059
# do the real work during LIBS
Packit 857059
LIBS::
Packit 857059
.PHONY: depend force INCLUDES LIBS
Packit 857059
Packit 857059
quick:: HELLO
Packit 857059
	@echo "Built subset of sample applications"
Packit 857059
.PHONY: quick
Packit 857059
Packit 857059
CMDS:: HELLO
Packit 857059
	@echo "Built sample application"
Packit 857059
.PHONY: CMDS
Packit 857059
Packit 857059
full:: CMDS
Packit 857059
	@echo "Built full set of sample applications"
Packit 857059
.PHONY: full
Packit 857059
Packit 857059
STAGE::
Packit 857059
INSTALL::
Packit 857059
Packit 857059
RUNTEST::
Packit 857059
build_dsfiles::
Packit 857059
clobber_dsfiles::
Packit 857059
lint::
Packit 857059
cflow::
Packit 857059
Packit 857059
.PHONY: STAGE INSTALL RUNTEST build_dsfiles clobber_dsfiles lint cflow