From 1845618e8df251bfcdbab75175e95d676fca2d5a Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 1 Jun 2025 01:06:19 +0100 Subject: [PATCH] Init repo --- .gitignore | 2 ++ Makefile | 19 +++++++++++++++++++ README.md | 3 +++ cclox_src/main.cc | 6 ++++++ clox_src/main.c | 6 ++++++ 5 files changed, 36 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README.md create mode 100644 cclox_src/main.cc create mode 100644 clox_src/main.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9c7639e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +cclox +clox diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ea6a3ca --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +CC = clang +CXX = clang++ +CFLAGS = -Wall -Wextra -Werror -pedantic -g + +CCLOX_SRC = cclox_src/*.cc +CCLOX_OUT = cclox + +CLOX_SRC = clox_src/*.c +CLOX_OUT = clox + +.PHONY: all cclox clox + +all: cclox clox + +cclox: ${CCLOX_SRC} + ${CXX} ${CFLAGS} ${CCLOX_SRC} -o ${CCLOX_OUT} + +clox: ${CLOX_SRC} + ${CC} ${CFLAGS} ${CLOX_SRC} -o ${CLOX_OUT} diff --git a/README.md b/README.md new file mode 100644 index 0000000..7d67831 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Crafting Interpreters + +Following along with Robert Nystrom's [Crafting Interpreters](https://craftinginterpreters.com/contents.html) diff --git a/cclox_src/main.cc b/cclox_src/main.cc new file mode 100644 index 0000000..9c73496 --- /dev/null +++ b/cclox_src/main.cc @@ -0,0 +1,6 @@ +#include + +int main() { + printf("Hello from cclox\n"); + return 0; +} diff --git a/clox_src/main.c b/clox_src/main.c new file mode 100644 index 0000000..991141b --- /dev/null +++ b/clox_src/main.c @@ -0,0 +1,6 @@ +#include + +int main(void) { + printf("Hello from clox\n"); + return 0; +}