Permalink
Browse files

Makefile changed, remove useless variables.

  • Loading branch information...
1 parent b18f74d commit a31736d63f61911a99e67e7d66f09470452d19b1 @forhappy committed Apr 15, 2013
Showing with 5 additions and 31 deletions.
  1. +4 −27 Makefile
  2. +1 −4 zklua.h
View
@@ -1,17 +1,6 @@
all: zklua.so
-# NOTE: you should modify the $(ZOOKEEPER_C_API_DIR) variable to
-# the name of your zookeeper c api directory that are copied from
-# apache zookeeper manually(This can help you to avoid installing
-# the extra zookeeper c libraries into your system if you do not
-# want them to be installed), and usually the zookeeper c api resides
-# in the following directory: `zookeeper-X.Y.Z/src/c`, where X.Y.Z is
-# the zookeeper version. You may change the name `zookeeper-X.Y.Z/src/c`
-# to `zookeeper-c-api-X.Y.Z` according to your zookeeper version when
-# copying that directory to the current zklua diretory.
-ZOOKEEPER_C_API_DIR = ./zookeeper-c-api-3.4.5
-ZOOKEEPER_INCLUDE_DIR = $(ZOOKEEPER_C_API_DIR)/include/
-ZOOKEEPER_MT_AR_LIB = $(ZOOKEEPER_C_API_DIR)/.libs/libzookeeper_mt.a
+ZOOKEEPER_LIB_DIR = /usr/local/lib
CC = gcc
CFLAGS = `pkg-config lua5.1 --cflags` -I$(ZOOKEEPER_INCLUDE_DIR) -fPIC -O2 #-Wall
@@ -20,7 +9,7 @@ INSTALL_PATH = `pkg-config lua5.1 --variable=INSTALL_CMOD`
OS_NAME = $(shell uname -s)
MH_NAME = $(shell uname -m)
-LDFLAGS += -lm -ldl -lpthread
+LDFLAGS += -lm -ldl -lpthread -L$(ZOOKEEPER_LIB_DIR) -lzookeeper_mt
ifeq ($(OS_NAME), Darwin)
LDFLAGS += -bundle -undefined dynamic_lookup -framework CoreServices
@@ -30,35 +19,23 @@ else
LDFLAGS += -shared -lrt
endif
-$(ZOOKEEPER_MT_AR_LIB): $(ZOOKEEPER_C_API_DIR)/Makefile
- $(MAKE) -C $(ZOOKEEPER_C_API_DIR)
-$(ZOOKEEPER_C_API_DIR)/Makefile:
- cd $(ZOOKEEPER_C_API_DIR) && ./configure
- cd $(ZOOKEEPER_C_API_DIR) && cp ./generated/zookeeper.jute.h ./include/zookeeper.jute.h
SRCS := zklua.c
OBJS := $(patsubst %.c,%.o,$(SRCS))
-LIBS = $(ZOOKEEPER_MT_AR_LIB)
-
$(OBJS):
$(CC) -c $(CFLAGS) $(SRCS)
-zklua.so: $(LIBS) $(OBJS)
+zklua.so: $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
-.PHONY: all clean distclean install
+.PHONY: all clean install
clean:
rm -f *.o *.so
-distclean:clean
- $(MAKE) -C $(ZOOKEEPER_C_API_DIR) clean
- $(MAKE) -C $(ZOOKEEPER_C_API_DIR) distclean
- cd $(ZOOKEEPER_C_API_DIR) && rm ./include/zookeeper.jute.h
-
install: zklua.so
install -D -s zklua.so $(INSTALL_PATH)/zklua.so
View
@@ -25,10 +25,7 @@
#include <lauxlib.h>
#include <lualib.h>
-/**
- * #include <zookeeper/zookeeper.h>
- **/
-#include "zookeeper.h"
+#include <zookeeper/zookeeper.h>
#define ZKLUA_METATABLE_NAME "ZKLUA_HANDLE"
#define ZKLUA_MAX_PATH_BUFFER_SIZE 1024

0 comments on commit a31736d

Please sign in to comment.