make.sh: replace perl with sed
parent
0bb237190d
commit
d07af5dda8
6
make.sh
6
make.sh
|
|
@ -120,9 +120,9 @@ fi
|
||||||
|
|
||||||
cd src
|
cd src
|
||||||
cp Makefile.in Makefile
|
cp Makefile.in Makefile
|
||||||
perl -pi -e "s#\\\$\(CFLAGS\)#$CFLAGS#g" Makefile
|
sed -i "s/\\\$(CFLAGS)/$CFLAGS/g" Makefile
|
||||||
perl -pi -e "s#\\\$\(LIBS\)#$LIBS#g" Makefile
|
sed -i "s/\\\$(LIBS)/$LIBS/g" Makefile
|
||||||
perl -pi -e "s#\\\$\(LIB_VERSION\)#$LIB_VERSION#g" Makefile
|
sed -i "s/\\\$(LIB_VERSION)/$LIB_VERSION/g" Makefile
|
||||||
make $1 $2 $3
|
make $1 $2 $3
|
||||||
|
|
||||||
if [ "$1" = "clean" ]; then
|
if [ "$1" = "clean" ]; then
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
COMPILE = $(CC) $(CFLAGS)
|
COMPILE = $(CC) $(CFLAGS)
|
||||||
INC_PATH =
|
INC_PATH =
|
||||||
LIB_PATH = $(LIBS)
|
LIB_PATH = $(LIBS)
|
||||||
LIB_VERSION = $(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 \
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,20 @@ static int test_insert()
|
||||||
return 0;
|
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 main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
@ -97,12 +111,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
test_insert();
|
test_insert();
|
||||||
|
|
||||||
start_time = get_current_time_ms();
|
test_delete();
|
||||||
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);
|
|
||||||
|
|
||||||
start_time = get_current_time_ms();
|
start_time = get_current_time_ms();
|
||||||
for (i=1; i<=COUNT; i++) {
|
for (i=1; i<=COUNT; i++) {
|
||||||
|
|
@ -121,6 +130,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
test_insert();
|
test_insert();
|
||||||
|
|
||||||
|
test_delete();
|
||||||
skiplist_destroy(&sl);
|
skiplist_destroy(&sl);
|
||||||
|
|
||||||
printf("pass OK\n");
|
printf("pass OK\n");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue