Move some stuff around for cleanliness
This commit is contained in:
14
build.sh
14
build.sh
@@ -3,13 +3,15 @@
|
||||
set -xe
|
||||
|
||||
CFLAGS="-Wall -Wextra -std=c11 -ggdb -fsanitize=address -fsanitize=undefined -Wswitch -Wswitch-enum"
|
||||
LINK="-I."
|
||||
LIB=$(find "./" -name "*.c" -not -name "main.c" -not -name "test.c")
|
||||
OUT="alisp.out"
|
||||
LDFLAGS="-lc"
|
||||
|
||||
LIB=$(find "./runtime" -type 'f')
|
||||
OUT="build/alisp.out"
|
||||
|
||||
build() {
|
||||
cc $LINK $CFLAGS -o $OUT $LIB main.c;
|
||||
cc $LINK $CFLAGS -o test.out $LIB test.c;
|
||||
mkdir -p build;
|
||||
cc $CFLAGS -o $OUT $LIB main.c $LDFLAGS;
|
||||
cc $CFLAGS -o build/test.out $LIB test/test.c $LDFLAGS;
|
||||
}
|
||||
|
||||
clean() {
|
||||
@@ -21,7 +23,7 @@ run() {
|
||||
}
|
||||
|
||||
test() {
|
||||
./test.out
|
||||
./build/test.out
|
||||
}
|
||||
|
||||
build
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include <malloc.h>
|
||||
|
||||
#include "./alisp.h"
|
||||
#include "../alisp.h"
|
||||
|
||||
lisp_t *make_int(i64 i)
|
||||
{
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "./alisp.h"
|
||||
#include "../alisp.h"
|
||||
|
||||
stream_err_t stream_init_string(stream_t *stream, char *name, sv_t contents)
|
||||
{
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "./alisp.h"
|
||||
#include "../alisp.h"
|
||||
|
||||
sv_t sv_copy(sv_t old)
|
||||
{
|
||||
@@ -12,7 +12,7 @@
|
||||
* Description: Symbol Table implementation
|
||||
*/
|
||||
|
||||
#include "./alisp.h"
|
||||
#include "../alisp.h"
|
||||
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
@@ -12,7 +12,7 @@
|
||||
* Description: System management
|
||||
*/
|
||||
|
||||
#include "./alisp.h"
|
||||
#include "../alisp.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <malloc.h>
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "./alisp.h"
|
||||
#include "../alisp.h"
|
||||
|
||||
lisp_t *tag_int(i64 i)
|
||||
{
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "./alisp.h"
|
||||
#include "../alisp.h"
|
||||
|
||||
void vec_init(vec_t *vec, u64 size)
|
||||
{
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "./alisp.h"
|
||||
#include "../alisp.h"
|
||||
|
||||
#define TEST_PASSED() printf("[%s]: Pass\n", __func__)
|
||||
#define TEST(NAME, COND) \
|
||||
Reference in New Issue
Block a user