nginx/auto/make

265 lines
7.9 KiB
Plaintext
Raw Normal View History

2003-11-25 14:44:56 -06:00
mkdir -p $OBJS/src/core $OBJS/src/event $OBJS/src/event/modules \
$OBJS/src/os/unix $OBJS/src/os/win32 \
$OBJS/src/http $OBJS/src/http/modules $OBJS/src/http/modules/proxy
2004-03-05 02:34:24 -06:00
echo "CC = $CC" > $MAKEFILE
echo "CFLAGS = $CFLAGS" >> $MAKEFILE
echo >> $MAKEFILE
2003-11-25 14:44:56 -06:00
2004-03-05 02:34:24 -06:00
# CORE_DEPS
2003-11-25 14:44:56 -06:00
2004-03-05 02:34:24 -06:00
if [ $MAKE_SL = YES ]; then
echo $ngx_n "CORE_DEPS =" $ngx_c >> $MAKEFILE
else
echo "CORE_DEPS = \\" >> $MAKEFILE
fi
for dep in $CORE_DEPS
2003-11-25 14:44:56 -06:00
do
2004-03-05 02:34:24 -06:00
if [ $MAKE_BS = YES ]; then
dep=`echo $dep | sed -e "s/\//\\\\\\/g"`
fi
if [ $MAKE_SL = YES ]; then
echo $ngx_n " $dep" $ngx_c >> $MAKEFILE
else
echo " $dep \\" >> $MAKEFILE
fi
2003-11-25 14:44:56 -06:00
done
2004-03-05 02:34:24 -06:00
echo >> $MAKEFILE
2003-11-25 14:44:56 -06:00
2004-03-05 02:34:24 -06:00
# CORE_INCS
if [ $MAKE_SL = YES ]; then
echo >> $MAKEFILE
fi
2003-11-25 14:44:56 -06:00
2004-03-05 02:34:24 -06:00
inc="$CORE_INCS -I $OBJS"
if [ $INC_EQ = YES ]; then
inc=`echo $inc | sed -e "s/-I /-i=/g"`
fi
2003-11-25 14:44:56 -06:00
2004-03-05 02:34:24 -06:00
if [ $MAKE_BS = YES ]; then
inc=`echo $inc | sed -e "s/\//\\\\\\/g"`
fi
2003-11-25 14:44:56 -06:00
2004-03-05 02:34:24 -06:00
echo "CORE_INCS = $inc" >> $MAKEFILE
echo >> $MAKEFILE
2003-11-25 14:44:56 -06:00
2004-03-05 02:34:24 -06:00
# HTTP_DEPS
if [ $MAKE_SL = YES ]; then
echo $ngx_n "HTTP_DEPS =" $ngx_c >> $MAKEFILE
else
echo "HTTP_DEPS = \\" >> $MAKEFILE
fi
for dep in $HTTP_DEPS
2003-11-25 14:44:56 -06:00
do
2004-03-05 02:34:24 -06:00
if [ $MAKE_BS = YES ]; then
2004-03-04 01:04:55 -06:00
dep=`echo $dep | sed -e "s/\//\\\\\\/g"`
fi
2004-03-05 02:34:24 -06:00
if [ $MAKE_SL = YES ]; then
echo $ngx_n " $dep" $ngx_c >> $MAKEFILE
else
echo " $dep \\" >> $MAKEFILE
fi
2003-11-25 14:44:56 -06:00
done
2004-03-05 02:34:24 -06:00
echo >> $MAKEFILE
2003-11-25 14:44:56 -06:00
2004-03-05 02:34:24 -06:00
# HTTP_INCS
if [ $MAKE_SL = YES ]; then
echo >> $MAKEFILE
2004-03-04 10:34:23 -06:00
fi
2003-11-25 14:44:56 -06:00
2004-03-05 02:34:24 -06:00
inc="$HTTP_INCS -I $OBJS"
if [ $INC_EQ = YES ]; then
inc=`echo $inc | sed -e "s/-I /-i=/g"`
fi
2003-11-25 14:44:56 -06:00
2004-03-05 02:34:24 -06:00
if [ $MAKE_BS = YES ]; then
2004-03-04 10:34:23 -06:00
inc=`echo $inc | sed -e "s/\//\\\\\\/g"`
fi
2003-11-25 14:44:56 -06:00
2004-03-05 02:34:24 -06:00
echo "HTTP_INCS = $inc" >> $MAKEFILE
echo >> $MAKEFILE
2003-11-25 14:44:56 -06:00
2004-03-05 02:34:24 -06:00
# nginx
if [ $MAKE_SL = YES ]; then
echo $ngx_n "nginx: " $ngx_c >> $MAKEFILE
else
echo "nginx: \\" >> $MAKEFILE
fi
# nginx deps
2003-11-25 14:44:56 -06:00
for src in $CORE_SRCS $HTTP_SRCS
do
2004-02-24 11:31:46 -06:00
obj=`echo $src | sed -e "s/\.c\$/.$OBJEXT/" -e "s/\.S\$/.$OBJEXT/"`
2004-03-04 01:04:55 -06:00
obj="$OBJS/$obj"
2004-03-05 02:34:24 -06:00
if [ $MAKE_BS = YES ]; then
2004-03-04 01:04:55 -06:00
obj=`echo $obj | sed -e "s/\//\\\\\\/g"`
fi
2004-03-05 02:34:24 -06:00
if [ $MAKE_SL = YES ]; then
echo $ngx_n " $obj" $ngx_c >> $MAKEFILE
else
echo " $obj \\" >> $MAKEFILE
fi
2003-11-25 14:44:56 -06:00
done
for src in $NGX_MODULES_C $LINK_DEPS
do
obj=`echo $src | sed -e "s/\.c\$/.$OBJEXT/"`
2004-03-05 02:34:24 -06:00
if [ $MAKE_BS = YES ]; then
2004-03-04 01:04:55 -06:00
obj=`echo $obj | sed -e "s/\//\\\\\\/g"`
fi
2004-03-05 02:34:24 -06:00
if [ $MAKE_SL = YES ]; then
echo $ngx_n " $obj" $ngx_c >> $MAKEFILE
else
echo " $obj \\" >> $MAKEFILE
fi
2003-11-25 14:44:56 -06:00
done
2004-03-05 02:34:24 -06:00
echo >> $MAKEFILE
# nginx build
if [ $MAKE_SL = YES ]; then
echo $ngx_n " \$(CC) ${BINOUT}nginx" $ngx_c >> $MAKEFILE
else
echo " \$(CC) ${BINOUT}nginx \\" >> $MAKEFILE
fi
2003-11-25 14:44:56 -06:00
2004-03-05 02:34:24 -06:00
# nginx build sources
2003-11-25 14:44:56 -06:00
for src in $CORE_SRCS $HTTP_SRCS
do
2004-02-24 11:31:46 -06:00
obj=`echo $src | sed -e "s/\.c\$/.$OBJEXT/" -e "s/\.S\$/.$OBJEXT/"`
2004-03-04 01:04:55 -06:00
obj="$OBJS/$obj"
2004-03-05 02:34:24 -06:00
if [ $MAKE_BS = YES ]; then
2004-03-04 01:04:55 -06:00
obj=`echo $obj | sed -e "s/\//\\\\\\/g"`
fi
2004-03-05 02:34:24 -06:00
if [ $MAKE_SL = YES ]; then
echo $ngx_n " $obj," $ngx_c >> $MAKEFILE
else
echo " $obj \\" >> $MAKEFILE
fi
2003-11-25 14:44:56 -06:00
done
2004-03-05 02:34:24 -06:00
# nginx build ngx_modules.c and libs
2003-11-25 14:44:56 -06:00
obj=`echo $NGX_MODULES_C | sed -e "s/\.c\$/.$OBJEXT/"`
2004-03-05 02:34:24 -06:00
libs=`echo $CORE_LIBS | sed -e "s/\.c\$/.$OBJEXT/"`
src=$NGX_MODULES_C
if [ $MAKE_BS = YES ]; then
2004-03-04 01:04:55 -06:00
obj=`echo $obj | sed -e "s/\//\\\\\\/g"`
2004-03-05 02:34:24 -06:00
src=`echo $src | sed -e "s/\//\\\\\\/g"`
libs=`echo $libs | sed -e "s/\//\\\\\\/g"`
2004-03-04 01:04:55 -06:00
fi
2003-11-25 14:44:56 -06:00
2004-03-05 02:34:24 -06:00
if [ $MAKE_SL = YES ]; then
echo " $obj $libs $CORE_LINK" >> $MAKEFILE
echo >> $MAKEFILE
else
echo " $obj \\" >> $MAKEFILE
echo " $CORE_LIBS \\" >> $MAKEFILE
echo " $CORE_LINK" >> $MAKEFILE
echo >> $MAKEFILE
fi
# ngx_modules.c
2003-11-25 14:44:56 -06:00
deps="\$(CORE_DEPS)"
args="\$(CFLAGS) \$(CORE_INCS)"
2004-03-05 02:34:24 -06:00
if [ $MAKE_SL = YES ]; then
echo "$obj: $NGX_MODULES_C $deps" >> $MAKEFILE
echo $ngx_n " \$(CC) $COMPILEONLY $args" $ngx_c >> $MAKEFILE
echo " $OBJOUT$obj $src" >> $MAKEFILE
echo >> $MAKEFILE
else
echo "$obj: \\" >> $MAKEFILE
echo " $NGX_MODULES_C $deps" >> $MAKEFILE
echo " \$(CC) $COMPILEONLY $args \\" >> $MAKEFILE
echo " $OBJOUT$obj \\" >> $MAKEFILE
echo " $src" >> $MAKEFILE
echo >> $MAKEFILE
fi
2003-11-25 14:44:56 -06:00
2004-03-05 02:34:24 -06:00
# core sources
2003-11-25 14:44:56 -06:00
for src in $CORE_SRCS
do
2004-02-24 11:31:46 -06:00
obj=`echo $src | sed -e "s/\.c\$/.$OBJEXT/" -e "s/\.S\$/.$OBJEXT/"`
2004-03-05 02:34:24 -06:00
obj="$OBJS/$obj"
if [ $MAKE_BS = YES ]; then
obj=`echo $obj | sed -e "s/\//\\\\\\/g"`
src=`echo $src | sed -e "s/\//\\\\\\/g"`
fi
2003-11-25 14:44:56 -06:00
2004-03-05 02:34:24 -06:00
if [ $MAKE_SL = YES ]; then
echo "$obj: $src $deps" >> $MAKEFILE
echo " \$(CC) $COMPILEONLY $args $OBJOUT$obj $src" >> $MAKEFILE
echo >> $MAKEFILE
else
echo "$obj: \\" >> $MAKEFILE
echo " $src $deps" >> $MAKEFILE
echo " \$(CC) $COMPILEONLY $args \\" >> $MAKEFILE
echo " $OBJOUT$obj \\" >> $MAKEFILE
echo " $src" >> $MAKEFILE
echo >> $MAKEFILE
fi
2003-11-25 14:44:56 -06:00
done
2004-03-05 02:34:24 -06:00
# http sources
2003-11-25 14:44:56 -06:00
deps="\$(CORE_DEPS) \$(HTTP_DEPS)"
args="\$(CFLAGS) \$(CORE_INCS) \$(HTTP_INCS)"
for src in $HTTP_SRCS
do
obj=`echo $src | sed -e "s/\.c\$/.$OBJEXT/"`
2004-03-05 02:34:24 -06:00
obj="$OBJS/$obj"
2003-11-25 14:44:56 -06:00
2004-03-05 02:34:24 -06:00
if [ $MAKE_BS = YES ]; then
obj=`echo $obj | sed -e "s/\//\\\\\\/g"`
src=`echo $src | sed -e "s/\//\\\\\\/g"`
fi
if [ $MAKE_SL = YES ]; then
echo "$obj: $src $deps" >> $MAKEFILE
echo " \$(CC) $COMPILEONLY $args $OBJOUT$obj $src" >> $MAKEFILE
echo >> $MAKEFILE
else
echo "$obj: \\" >> $MAKEFILE
echo " $src $deps" >> $MAKEFILE
echo " \$(CC) $COMPILEONLY $args \\" >> $MAKEFILE
echo " $OBJOUT$obj \\" >> $MAKEFILE
echo " $src" >> $MAKEFILE
echo >> $MAKEFILE
fi
2003-11-25 14:44:56 -06:00
done