I'm not referring to CAF for a long time, but I'll try to help you. This is a simple Makefile to build your test programs:
CC=clang++
INCLUDE=/your/path/to/caf/inludes
LIBS=/your/path/to/caf/libs
CFLAGS=-c -DDEBUG -g -std=c++17 -stdlib=libc++ -Wextra -Wall -pedantic $(INCLUDE)
LDFLAGS=-lpthread -lc++ -lc++abi -lcaf_core
SOURCES=$(shell echo *.cpp)
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=name_of_your_elf
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LIBS) $(LDFLAGS) $(OBJECTS) -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@
clean:
rm -rf $(EXECUTABLE) *.o
If you already built CAF, set up both INCLUDE and LIBS variables, and of course a name of your executable file (EXECUTABLE). Then run
make all in the directory containing your source file (main.cpp for example). Replace the CC value with gcc instead of clang if you need, you can play with the compilation flags as well, for example, remove libc++ library or just install llvm (
https://apt.llvm.org/).