make.sh: replace perl with sed

pull/5/head
yuqing 2015-12-25 16:26:26 +08:00
parent 0bb237190d
commit d07af5dda8
3 changed files with 19 additions and 10 deletions

View File

@ -120,9 +120,9 @@ fi
cd src
cp Makefile.in Makefile
perl -pi -e "s#\\\$\(CFLAGS\)#$CFLAGS#g" Makefile
perl -pi -e "s#\\\$\(LIBS\)#$LIBS#g" Makefile
perl -pi -e "s#\\\$\(LIB_VERSION\)#$LIB_VERSION#g" Makefile
sed -i "s/\\\$(CFLAGS)/$CFLAGS/g" Makefile
sed -i "s/\\\$(LIBS)/$LIBS/g" Makefile
sed -i "s/\\\$(LIB_VERSION)/$LIB_VERSION/g" Makefile
make $1 $2 $3
if [ "$1" = "clean" ]; then

View File

@ -3,7 +3,6 @@
COMPILE = $(CC) $(CFLAGS)
INC_PATH =
LIB_PATH = $(LIBS)
LIB_VERSION = $(LIB_VERSION)
FAST_SHARED_OBJS = hash.lo chain.lo shared_func.lo ini_file_reader.lo \
logger.lo sockopt.lo base64.lo sched_thread.lo \

View File

@ -61,6 +61,20 @@ static int test_insert()
return 0;
}
static void test_delete()
{
int i;
int64_t start_time;
int64_t end_time;
start_time = get_current_time_ms();
for (i=1; i<=COUNT; i++) {
assert(skiplist_delete(&sl, &i) == 0);
}
end_time = get_current_time_ms();
printf("delete time used: %"PRId64" ms\n", end_time - start_time);
}
int main(int argc, char *argv[])
{
int i;
@ -97,12 +111,7 @@ int main(int argc, char *argv[])
test_insert();
start_time = get_current_time_ms();
for (i=1; i<=COUNT; i++) {
assert(skiplist_delete(&sl, &i) == 0);
}
end_time = get_current_time_ms();
printf("delete time used: %"PRId64" ms\n", end_time - start_time);
test_delete();
start_time = get_current_time_ms();
for (i=1; i<=COUNT; i++) {
@ -121,6 +130,7 @@ int main(int argc, char *argv[])
test_insert();
test_delete();
skiplist_destroy(&sl);
printf("pass OK\n");