commit 1845618e8df251bfcdbab75175e95d676fca2d5a Author: Abdelrahman Date: Sun Jun 1 01:06:19 2025 +0100 Init repo 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; +}