tsgo/Makefile
2020-09-04 19:32:12 +02:00

19 lines
598 B
Makefile

CFLAGS = -c -O2 -Wall -fPIC
all: ts3_plugin.so
tsgo_export.h: src/go/tsgo_export.go
C_INCLUDE_PATH="ts3client-pluginsdk/include:src/c" go tool cgo -exportheader $@ $^
tsgo_export.a: src/go/tsgo_export.go plugin.o
CGO_CFLAGS="-Its3client-pluginsdk/include -Isrc/c" go build -buildmode=c-archive src/go/tsgo_export.go
plugin.o: src/c/plugin.c tsgo_export.h
gcc src/c/plugin.c -o plugin.o -Its3client-pluginsdk/include -Isrc/c $(CFLAGS)
ts3_plugin.so: plugin.o tsgo_export.a
gcc -o $@ -shared -lpthread $^
clean:
rm -rf plugin.o tsgo_export.a tsgo_export.h _cgo_export.h ts3_plugin.so _obj