chore: figure out how to compile everything with C
parent
3e40eeff2d
commit
32ff120600
3
Makefile
3
Makefile
|
@ -3,7 +3,8 @@ SRC_DIR := src
|
||||||
SOURCES != find '$(SRC_DIR)' -iname '*.v'
|
SOURCES != find '$(SRC_DIR)' -iname '*.v'
|
||||||
|
|
||||||
V_PATH ?= v
|
V_PATH ?= v
|
||||||
V := $(V_PATH) -showcc -gc boehm -W -d use_openssl
|
# We need to use GCC because TCC doesn't like the way we use C bindings
|
||||||
|
V := $(V_PATH) -showcc -gc boehm -W -d use_openssl -cc gcc
|
||||||
|
|
||||||
all: vieter
|
all: vieter
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ static char *ignored_names[5] = {
|
||||||
};
|
};
|
||||||
static int ignored_words_len = sizeof(ignored_names) / sizeof(char *);
|
static int ignored_words_len = sizeof(ignored_names) / sizeof(char *);
|
||||||
|
|
||||||
inline Pkg *package_init() {
|
Pkg *package_init() {
|
||||||
return calloc(sizeof(PkgInfo), 1);
|
return calloc(sizeof(PkgInfo), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
module package
|
||||||
|
|
||||||
|
#flag -I @VMODROOT/c
|
||||||
|
|
||||||
|
// We need to specify *every* C file here. Otherwise, Vieter doesn't compile.
|
||||||
|
#flag @VMODROOT/c/package.o
|
||||||
|
#flag @VMODROOT/c/package_info.o
|
||||||
|
|
||||||
|
#include "package.h"
|
||||||
|
|
||||||
|
struct C.Pkg{}
|
||||||
|
|
||||||
|
fn C.package_read_archive(pkg_path &char) &C.pkg
|
|
@ -0,0 +1,3 @@
|
||||||
|
Module{
|
||||||
|
name: 'package'
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
module util
|
||||||
|
|
||||||
|
#flag -I @VMODROOT/c
|
||||||
|
|
||||||
|
// This makes the V compiler include this object file when linking, allowing
|
||||||
|
// all other C parts of the codebase to use it as well.
|
||||||
|
#flag @VMODROOT/c/dynarray.o
|
|
@ -0,0 +1,3 @@
|
||||||
|
Module{
|
||||||
|
name: 'util'
|
||||||
|
}
|
Loading…
Reference in New Issue