aboutgitcodelistschat:MatrixIRC
path: root/Makefile
blob: 8b93e062f162b2c0883d925dee0884fe54aece59 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# SPDX-License-Identifier: GPL-2.0-or-later
#
# seitan - Syscall Expressive Interpreter, Transformer and Notifier
#
# Copyright 2023 Red Hat GmbH
# Authors: Alice Frosi <afrosi@redhat.com>
#	   Stefano Brivio <sbrivio@redhat.com>

DIR := $(shell pwd)
OUTDIR ?= $(DIR)
export OUTDIR

COMMON_DIR := $(DIR)/common
BIN := $(OUTDIR)/seitan
SRCS := seitan.c $(COMMON_DIR)/common.c $(COMMON_DIR)/util.c  operations.c cooker/calls.c $(wildcard cooker/calls/*.c)
HEADERS := $(COMMON_DIR)/common.h $(COMMON_DIR)/gluten.h \
	   $(COMMON_DIR)/util.h operations.h

CFLAGS += -DTMP_DATA_SIZE=1000
CFLAGS += -Wall -Wextra -pedantic -std=c99 -I$(COMMON_DIR) -g

all: cooker eater seitan demo

.PHONY: cooker
cooker:
	$(MAKE) -C cooker

.PHONY: eater
eater:
	$(MAKE) -C eater

.PHONY: seitan
seitan: $(SRCS) $(HEADERS)
	$(CC) $(CFLAGS) -o $(BIN) $(SRCS)

.PHONY: debug
debug:
	$(MAKE) -C debug

.PHONY: demo
demo:
	$(MAKE) -C demo

.PHONY: clean
clean:
	rm -f $(BIN)
	$(MAKE) -C cooker clean
	$(MAKE) -C eater clean
	$(MAKE) -C debug clean
	$(MAKE) -C demo clean

numbers.h:
	./scripts/nr_syscalls.sh

test-unit:
	$(MAKE) -C tests/unit

# TODO: remove the build binary when cooker is ready
build-test-images: seitan eater
	$(MAKE) -C tests-utils
	$(MAKE) -C debug build
	./build test.bpf
	sudo podman build -t test-seitan -f containerfiles/tests/seitan/Containerfile .
	sudo podman build -t test-eater -f containerfiles/tests/eater/Containerfile .

test-integration:
	python -m pytest tests/integration/seitan_containers.py