Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 53 lines (40 sloc) 1.21 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
all: zklua.so

# You may need to change the following variables according to
# your system, here are the descriptions of these variables:
#
# ZOOKEEPER_LIB_DIR: Zookeeper C API library path.
# LUA_LIB_DIR: Lua library path.
# LUA_VERSION: Lua version.
# LUA_VERSION_NUMBER: Lua version number.
ZOOKEEPER_LIB_DIR = /usr/local/lib
LUA_LIB_DIR = /usr/local/lib/lua
LUA_VERSION = lua
LUA_VERSION_NUMBER = 5.1

CC = gcc
CFLAGS = `pkg-config --cflags $(LUA_VERSION)` -fPIC -O2 #-Wall
INSTALL_PATH = $(shell pkg-config $(LUA_VERSION) --variable=libdir)/$(LUA_VERSION)/$(LUA_VERSION_NUMBER)

OS_NAME = $(shell uname -s)
MH_NAME = $(shell uname -m)

ifeq ($(OS_NAME), Darwin)
LDFLAGS += -bundle -undefined dynamic_lookup -framework CoreServices
ifeq ($(MH_NAME), x86_64)
endif
else
LDFLAGS += -shared -lrt
endif

LDFLAGS += -lm -ldl -lpthread -L$(ZOOKEEPER_LIB_DIR) -lzookeeper_mt

SRCS := zklua.c

OBJS := $(patsubst %.c,%.o,$(SRCS))

$(OBJS):
$(CC) -c $(CFLAGS) $(SRCS)

zklua.so: $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)


.PHONY: all clean install

clean:
rm -f *.o *.so

install: zklua.so
ifeq ($(OS_NAME), Darwin)
install zklua.so $(INSTALL_PATH)/zklua.so
else
install -D -s zklua.so $(INSTALL_PATH)/zklua.so
endif
Something went wrong with that request. Please try again.