diff options
author | Marvin Borner | 2021-08-29 21:18:03 +0200 |
---|---|---|
committer | Marvin Borner | 2021-08-29 21:18:03 +0200 |
commit | 75bb42663294b388377178b7257c6f8c0f787032 (patch) | |
tree | 0371bf7570ee85ada4ab6dfc98e6ffe9098cef16 /Makefile | |
parent | eef250dd4a0ae185a8d9d668f020b2ab5c2f4849 (diff) |
KVM stuff
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -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) $< |