summaryrefslogtreecommitdiff
path: root/makefile
blob: 0d59a97e23e9744a2846d1ef0f516b1e5a21500a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
CPP_ARGS = -std=c++20 -O2 -Wall -Wextra -Iinclude -ggdb

GTKMM_CPP_ARGS = $(shell pkg-config --cflags gtkmm-4.0)
GTKMM_LD_ARGS = $(shell pkg-config --libs gtkmm-4.0)

# https://github.com/open-mpi/ompi/issues/5157
MPI_CPP_ARGS = $(shell mpic++ --showme:compile) -DOMPI_SKIP_MPICXX
MPI_LD_ARGS = $(shell mpic++ --showme:link)

default: bin/bench bin/tabulator-mpi

clean:
	rm -r obj bin

bin/bench: obj/bench/main.o obj/bench/bench_window.o obj/bench/core_widget.o obj/lib94.o
	@mkdir -p $(dir $@)
	g++ ${CPP_ARGS} $^ ${GTKMM_LD_ARGS} -o $@

bin/tabulator-mpi: obj/tabulator-mpi/main.o obj/tabulator-mpi/head.o obj/tabulator-mpi/worker.o obj/lib94.o
	@mkdir -p $(dir $@)
	g++ ${CPP_ARGS} $^ ${MPI_LD_ARGS} -o $@

obj/lib94.o: obj/lib94/core.o obj/lib94/executors.o obj/lib94/warrior.o
	ld -r $^ -o $@

obj/bench/%.o: bench/%.cpp
	@mkdir -p $(dir $@)
	g++ -c ${CPP_ARGS} ${GTKMM_CPP_ARGS} $^ -o $@

obj/tabulator-mpi/%.o: tabulator-mpi/%.cpp
	@mkdir -p $(dir $@)
	g++ -c ${CPP_ARGS} ${MPI_CPP_ARGS} $^ -o $@

obj/%.o: %.cpp
	@mkdir -p $(dir $@)
	g++ -c ${CPP_ARGS} $^ -o $@