Updated Toy, fixed build process

This commit is contained in:
2023-02-16 20:19:42 +00:00
parent 9a1d81b7fb
commit f854979f4c
4 changed files with 11 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ ODIR = obj
SRC = $(wildcard *.c)
OBJ = $(addprefix $(ODIR)/,$(SRC:.c=.o))
TOYLIBS = $(wildcard ../Toy/repl/lib*) $(wildcard ../Toy/repl/repl_tools.*)
REPLLIBS = $(wildcard ../Toy/repl/lib*) $(wildcard ../Toy/repl/repl_tools.*)
OUTNAME=box
@@ -27,15 +27,15 @@ else
exit 1
endif
library: libs $(OBJ)
library: repllibs $(OBJ)
$(CC) -DBOX_EXPORT $(CFLAGS) -shared -o $(OUT) $(LIBLINE) -L../$(LIBDIR) $(LIBS)
static: libs $(OBJ)
static: repllibs $(OBJ)
ar crs $(BOX_OUTDIR)/lib$(OUTNAME).a $(OBJ) -L../$(LIBDIR) $(LIBS)
#copy the stuff from Toy/repl that is needed
libs:
cp $(TOYLIBS) .
repllibs:
cp $(REPLLIBS) .
$(OBJ): | $(ODIR)
@@ -47,5 +47,5 @@ $(ODIR)/%.o: %.c
.PHONY: clean
clean-libs:
$(RM) $(notdir $(TOYLIBS))
clean-repllibs:
$(RM) $(notdir $(REPLLIBS))

View File

@@ -94,7 +94,7 @@ const unsigned char* Toy_compileString(const char* source, size_t* size) {
}
//get the bytecode dump
const unsigned char* tb = Toy_collateCompiler(&compiler, (int*)(size));
const unsigned char* tb = Toy_collateCompiler(&compiler, size);
//cleanup
Toy_freeCompiler(&compiler);