aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-10-23 04:30:50 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-10-23 04:46:09 +0100
commit42ac28d44ac7e1f102e9ba37fa91923e822e47df (patch)
treed400f2af604ff37453f7d8e357b368e63ff74f78
parent0ac634a9bec04934398a431bfc1b9a7a27561f0c (diff)
downloadovm-42ac28d44ac7e1f102e9ba37fa91923e822e47df.tar.gz
ovm-42ac28d44ac7e1f102e9ba37fa91923e822e47df.tar.bz2
ovm-42ac28d44ac7e1f102e9ba37fa91923e822e47df.zip
Make root directory an include path, set #include's properly
Easier to write includes now just using < with the module name, in comparison to using relative paths.
-rw-r--r--.dir-locals.el9
-rw-r--r--Makefile2
-rw-r--r--examples/fib.c4
-rw-r--r--vm/inst.h4
-rw-r--r--vm/runtime.h1
5 files changed, 11 insertions, 9 deletions
diff --git a/.dir-locals.el b/.dir-locals.el
index e942583..02fbd7a 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -1,6 +1,9 @@
;;; Directory Local Variables -*- no-byte-compile: t -*-
;;; For more information see (info "(emacs) Directory Variables")
-((nil . ((projectile-project-compilation-cmd . "make")
- (projectile-project-configure-cmd . "make clean")
- (+license/license-choice . "GPLv2"))))
+((nil . ((projectile-project-compilation-cmd . "make")
+ (projectile-project-configure-cmd . "make clean")
+ (+license/license-choice . "GPLv2")))
+ (c-mode . ((flycheck-gcc-include-path . (".."))
+ (flycheck-clang-include-path . (".."))
+ (company-clang-arguments . ("-I..")))))
diff --git a/Makefile b/Makefile
index bd3cdff..2ca4781 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
CC=gcc
-GENERAL-FLAGS=-Wall -Wextra -Werror -Wswitch-enum -std=c11
+GENERAL-FLAGS=-Wall -Wextra -Werror -Wswitch-enum -std=c11 -I.
DEBUG-FLAGS=-ggdb -fsanitize=address
RELEASE-FLAGS=-O3
CFLAGS:=$(GENERAL-FLAGS) $(DEBUG-FLAGS)
diff --git a/examples/fib.c b/examples/fib.c
index 17a9ef8..c059ff9 100644
--- a/examples/fib.c
+++ b/examples/fib.c
@@ -15,8 +15,8 @@
#include <stdio.h>
#include <string.h>
-#include "../vm/inst.h"
-#include "../vm/runtime.h"
+#include <vm/inst.h>
+#include <vm/runtime.h>
int main(void)
{
diff --git a/vm/inst.h b/vm/inst.h
index 5882e4f..935f722 100644
--- a/vm/inst.h
+++ b/vm/inst.h
@@ -16,8 +16,8 @@
#include <stdio.h>
#include <stdlib.h>
-#include "../lib/base.h"
-#include "../lib/darr.h"
+#include <lib/base.h>
+#include <lib/darr.h>
typedef enum
{
diff --git a/vm/runtime.h b/vm/runtime.h
index 03cd21f..316b4c6 100644
--- a/vm/runtime.h
+++ b/vm/runtime.h
@@ -16,7 +16,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include "../lib/base.h"
#include "./inst.h"
typedef enum