Skip to content

Commit af83de8

Browse files
author
Allen MacFarland
committed
add makefile
1 parent 8c8bef2 commit af83de8

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

examples/rust-qfunctions/Makefile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright (c) 2017-2025, Lawrence Livermore National Security, LLC and other CEED contributors
2+
# All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3+
#
4+
# SPDX-License-Identifier: BSD-2-Clause
5+
#
6+
# This file is part of CEED: http://github.com/ceed
7+
8+
OPT ?= -O -g
9+
10+
# Ceed directory
11+
CEED_DIR ?= ../..
12+
CEED_FLAGS ?= -I$(CEED_DIR)/include -std=c11 $(OPT)
13+
CEED_LIBS ?= -Wl,-rpath,$(abspath $(CEED_DIR)/lib) -L$(CEED_DIR)/lib -lceed -L$(CEED_DIR)/examples/ceed -lm
14+
15+
EXAMPLES.c = $(wildcard ex*.c)
16+
EXAMPLES = $(EXAMPLES.c:%.c=%)
17+
18+
.SUFFIXES:
19+
.SUFFIXES: .c
20+
.PHONY: all clean
21+
22+
all: $(EXAMPLES)
23+
24+
# Remove built-in rules
25+
%: %.c
26+
27+
# Special build rule for example 1 (rust)
28+
ex1-volume: ex1-volume.c
29+
cargo +nightly build --release --manifest-path ex1-volume-rs/Cargo.toml --config ex1-volume-rs/.cargo/config.toml
30+
$(LINK.c) $(CEED_FLAGS) $(CEED_LDFLAGS) $< -o $@ $(CEED_LIBS) -L$(CEED_DIR)/examples/rust-qfunctions/ex1-volume-rs/target/release -lex1_volume_rs
31+
32+
clean:
33+
rm -f *~ $(EXAMPLES)
34+
rm -rf *.dSYM *.TVD.*breakpoints

0 commit comments

Comments
 (0)