Compare commits
2 Commits
5e9e8d8010
...
739409d3be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
739409d3be | ||
|
|
9d8215bd45 |
@@ -2,5 +2,5 @@
|
||||
;;; For more information see (info "(emacs) Directory Variables")
|
||||
|
||||
((nil . ((+license/license-choice . "GNU General Public License Version 2")
|
||||
(compile-command . "make run")))
|
||||
(compile-command . "sh build.sh")))
|
||||
(c++-mode . ((mode . clang-format))))
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +1,2 @@
|
||||
build/
|
||||
*.out
|
||||
TAGS
|
||||
|
||||
50
Makefile
50
Makefile
@@ -1,50 +0,0 @@
|
||||
CC=g++
|
||||
OUT=cwtree.out
|
||||
LIBS=-lm -lraylib
|
||||
ARGS=
|
||||
|
||||
RELEASE=0
|
||||
GFLAGS=-Wall -Wextra -Wswitch-enum -std=c++17
|
||||
DFLAGS=-ggdb -fsanitize=address -fsanitize=undefined
|
||||
RFLAGS=-O3
|
||||
DEPFLAGS=-MT $@ -MMD -MP -MF
|
||||
|
||||
ifeq ($(RELEASE), 1)
|
||||
CFLAGS=$(GFLAGS) $(RFLAGS)
|
||||
else
|
||||
CFLAGS=$(GFLAGS) $(DFLAGS)
|
||||
endif
|
||||
|
||||
SRC=src
|
||||
DIST=build
|
||||
CODE=$(addprefix $(SRC)/, numerics.cpp) # add source files here
|
||||
OBJECTS=$(CODE:$(SRC)/%.cpp=$(DIST)/%.o)
|
||||
DEPDIR:=$(DIST)/dependencies
|
||||
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)
|
||||
10
build.sh
Normal file
10
build.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -xe
|
||||
|
||||
GFLAGS="-Wall -Wextra -Wswitch-enum -std=c++17"
|
||||
DFLAGS="-ggdb -fsanitize=address -fsanitize=undefined"
|
||||
CFLAGS="$GFLAGS $DFLAGS"
|
||||
LIBS="-lraylib -lm"
|
||||
|
||||
c++ $CFLAGS -o cw_tree.out src/numerics.cpp src/main.cpp $LIBS
|
||||
30
src/main.cpp
30
src/main.cpp
@@ -1,17 +1,8 @@
|
||||
/* Copyright (C) 2024 Aryadev Chavali
|
||||
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License Version 2 for
|
||||
* details.
|
||||
|
||||
* You may distribute and modify this code under the terms of the GNU General
|
||||
* Public License Version 2, which you should have received a copy of along with
|
||||
* this program. If not, please go to <https://www.gnu.org/licenses/>.
|
||||
|
||||
* Created: 2024-07-25
|
||||
/* main.cpp: Entrypoint
|
||||
* Created: 2025-11-20
|
||||
* Author: Aryadev Chavali
|
||||
* Description: Entrypoint
|
||||
* License: See end of file
|
||||
* Commentary: 2024-07-25
|
||||
*/
|
||||
|
||||
#include "./numerics.hpp"
|
||||
@@ -218,3 +209,16 @@ int main(void)
|
||||
CloseWindow();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Copyright (C) 2024, 2025 Aryadev Chavali
|
||||
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License Version 2 for
|
||||
* details.
|
||||
|
||||
* You may distribute and modify this code under the terms of the GNU General
|
||||
* Public License Version 2, which you should have received a copy of along with
|
||||
* this program. If not, please go to <https://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
@@ -1,17 +1,8 @@
|
||||
/* Copyright (C) 2024 Aryadev Chavali
|
||||
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License Version 2 for
|
||||
* details.
|
||||
|
||||
* You may distribute and modify this code under the terms of the GNU General
|
||||
* Public License Version 2, which you should have received a copy of along with
|
||||
* this program. If not, please go to <https://www.gnu.org/licenses/>.
|
||||
|
||||
/* numerics.cpp: Implementation of numerics
|
||||
* Created: 2024-07-26
|
||||
* Author: Aryadev Chavali
|
||||
* Description: Implementation of numerics
|
||||
* License: See end of file
|
||||
* Commentary:
|
||||
*/
|
||||
|
||||
#include "./numerics.hpp"
|
||||
@@ -147,3 +138,16 @@ std::string to_string(const NodeAllocator &allocator, const index_t n,
|
||||
ss << ")";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
/* Copyright (C) 2024, 2025 Aryadev Chavali
|
||||
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License Version 2 for
|
||||
* details.
|
||||
|
||||
* You may distribute and modify this code under the terms of the GNU General
|
||||
* Public License Version 2, which you should have received a copy of along with
|
||||
* this program. If not, please go to <https://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
@@ -1,17 +1,8 @@
|
||||
/* Copyright (C) 2024 Aryadev Chavali
|
||||
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License Version 2 for
|
||||
* details.
|
||||
|
||||
* You may distribute and modify this code under the terms of the GNU General
|
||||
* Public License Version 2, which you should have received a copy of along with
|
||||
* this program. If not, please go to <https://www.gnu.org/licenses/>.
|
||||
|
||||
/* numerics.hpp: Computation necessary for generating the tree
|
||||
* Created: 2024-07-26
|
||||
* Author: Aryadev Chavali
|
||||
* Description: Computation necessary for generating the tree
|
||||
* License: See end of file
|
||||
* Commentary:
|
||||
*/
|
||||
|
||||
#ifndef NUMERICS_HPP
|
||||
@@ -67,3 +58,15 @@ std::string to_string(const Fraction &);
|
||||
std::string to_string(const NodeAllocator &, const index_t, int depth = 1);
|
||||
|
||||
#endif
|
||||
|
||||
/* Copyright (C) 2024, 2025 Aryadev Chavali
|
||||
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License Version 2 for
|
||||
* details.
|
||||
|
||||
* You may distribute and modify this code under the terms of the GNU General
|
||||
* Public License Version 2, which you should have received a copy of along with
|
||||
* this program. If not, please go to <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user