1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 19:19:53 +00:00
janet/Makefile

69 lines
1.7 KiB
Makefile
Raw Normal View History

# GST
2017-02-09 20:02:59 +00:00
######################################################
##### Set global variables for all gst Makefiles #####
######################################################
PREFIX?=/usr/local
BINDIR=$(PREFIX)/bin
VERSION=\"0.0.0-beta\"
CFLAGS=-std=c99 -Wall -Wextra -I./include -g -DGST_VERSION=$(VERSION)
2017-02-09 20:02:59 +00:00
PREFIX=/usr/local
2017-07-02 18:42:30 +00:00
GST_TARGET=gst
GST_CORELIB=core/libgst.a
2017-04-15 20:05:59 +00:00
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))
2017-06-20 03:01:34 +00:00
######################
##### 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
2017-04-15 20:05:59 +00:00
%.o : %.c $(GST_HEADERS) $(GST_INTERNAL_HEADERS)
2017-02-09 20:02:59 +00:00
$(CC) $(CFLAGS) -o $@ -c $<
run: $(GST_TARGET)
./$(GST_TARGET)
2017-02-09 20:02:59 +00:00
debug: $(GST_TARGET)
2017-07-02 18:42:30 +00:00
gdb ./$(GST_TARGET)
2017-02-09 20:02:59 +00:00
valgrind: $(GST_TARGET)
valgrind --leak-check=full -v ./$(GST_TARGET)
2017-02-09 20:02:59 +00:00
clean:
rm $(GST_TARGET) || true
rm $(GST_CORELIB) || true
rm $(GST_CORE_OBJECTS) || true
rm $(GST_CLIENT_OBJECTS) || true
2017-03-22 04:27:18 +00:00
rm vgcore.* || true
2017-06-20 03:01:34 +00:00
test: $(GST_TARGET)
2017-07-02 18:42:30 +00:00
./$(GST_TARGET) gsttests/basic.gst
2017-06-20 03:01:34 +00:00
valtest: $(GST_TARGET)
valgrind --leak-check=full -v ./$(GST_TARGET) gsttests/basic.gst
install: $(GST_TARGET)
cp $(GST_TARGET) $(BINDIR)/gst
uninstall:
rm $(BINDIR)/gst
.PHONY: clean install run debug valgrind test valtest install uninstall