xref: /libCEED/examples/ceed/Makefile (revision 182fbe45946cf03cf477817c69381239c28d901b)
1*182fbe45STzanio# Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
2*182fbe45STzanio# the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
3*182fbe45STzanio# reserved. See files LICENSE and NOTICE for details.
4*182fbe45STzanio#
5*182fbe45STzanio# This file is part of CEED, a collection of benchmarks, miniapps, software
6*182fbe45STzanio# libraries and APIs for efficient high-order finite element and spectral
7*182fbe45STzanio# element discretizations for exascale applications. For more information and
8*182fbe45STzanio# source code availability see http://github.com/ceed.
9*182fbe45STzanio#
10*182fbe45STzanio# The CEED research is supported by the Exascale Computing Project 17-SC-20-SC,
11*182fbe45STzanio# a collaborative effort of two U.S. Department of Energy organizations (Office
12*182fbe45STzanio# of Science and the National Nuclear Security Administration) responsible for
13*182fbe45STzanio# the planning and preparation of a capable exascale ecosystem, including
14*182fbe45STzanio# software, applications, hardware, advanced system engineering and early
15*182fbe45STzanio# testbed platforms, in support of the nation's exascale computing imperative.
16*182fbe45STzanio
17*182fbe45STzanio# Ceed directory
18*182fbe45STzanioCEED_DIR ?= ../..
19*182fbe45STzanioCEED_FLAGS ?= -I$(CEED_DIR)/include -std=c99
20*182fbe45STzanioCEED_LIBS ?= -Wl,-rpath,$(abspath $(CEED_DIR)/lib) -L$(CEED_DIR)/lib -lceed -lm
21*182fbe45STzanio
22*182fbe45STzanioEXAMPLES.c = $(wildcard ex*.c)
23*182fbe45STzanioEXAMPLES = $(EXAMPLES.c:%.c=%)
24*182fbe45STzanio
25*182fbe45STzanio.SUFFIXES:
26*182fbe45STzanio.SUFFIXES: .c
27*182fbe45STzanio.PHONY: all clean
28*182fbe45STzanio
29*182fbe45STzanioall: $(EXAMPLES)
30*182fbe45STzanio
31*182fbe45STzanio# Remove built-in rules
32*182fbe45STzanio%: %.c
33*182fbe45STzanio
34*182fbe45STzanio# Rules for building the examples
35*182fbe45STzanio%: %.c okl-lib-cache
36*182fbe45STzanio	$(LINK.c) $(CEED_FLAGS) $< -o $@ $(CEED_LIBS)
37*182fbe45STzanio
38*182fbe45STzanio# okl-lib-cache depending on OCCA and INSTALL
39*182fbe45STzaniookl-lib-cache:
40*182fbe45STzanio# First test to see if libceed was compiled with OCCA
41*182fbe45STzanioifneq ($(wildcard $(OCCA_DIR)/lib/libocca.*),)
42*182fbe45STzanio# Second test to see if '../..' is CEED_DIR
43*182fbe45STzanioifneq ($(CEED_DIR),../..)
44*182fbe45STzaniookl-lib-cache:
45*182fbe45STzanio	$(OCCA_DIR)/bin/occa cache ceed $(abspath $(CEED_DIR)/lib/okl/*.okl)
46*182fbe45STzanioendif
47*182fbe45STzanioendif
48*182fbe45STzanio
49*182fbe45STzanioclean:
50*182fbe45STzanio	rm -f *~ $(EXAMPLES)
51*182fbe45STzanio	rm -rf *.dSYM *.TVD.*breakpoints
52