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