1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-05 00:06:16 +00:00
janet/Makefile

38 lines
711 B
Makefile
Raw Normal View History

2017-02-09 20:02:59 +00:00
# TIL
CFLAGS=-std=c99 -Wall -Wextra -Wpedantic -g
2017-02-09 20:02:59 +00:00
TARGET=interp
2017-02-09 20:02:59 +00:00
PREFIX=/usr/local
# C sources
2017-03-12 22:23:27 +00:00
HEADERS=vm.h ds.h compile.h parse.h value.h datatypes.h gc.h util.h gst.h stl.h disasm.h thread.h
SOURCES=main.c parse.c value.c vm.c ds.c compile.c gc.c stl.c disasm.c thread.c
2017-02-09 20:02:59 +00:00
OBJECTS=$(patsubst %.c,%.o,$(SOURCES))
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJECTS)
%.o : %.c $(HEADERS)
2017-02-09 20:02:59 +00:00
$(CC) $(CFLAGS) -o $@ -c $<
install: $(TARGET)
cp $(TARGET) $(PREFIX)/bin
clean:
rm $(TARGET) || true
rm $(OBJECTS) || true
run: $(TARGET)
./$(TARGET)
debug: $(TARGET)
gdb $(TARGET)
valgrind: $(TARGET)
valgrind ./$(TARGET) --leak-check=full
.PHONY: clean install run debug valgrind