From 82b77505f9420f11d614c2ae0f74153ca4ee3cb5 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Tue, 2 May 2023 09:48:50 +0200 Subject: cooker updates spilling all over the place Only tangentially related: - make seitan C99 again, so that I can build cooker without warnings - make Makefiles make use of the usual conventions about assigning directory paths in variables, drop numbers.h as requirement for cooker and make it convenient to run stand-alone Makefiles - fix up nr_syscalls.sh to be POSIX, otherwise it will give syntax errors on my system - define a single, common way to refer to offsets in gluten, and functions to use those offsets in a safe way. Immediates are gone: cooker will write any bit of "data" to the read-only section - call const what has to be const - define on-disk layout for gluten - add OP_NR (to check syscall numbers), rename OP_COPY_ARGS to OP_LOAD (it loads _selected_ stuff from arguments) As for cooker itself: - drop ARG_ and arg_ prefixes from struct names, and similar - add/rework functions to build OP_NR, OP_LOAD, OP_CMP, and to write constant data to gluten - add parsing for "compound" arguments, but that's not completely hooked into evaluation for numeric arguments yet Signed-off-by: Stefano Brivio --- cooker/Makefile | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'cooker/Makefile') diff --git a/cooker/Makefile b/cooker/Makefile index 4f72448..be8f703 100644 --- a/cooker/Makefile +++ b/cooker/Makefile @@ -5,31 +5,25 @@ # cooker/Makefile - Makefile for seitan-cooker # # Copyright 2023 Red Hat GmbH -# Author: Stefano Brivio +# Authors: Alice Frosi +# Stefano Brivio -COMMON_DIR := ../common -SRCS := calls.c emit.c filter.c gluten.c main.c parse.c parson.c \ - $(COMMON_DIR)/util.c calls/net.c -HEADERS := calls.h cooker.h emit.h filter.h \ - gluten.h parse.h parson.h calls/net.h \ - $(COMMON_DIR)/util.h -BIN := $(OUTDIR)seitan-cooker +OUTDIR ?= .. +COMMON := ../common +BIN := $(OUTDIR)/seitan-cooker +CFLAGS := -O0 -g -Wall -Wextra -pedantic -std=c99 -I$(COMMON) -TARGET := $(shell $(CC) -dumpmachine) -TARGET_ARCH := $(shell echo $(TARGET) | cut -f1 -d- | tr [A-Z] [a-z]) -TARGET_ARCH := $(shell echo $(TARGET_ARCH) | sed 's/powerpc/ppc/') +SRCS := calls.c emit.c gluten.c main.c parse.c parson.c \ + $(COMMON)/util.c \ + calls/net.c +HEADERS := calls.h cooker.h emit.h gluten.h parse.h parson.h \ + $(COMMON)/gluten.h $(COMMON)/util.h \ + calls/net.h -AUDIT_ARCH := $(shell echo $(TARGET_ARCH) | tr [a-z] [A-Z] | sed 's/^ARM.*/ARM/') -AUDIT_ARCH := $(shell echo $(AUDIT_ARCH) | sed 's/I[456]86/I386/') -AUDIT_ARCH := $(shell echo $(AUDIT_ARCH) | sed 's/PPC64/PPC/') -AUDIT_ARCH := $(shell echo $(AUDIT_ARCH) | sed 's/PPCLE/PPC64LE/') - -CFLAGS += -DSEITAN_AUDIT_ARCH=AUDIT_ARCH_$(AUDIT_ARCH) -CFLAGS += -O0 -g -Wall -Wextra -pedantic -std=c99 -I$(COMMON_DIR) -cooker: $(SRCS) $(HEADERS) +$(BIN): $(SRCS) $(HEADERS) $(CC) $(CFLAGS) -o $(BIN) $(SRCS) -all: cooker +all: $(BIN) clean: - rm -f cooker + rm -f $(BIN) -- cgit v1.2.3