2021-01-02 08:51:01 +03:00
|
|
|
CFLAGS = -g -O3 -fPIC -Wall -Wextra -pedantic -Wno-unused-parameter -DDEBUG
|
|
|
|
LDFLAGS = -L. -Wl,-rpath -Wl,.
|
|
|
|
LDLIBS = -lkuroko -ldl
|
|
|
|
OBJS = $(patsubst %.c, %.o, $(filter-out kuroko.c,$(sort $(wildcard *.c))))
|
2020-12-26 03:32:21 +03:00
|
|
|
TARGET = kuroko
|
|
|
|
|
2020-12-31 09:48:39 +03:00
|
|
|
MODULES=$(patsubst src/%.c, modules/%.so, $(sort $(wildcard src/*.c)))
|
|
|
|
|
|
|
|
all: ${TARGET} ${MODULES}
|
|
|
|
|
|
|
|
modules/%.so: src/%.c
|
|
|
|
${CC} ${CFLAGS} -shared -fPIC -o $@ $<
|
2020-12-26 03:32:21 +03:00
|
|
|
|
2021-01-02 08:51:01 +03:00
|
|
|
libkuroko.so: ${OBJS}
|
|
|
|
${CC} ${CLFAGS} -shared -fPIC -o $@ ${OBJS}
|
|
|
|
|
2020-12-29 12:04:02 +03:00
|
|
|
builtins.c: builtins.krk
|
|
|
|
echo "const char _builtins_src[] = {\n" > builtins.c
|
|
|
|
hexdump -v -e '16/1 "0x%02x,"' -e '"\n"' builtins.krk | sed s'/0x ,//g' >> builtins.c
|
2020-12-31 07:50:17 +03:00
|
|
|
echo "0x00 };" >> builtins.c
|
2020-12-29 12:04:02 +03:00
|
|
|
|
2021-01-02 08:51:01 +03:00
|
|
|
kuroko: libkuroko.so
|
2020-12-26 03:32:21 +03:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2021-01-02 08:51:01 +03:00
|
|
|
@rm -f ${OBJS} ${TARGET} ${MODULES} libkuroko.so
|
2020-12-26 03:32:21 +03:00
|
|
|
|
|
|
|
tags: $(wildcard *.c) $(wildcard *.h)
|
|
|
|
@ctags --c-kinds=+lx *.c *.h
|