aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.dir-locals.el5
-rw-r--r--.gitignore1
-rw-r--r--LICENSE21
-rw-r--r--Makefile41
-rw-r--r--src/main.cpp20
5 files changed, 88 insertions, 0 deletions
diff --git a/.dir-locals.el b/.dir-locals.el
new file mode 100644
index 0000000..7490d85
--- /dev/null
+++ b/.dir-locals.el
@@ -0,0 +1,5 @@
+;;; Directory Local Variables -*- no-byte-compile: t; -*-
+;;; For more information see (info "(emacs) Directory Variables")
+
+((nil . ((+license/license-choice . "MIT")))
+ (c++-mode . ((mode . clang-format))))
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..84c048a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/build/
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..fb0f61e
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2024 Aryadev Chavali
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE. \ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..13ab15e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,41 @@
+CC=g++
+CFLAGS=-Wall -Wextra -Werror -Wswitch-enum -ggdb -fsanitize=address -fsanitize=undefined -std=c++17
+LIBS=
+
+ARGS=
+OUT=main.out
+
+SRC=src
+DIST=build
+CODE=$(addprefix $(SRC)/, ) # add source files here
+OBJECTS=$(CODE:$(SRC)/%.cpp=$(DIST)/%.o)
+DEPDIR:=$(DIST)/dependencies
+DEPFLAGS=-MT $@ -MMD -MP -MF
+DEPS:=$(CODE:$(SRC)/%.cpp=$(DEPDIR):%.d) $(DEPDIR)/main.d
+
+.PHONY: all
+all: $(OUT)
+
+$(OUT): $(DIST)/$(OUT)
+
+$(DIST)/$(OUT): $(OBJECTS) $(DIST)/main.o | $(DIST)
+ $(CC) $(CFLAGS) $^ -o $@ $(LIBS)
+
+$(DIST)/%.o: $(SRC)/%.cpp | $(DIST) $(DEPDIR)
+ $(CC) $(CFLAGS) $(DEPFLAGS) $(DEPDIR)/$*.d -c $< -o $@ $(LIBS)
+
+.PHONY: run
+run: $(DIST)/$(OUT)
+ ./$^ $(ARGS)
+
+.PHONY:
+clean:
+ rm -rfv $(DIST)/*
+
+$(DIST):
+ mkdir -p $(DIST)
+
+$(DEPDIR):
+ mkdir -p $(DEPDIR)
+
+-include $(DEPS)
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 0000000..1c5912b
--- /dev/null
+++ b/src/main.cpp
@@ -0,0 +1,20 @@
+/* Copyright (C) 2024 Aryadev Chavali
+
+ * You may distribute and modify this code under the terms of the MIT
+ * license. You should have received a copy of the MIT license with
+ * this file. If not, please write to: aryadev@aryadevchavali.com.
+
+ * Created: 2024-05-08
+ * Author: Aryadev Chavali
+ * Description: Entrypoint
+ */
+
+#include <iostream>
+
+using std::cout, std::endl;
+
+int main(void)
+{
+ cout << "Hello, world!" << endl;
+ return 0;
+}