2018-07-12 13:45:11 +02:00
|
|
|
CFLAGS = -W -Wunused -Wall -I. -Ofast
|
2018-07-12 18:18:06 +02:00
|
|
|
LDFLAGS = -Wl,--export-dynamic -ldl -rdynamic
|
2018-07-12 13:45:11 +02:00
|
|
|
CC = gcc
|
|
|
|
INCLUDES =
|
|
|
|
|
2018-07-12 18:18:06 +02:00
|
|
|
ENGINE_OBJS =\
|
2018-07-12 13:45:11 +02:00
|
|
|
api.o \
|
|
|
|
builtin.o \
|
|
|
|
compile.o \
|
|
|
|
constant.o \
|
|
|
|
hashmap.o \
|
|
|
|
interpreter.o \
|
2018-07-12 16:20:39 +02:00
|
|
|
lexer.o \
|
2018-07-12 13:45:11 +02:00
|
|
|
lib.o \
|
|
|
|
memobj.o \
|
2018-07-12 15:59:22 +02:00
|
|
|
oop.o \
|
2018-07-12 16:20:39 +02:00
|
|
|
parser.o \
|
2018-07-12 13:45:11 +02:00
|
|
|
vfs.o \
|
|
|
|
vm.o
|
|
|
|
|
2018-07-12 17:36:19 +02:00
|
|
|
ASTYLE_FLAGS =\
|
|
|
|
--style=java \
|
|
|
|
--indent=force-tab \
|
|
|
|
--attach-closing-while \
|
|
|
|
--attach-inlines \
|
|
|
|
--attach-classes \
|
|
|
|
--indent-classes \
|
|
|
|
--indent-modifiers \
|
|
|
|
--indent-switches \
|
|
|
|
--indent-cases \
|
|
|
|
--indent-preproc-block \
|
|
|
|
--indent-preproc-define \
|
|
|
|
--indent-col1-comments \
|
|
|
|
--pad-oper \
|
|
|
|
--pad-comma \
|
|
|
|
--unpad-paren \
|
|
|
|
--delete-empty-lines \
|
|
|
|
--align-pointer=name \
|
|
|
|
--align-reference=name \
|
|
|
|
--break-one-line-headers \
|
|
|
|
--add-braces \
|
|
|
|
--verbose \
|
|
|
|
--formatted \
|
|
|
|
--lineend=linux
|
|
|
|
|
2018-07-12 13:45:11 +02:00
|
|
|
|
2018-07-12 18:18:06 +02:00
|
|
|
all: psharp
|
2018-07-12 13:45:11 +02:00
|
|
|
|
|
|
|
clean:
|
2018-07-12 18:18:06 +02:00
|
|
|
rm -f psharp $(ENGINE_OBJS)
|
2018-07-12 13:45:11 +02:00
|
|
|
|
2018-07-12 17:36:19 +02:00
|
|
|
style:
|
|
|
|
astyle $(ASTYLE_FLAGS) --recursive ./*.c,*.h
|
|
|
|
|
2018-07-12 18:18:06 +02:00
|
|
|
psharp: $(ENGINE_OBJS)
|
|
|
|
$(CC) -o psharp $(LDFLAGS) $^
|
2018-07-12 13:45:11 +02:00
|
|
|
|
2018-07-12 18:18:06 +02:00
|
|
|
%.o: %.c
|
|
|
|
$(CC) -c $(INCLUDES) $(CFLAGS) -o $@ -c $<
|