First commit!
This commit is contained in:
5
.dir-locals.el
Normal file
5
.dir-locals.el
Normal file
@@ -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))))
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build/
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -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.
|
||||
41
Makefile
Normal file
41
Makefile
Normal file
@@ -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)
|
||||
20
src/main.cpp
Normal file
20
src/main.cpp
Normal file
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user