【修改】修改example样例,调用方式修改为传入已经加载完成的config specifig

This commit is contained in:
niubinghui
2024-08-13 17:23:13 +08:00
parent a52c210f77
commit 88a34dec4d
6 changed files with 192 additions and 48 deletions

26
example/Makefile Normal file
View File

@@ -0,0 +1,26 @@
TOPDIR = ./..
CC=gcc
MAKE=make
TARGET=example
EXAMPLE_FLAG = -DLUAPLUGIN_EXAMPLE
SRC := example.c
OBJECTS := example.o
INCLUDE = -I$(TOPDIR)/output/include -I$(TOPDIR)/dependence/include
CFLAGS = -g -Wextra -Wall -O0 -fPIC
# CFLAGS += -pedantic -fsanitize=address
# LDLIBS = -L$(TOPDIR)/output/lib -llua -ldl -lm
LDLIBS += -L$(TOPDIR)/output/libs -lluaplugin -L$(TOPDIR)/dependence/lib -ltoml
all:$(OBJECTS)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJECTS) $(LDLIBS)
$(OBJECTS):$(SRC)
$(CC) $(TEST_FLAG) $(INCLUDE) $(CFLAGS) $(SRC) -c $^
clean:
rm -rf $(OBJECTS) $(TARGET)
rm -rf $(TOPDIR)/output/libs/$(TARGET)