Move some stuff around for cleanliness

This commit is contained in:
2026-01-21 09:33:35 +00:00
parent bb55895e94
commit 2ec1dfa083
9 changed files with 16 additions and 14 deletions

View File

@@ -3,13 +3,15 @@
set -xe set -xe
CFLAGS="-Wall -Wextra -std=c11 -ggdb -fsanitize=address -fsanitize=undefined -Wswitch -Wswitch-enum" CFLAGS="-Wall -Wextra -std=c11 -ggdb -fsanitize=address -fsanitize=undefined -Wswitch -Wswitch-enum"
LINK="-I." LDFLAGS="-lc"
LIB=$(find "./" -name "*.c" -not -name "main.c" -not -name "test.c")
OUT="alisp.out" LIB=$(find "./runtime" -type 'f')
OUT="build/alisp.out"
build() { build() {
cc $LINK $CFLAGS -o $OUT $LIB main.c; mkdir -p build;
cc $LINK $CFLAGS -o test.out $LIB test.c; cc $CFLAGS -o $OUT $LIB main.c $LDFLAGS;
cc $CFLAGS -o build/test.out $LIB test/test.c $LDFLAGS;
} }
clean() { clean() {
@@ -21,7 +23,7 @@ run() {
} }
test() { test() {
./test.out ./build/test.out
} }
build build

View File

@@ -14,7 +14,7 @@
#include <malloc.h> #include <malloc.h>
#include "./alisp.h" #include "../alisp.h"
lisp_t *make_int(i64 i) lisp_t *make_int(i64 i)
{ {

View File

@@ -15,7 +15,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "./alisp.h" #include "../alisp.h"
stream_err_t stream_init_string(stream_t *stream, char *name, sv_t contents) stream_err_t stream_init_string(stream_t *stream, char *name, sv_t contents)
{ {

View File

@@ -16,7 +16,7 @@
#include <malloc.h> #include <malloc.h>
#include <string.h> #include <string.h>
#include "./alisp.h" #include "../alisp.h"
sv_t sv_copy(sv_t old) sv_t sv_copy(sv_t old)
{ {

View File

@@ -12,7 +12,7 @@
* Description: Symbol Table implementation * Description: Symbol Table implementation
*/ */
#include "./alisp.h" #include "../alisp.h"
#include <malloc.h> #include <malloc.h>
#include <string.h> #include <string.h>

View File

@@ -12,7 +12,7 @@
* Description: System management * Description: System management
*/ */
#include "./alisp.h" #include "../alisp.h"
#include <assert.h> #include <assert.h>
#include <malloc.h> #include <malloc.h>

View File

@@ -15,7 +15,7 @@
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include "./alisp.h" #include "../alisp.h"
lisp_t *tag_int(i64 i) lisp_t *tag_int(i64 i)
{ {

View File

@@ -16,7 +16,7 @@
#include <malloc.h> #include <malloc.h>
#include <string.h> #include <string.h>
#include "./alisp.h" #include "../alisp.h"
void vec_init(vec_t *vec, u64 size) void vec_init(vec_t *vec, u64 size)
{ {

View File

@@ -16,7 +16,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "./alisp.h" #include "../alisp.h"
#define TEST_PASSED() printf("[%s]: Pass\n", __func__) #define TEST_PASSED() printf("[%s]: Pass\n", __func__)
#define TEST(NAME, COND) \ #define TEST(NAME, COND) \