From 75bb42663294b388377178b7257c6f8c0f787032 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 29 Aug 2021 21:18:03 +0200 Subject: KVM stuff --- Makefile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 35af12f..391e641 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,28 @@ -SOURCEDIR = src -INCDIR = inc -BUILDDIR = build +SOURCEDIR = $(PWD)/src +INCDIR = $(PWD)/inc +BUILDDIR = $(PWD)/build SOURCES = $(wildcard $(SOURCEDIR)/*.c) OBJS = $(patsubst $(SOURCEDIR)/%.c, $(BUILDDIR)/%.o, $(SOURCES)) CC = gcc WARNINGS = -Wall -Wextra -Wshadow -Wpointer-arith -Wwrite-strings -Wredundant-decls -Wnested-externs -Wformat=2 -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wswitch-default -Wswitch-enum -Wlogical-op -Wunreachable-code -Wundef -Wold-style-definition -Wvla -pedantic -DEBUG = -fsanitize=undefined -fsanitize=address -ggdb3 -g3 -g -s -Og +DEBUG = -fsanitize=undefined -fsanitize=address -fstack-protector-strong -ggdb3 -g3 -g -s -Og CFLAGS = -Ofast $(WARNINGS) -I$(INCDIR) $(DEBUG) all: $(OBJS) - @$(CC) -o ./$(BUILDDIR)/out $^ $(CFLAGS) + @$(CC) -o $(BUILDDIR)/out $(CFLAGS) $^ clean: @$(RM) -rf $(BUILDDIR) -run: clean all - @./$(BUILDDIR)/out +run: clean all sync + @nasm test.asm -o $(BUILDDIR)/test + @$(BUILDDIR)/out + +sync: + @make --always-make --dry-run | grep -wE 'gcc|g\+\+' | grep -w '\-c' | jq -nR '[inputs|{directory:".", command:., file: match(" [^ ]+$$").string[1:]}]' >compile_commands.json + @ctags -R --exclude=.git --exclude=build . $(BUILDDIR)/%.o: $(SOURCEDIR)/%.c @mkdir -p $(BUILDDIR) - @$(CC) -c -o $@ $< $(CFLAGS) + @$(CC) -c -o $@ $(CFLAGS) $< -- cgit v1.2.3