mirror of
https://github.com/janet-lang/janet
synced 2024-12-26 08:20:27 +00:00
21bd960865
Reuse threads on gst_run when possible change name of getline to gst_getline
58 lines
1.6 KiB
Makefile
58 lines
1.6 KiB
Makefile
# GST
|
|
|
|
######################################################
|
|
##### Set global variables for all gst Makefiles #####
|
|
######################################################
|
|
CFLAGS=-std=c99 -Wall -Wextra -I./include -g
|
|
PREFIX=/usr/local
|
|
GST_TARGET=client/gst
|
|
GST_CORELIB=core/libgst.a
|
|
GST_INTERNAL_HEADERS=$(addprefix core/, cache.h)
|
|
GST_HEADERS=$(addprefix include/gst/, gst.h)
|
|
|
|
all: $(GST_TARGET)
|
|
|
|
###################################
|
|
##### The core vm and runtime #####
|
|
###################################
|
|
GST_CORE_SOURCES=$(addprefix core/,\
|
|
compile.c parse.c stl.c ids.c util.c\
|
|
value.c vm.c ds.c gc.c thread.c serialize.c)
|
|
GST_CORE_OBJECTS=$(patsubst %.c,%.o,$(GST_CORE_SOURCES))
|
|
|
|
######################
|
|
##### The client #####
|
|
######################
|
|
GST_CLIENT_SOURCES=client/main.c
|
|
GST_CLIENT_OBJECTS=$(patsubst %.c,%.o,$(GST_CLIENT_SOURCES))
|
|
$(GST_TARGET): $(GST_CLIENT_OBJECTS) $(GST_CORE_OBJECTS)
|
|
$(CC) $(CFLAGS) -o $(GST_TARGET) $(GST_CLIENT_OBJECTS) $(GST_CORE_OBJECTS)
|
|
|
|
# Compile all .c to .o
|
|
%.o : %.c $(GST_HEADERS) $(GST_INTERNAL_HEADERS)
|
|
$(CC) $(CFLAGS) -o $@ -c $<
|
|
|
|
run: $(GST_TARGET)
|
|
./$(GST_TARGET)
|
|
|
|
debug: $(GST_TARGET)
|
|
gdb $(GST_TARGET)
|
|
|
|
valgrind: $(GST_TARGET)
|
|
valgrind --leak-check=full -v ./$(GST_TARGET)
|
|
|
|
clean:
|
|
rm $(GST_TARGET) || true
|
|
rm $(GST_CORELIB) || true
|
|
rm $(GST_CORE_OBJECTS) || true
|
|
rm $(GST_CLIENT_OBJECTS) || true
|
|
rm vgcore.* || true
|
|
|
|
test: $(GST_TARGET)
|
|
$(GST_TARGET) gsttests/basic.gst
|
|
|
|
valtest: $(GST_TARGET)
|
|
valgrind --leak-check=full -v ./$(GST_TARGET) gsttests/basic.gst
|
|
|
|
.PHONY: clean install run debug valgrind test valtest
|