make.sh and Makefile changed
parent
bbcd9f492d
commit
6d9d71005a
11
make.sh
11
make.sh
|
|
@ -36,6 +36,8 @@ for col in $output; do
|
||||||
done
|
done
|
||||||
|
|
||||||
/bin/rm -f a.out $tmp_src_filename
|
/bin/rm -f a.out $tmp_src_filename
|
||||||
|
|
||||||
|
TARGET_PREFIX=$DESTDIR/usr
|
||||||
if [ "$int_bytes" -eq 8 ]; then
|
if [ "$int_bytes" -eq 8 ]; then
|
||||||
OS_BITS=64
|
OS_BITS=64
|
||||||
LIB_VERSION=lib64
|
LIB_VERSION=lib64
|
||||||
|
|
@ -72,6 +74,8 @@ elif [ "$uname" = "FreeBSD" ] || [ "$uname" = "Darwin" ]; then
|
||||||
IOEVENT_USE=IOEVENT_USE_KQUEUE
|
IOEVENT_USE=IOEVENT_USE_KQUEUE
|
||||||
if [ "$uname" = "Darwin" ]; then
|
if [ "$uname" = "Darwin" ]; then
|
||||||
CFLAGS="$CFLAGS -DDARWIN"
|
CFLAGS="$CFLAGS -DDARWIN"
|
||||||
|
TARGET_PREFIX=$TARGET_PREFIX/local
|
||||||
|
LIB_VERSION=lib
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f /usr/include/sys/vmmeter.h ]; then
|
if [ -f /usr/include/sys/vmmeter.h ]; then
|
||||||
|
|
@ -147,9 +151,10 @@ sed_replace()
|
||||||
|
|
||||||
cd src
|
cd src
|
||||||
cp Makefile.in Makefile
|
cp Makefile.in Makefile
|
||||||
sed_replace "s/\\\$(CFLAGS)/$CFLAGS/g" Makefile
|
sed_replace "s#\\\$(CFLAGS)#$CFLAGS#g" Makefile
|
||||||
sed_replace "s/\\\$(LIBS)/$LIBS/g" Makefile
|
sed_replace "s#\\\$(LIBS)#$LIBS#g" Makefile
|
||||||
sed_replace "s/\\\$(LIB_VERSION)/$LIB_VERSION/g" Makefile
|
sed_replace "s#\\\$(TARGET_PREFIX)#$TARGET_PREFIX#g" Makefile
|
||||||
|
sed_replace "s#\\\$(LIB_VERSION)#$LIB_VERSION#g" Makefile
|
||||||
make $1 $2 $3
|
make $1 $2 $3
|
||||||
|
|
||||||
if [ "$1" = "clean" ]; then
|
if [ "$1" = "clean" ]; then
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
COMPILE = $(CC) $(CFLAGS)
|
COMPILE = $(CC) $(CFLAGS)
|
||||||
INC_PATH =
|
INC_PATH =
|
||||||
LIB_PATH = $(LIBS)
|
LIB_PATH = $(LIBS)
|
||||||
|
TARGET_LIB = $(TARGET_PREFIX)/$(LIB_VERSION)
|
||||||
|
|
||||||
FAST_SHARED_OBJS = hash.lo chain.lo shared_func.lo ini_file_reader.lo \
|
FAST_SHARED_OBJS = hash.lo chain.lo shared_func.lo ini_file_reader.lo \
|
||||||
logger.lo sockopt.lo base64.lo sched_thread.lo \
|
logger.lo sockopt.lo base64.lo sched_thread.lo \
|
||||||
|
|
@ -59,11 +60,13 @@ libfastcommon.a: $(FAST_STATIC_OBJS)
|
||||||
.c.lo:
|
.c.lo:
|
||||||
$(COMPILE) -c -fPIC -o $@ $< $(INC_PATH)
|
$(COMPILE) -c -fPIC -o $@ $< $(INC_PATH)
|
||||||
install:
|
install:
|
||||||
mkdir -p $(DESTDIR)/usr/$(LIB_VERSION)
|
mkdir -p $(TARGET_LIB)
|
||||||
mkdir -p $(DESTDIR)/usr/lib
|
mkdir -p $(TARGET_PREFIX)/lib
|
||||||
install -m 755 $(SHARED_LIBS) $(DESTDIR)/usr/$(LIB_VERSION)
|
mkdir -p $(TARGET_PREFIX)/include/fastcommon
|
||||||
mkdir -p $(DESTDIR)/usr/include/fastcommon
|
|
||||||
install -m 644 $(HEADER_FILES) $(DESTDIR)/usr/include/fastcommon
|
install -m 755 $(SHARED_LIBS) $(TARGET_LIB)
|
||||||
|
install -m 644 $(HEADER_FILES) $(TARGET_PREFIX)/include/fastcommon
|
||||||
|
if [ ! -e $(TARGET_PREFIX)/lib/libfastcommon.so ]; then ln -s $(TARGET_LIB)/libfastcommon.so $(TARGET_PREFIX)/lib/libfastcommon.so; fi
|
||||||
clean:
|
clean:
|
||||||
rm -f $(ALL_OBJS) $(ALL_PRGS) $(ALL_LIBS)
|
rm -f $(ALL_OBJS) $(ALL_PRGS) $(ALL_LIBS)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
.SUFFIXES: .c .o
|
.SUFFIXES: .c .o
|
||||||
|
|
||||||
COMPILE = $(CC) -g -O1 -Wall -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG
|
COMPILE = $(CC) -g -O1 -Wall -D_FILE_OFFSET_BITS=64 -g -DDEBUG_FLAG
|
||||||
INC_PATH = -I/usr/include/fastcommon
|
INC_PATH = -I/usr/local/include
|
||||||
LIB_PATH = -lfastcommon -lpthread
|
LIB_PATH = -lfastcommon -lpthread
|
||||||
|
|
||||||
ALL_PRGS = test_allocator test_skiplist test_multi_skiplist test_mblock test_blocked_queue \
|
ALL_PRGS = test_allocator test_skiplist test_multi_skiplist test_mblock test_blocked_queue \
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,11 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include "logger.h"
|
#include "fastcommon/logger.h"
|
||||||
#include "shared_func.h"
|
#include "fastcommon/shared_func.h"
|
||||||
#include "sched_thread.h"
|
#include "fastcommon/sched_thread.h"
|
||||||
#include "ini_file_reader.h"
|
#include "fastcommon/ini_file_reader.h"
|
||||||
#include "fast_allocator.h"
|
#include "fastcommon/fast_allocator.h"
|
||||||
|
|
||||||
#define OUTER_LOOP_COUNT 128
|
#define OUTER_LOOP_COUNT 128
|
||||||
#define INNER_LOOP_COUNT 1024 * 64
|
#define INNER_LOOP_COUNT 1024 * 64
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,12 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include "logger.h"
|
#include "fastcommon/logger.h"
|
||||||
#include "shared_func.h"
|
#include "fastcommon/shared_func.h"
|
||||||
#include "sched_thread.h"
|
#include "fastcommon/sched_thread.h"
|
||||||
#include "ini_file_reader.h"
|
#include "fastcommon/ini_file_reader.h"
|
||||||
#include "fast_task_queue.h"
|
#include "fastcommon/fast_task_queue.h"
|
||||||
#include "fast_blocked_queue.h"
|
#include "fastcommon/fast_blocked_queue.h"
|
||||||
|
|
||||||
static bool g_continue_flag = true;
|
static bool g_continue_flag = true;
|
||||||
static int64_t produce_count = 0;
|
static int64_t produce_count = 0;
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "logger.h"
|
#include "fastcommon/logger.h"
|
||||||
#include "char_convert_loader.h"
|
#include "fastcommon/char_convert_loader.h"
|
||||||
#include "char_converter.h"
|
#include "fastcommon/char_converter.h"
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "logger.h"
|
#include "fastcommon/logger.h"
|
||||||
#include "ini_file_reader.h"
|
#include "fastcommon/ini_file_reader.h"
|
||||||
#include "char_convert_loader.h"
|
#include "fastcommon/char_convert_loader.h"
|
||||||
#include "char_converter.h"
|
#include "fastcommon/char_converter.h"
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,12 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "logger.h"
|
#include "fastcommon/logger.h"
|
||||||
#include "shared_func.h"
|
#include "fastcommon/shared_func.h"
|
||||||
#include "sched_thread.h"
|
#include "fastcommon/sched_thread.h"
|
||||||
#include "ini_file_reader.h"
|
#include "fastcommon/ini_file_reader.h"
|
||||||
#include "sockopt.h"
|
#include "fastcommon/sockopt.h"
|
||||||
#include "id_generator.h"
|
#include "fastcommon/id_generator.h"
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "logger.h"
|
#include "fastcommon/logger.h"
|
||||||
#include "shared_func.h"
|
#include "fastcommon/shared_func.h"
|
||||||
#include "ini_file_reader.h"
|
#include "fastcommon/ini_file_reader.h"
|
||||||
|
|
||||||
static int iniAnnotationFuncExpressCalc(char *param, char **pOutValue, int max_values)
|
static int iniAnnotationFuncExpressCalc(char *param, char **pOutValue, int max_values)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "logger.h"
|
#include "fastcommon/logger.h"
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,14 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "logger.h"
|
#include "fastcommon/logger.h"
|
||||||
#include "shared_func.h"
|
#include "fastcommon/shared_func.h"
|
||||||
#include "sched_thread.h"
|
#include "fastcommon/sched_thread.h"
|
||||||
#include "ini_file_reader.h"
|
#include "fastcommon/ini_file_reader.h"
|
||||||
#include "fast_mblock.h"
|
#include "fastcommon/fast_mblock.h"
|
||||||
#include "sockopt.h"
|
#include "fastcommon/sockopt.h"
|
||||||
#include "system_info.h"
|
#include "fastcommon/system_info.h"
|
||||||
#include "local_ip_func.h"
|
#include "fastcommon/local_ip_func.h"
|
||||||
|
|
||||||
struct my_struct {
|
struct my_struct {
|
||||||
struct fast_mblock_man *mblock;
|
struct fast_mblock_man *mblock;
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include "multi_skiplist.h"
|
#include "fastcommon/multi_skiplist.h"
|
||||||
#include "logger.h"
|
#include "fastcommon/logger.h"
|
||||||
#include "shared_func.h"
|
#include "fastcommon/shared_func.h"
|
||||||
|
|
||||||
#define COUNT 1000000
|
#define COUNT 1000000
|
||||||
#define LEVEL_COUNT 16
|
#define LEVEL_COUNT 16
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include "skiplist.h"
|
#include "fastcommon/skiplist.h"
|
||||||
#include "logger.h"
|
#include "fastcommon/logger.h"
|
||||||
#include "shared_func.h"
|
#include "fastcommon/shared_func.h"
|
||||||
|
|
||||||
#define COUNT 1000000
|
#define COUNT 1000000
|
||||||
#define LEVEL_COUNT 16
|
#define LEVEL_COUNT 16
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue