feat: 对接Python,暴露接口
This commit is contained in:
9
Makefile
9
Makefile
@@ -2,6 +2,7 @@ CC ?= gcc
|
||||
CFLAGS ?= -std=c11 -Wall -Wextra -O2 -pthread -D_GNU_SOURCE
|
||||
CPPFLAGS ?= -Iinclude -Ithird_party/cjson -Ithird_party/kcp
|
||||
LDFLAGS ?= -pthread
|
||||
PYTHON ?= python3
|
||||
|
||||
BIN_DIR := bin
|
||||
SRC_DIR := src
|
||||
@@ -64,4 +65,10 @@ $(BIN_DIR)/kcpping: $(CMD_DIR)/kcpping.c $(COMMON_SRCS) | $(BIN_DIR)
|
||||
clean:
|
||||
rm -rf $(BIN_DIR)
|
||||
|
||||
.PHONY: all clean
|
||||
python-ext:
|
||||
cd python && $(PYTHON) setup.py build_ext --inplace
|
||||
|
||||
python-install:
|
||||
cd python && $(PYTHON) -m pip install -e .
|
||||
|
||||
.PHONY: all clean python-ext python-install
|
||||
|
||||
Reference in New Issue
Block a user