blob: 2c827a3111c178866a20eca4a0814762f48d6652 [file] [log] [blame]
Igor Sysoeva8fa0a62003-11-25 20:44:56 +00001
Igor Sysoevff8da912004-09-29 16:00:49 +00002# Copyright (C) Igor Sysoev
3
4
Igor Sysoevf6906042004-11-25 16:17:31 +00005mkdir -p $NGX_OBJS/src/core $NGX_OBJS/src/event $NGX_OBJS/src/event/modules \
6 $NGX_OBJS/src/os/unix $NGX_OBJS/src/os/win32 \
7 $NGX_OBJS/src/http $NGX_OBJS/src/http/modules \
Igor Sysoev9bf11aa2006-01-16 14:56:53 +00008 $NGX_OBJS/src/http/modules/perl \
Igor Sysoev85dd8fc2008-03-18 10:36:27 +00009 $NGX_OBJS/src/mail \
10 $NGX_OBJS/src/misc
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000011
12
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000013ngx_objs_dir=$NGX_OBJS$ngx_regex_dirsep
14ngx_use_pch=`echo $NGX_USE_PCH | sed -e "s/\//$ngx_regex_dirsep/g"`
15
16
Igor Sysoevd43bee82004-11-20 19:52:20 +000017cat << END > $NGX_MAKEFILE
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000018
19CC = $CC
20CFLAGS = $CFLAGS
21CPP = $CPP
22LINK = $LINK
23
24END
25
Igor Sysoevda173ab2006-08-30 10:39:17 +000026if test -n "$NGX_PERL_CFLAGS"; then
27 echo NGX_PERL_CFLAGS = $NGX_PERL_CFLAGS >> $NGX_MAKEFILE
28 echo NGX_PM_CFLAGS = $NGX_PM_CFLAGS >> $NGX_MAKEFILE
29fi
30
Igor Sysoev8a2b2fb2006-04-14 09:53:38 +000031if [ "$BMAKE" = wmake ]; then
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000032 echo MAKE = wmake >> $NGX_MAKEFILE
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000033
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000034 ngx_regex_cont=' '
Igor Sysoev09c684b2005-11-09 17:25:55 +000035 ngx_long_regex_cont=' '
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000036 ngx_cont=' '
Igor Sysoev09c684b2005-11-09 17:25:55 +000037 ngx_long_cont=' '
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000038 ngx_tab=' '
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000039
Igor Sysoevfc5a10a2004-03-09 19:47:07 +000040fi
41
Igor Sysoevfc5a10a2004-03-09 19:47:07 +000042
Igor Sysoev1ebfead2005-02-16 13:40:36 +000043# ALL_INCS, required by the addons and by OpenWatcom C precompiled headers
Igor Sysoevfc5a10a2004-03-09 19:47:07 +000044
Igor Sysoev02c8d182007-03-19 13:36:56 +000045ngx_incs=`echo $CORE_INCS $NGX_OBJS $HTTP_INCS $MAIL_INCS\
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000046 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
47 -e "s/\//$ngx_regex_dirsep/g"`
48
49cat << END >> $NGX_MAKEFILE
50
51ALL_INCS = $ngx_include_opt$ngx_incs
52
53END
Igor Sysoev59cf56c2004-09-07 15:29:22 +000054
Igor Sysoevfc5a10a2004-03-09 19:47:07 +000055
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000056ngx_all_srcs="$CORE_SRCS"
Igor Sysoevab9d5fd2004-03-05 08:34:24 +000057
58
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000059# the core dependences and include pathes
Igor Sysoevab9d5fd2004-03-05 08:34:24 +000060
Igor Sysoevd43bee82004-11-20 19:52:20 +000061ngx_deps=`echo $CORE_DEPS $NGX_AUTO_CONFIG_H $NGX_PCH \
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000062 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
63 -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000064
Igor Sysoevf6906042004-11-25 16:17:31 +000065ngx_incs=`echo $CORE_INCS $NGX_OBJS \
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000066 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
67 -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000068
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000069cat << END >> $NGX_MAKEFILE
Igor Sysoevab9d5fd2004-03-05 08:34:24 +000070
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000071CORE_DEPS = $ngx_deps
72
73
74CORE_INCS = $ngx_include_opt$ngx_incs
75
76END
77
78
79# the http dependences and include pathes
Igor Sysoevab9d5fd2004-03-05 08:34:24 +000080
Igor Sysoev59cf56c2004-09-07 15:29:22 +000081if [ $HTTP = YES ]; then
Igor Sysoevab9d5fd2004-03-05 08:34:24 +000082
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000083 ngx_all_srcs="$ngx_all_srcs $HTTP_SRCS"
Igor Sysoevab9d5fd2004-03-05 08:34:24 +000084
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000085 ngx_deps=`echo $HTTP_DEPS \
86 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
87 -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000088
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000089 ngx_incs=`echo $HTTP_INCS \
90 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
91 -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoevab9d5fd2004-03-05 08:34:24 +000092
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000093 cat << END >> $NGX_MAKEFILE
Igor Sysoevab9d5fd2004-03-05 08:34:24 +000094
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000095HTTP_DEPS = $ngx_deps
Igor Sysoev59cf56c2004-09-07 15:29:22 +000096
97
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000098HTTP_INCS = $ngx_include_opt$ngx_incs
Igor Sysoev59cf56c2004-09-07 15:29:22 +000099
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000100END
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000101
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000102fi
103
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000104
Igor Sysoev02c8d182007-03-19 13:36:56 +0000105# the mail dependences and include pathes
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000106
Igor Sysoev02c8d182007-03-19 13:36:56 +0000107if [ $MAIL = YES ]; then
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000108
Igor Sysoev02c8d182007-03-19 13:36:56 +0000109 ngx_all_srcs="$ngx_all_srcs $MAIL_SRCS"
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000110
Igor Sysoev02c8d182007-03-19 13:36:56 +0000111 ngx_deps=`echo $MAIL_DEPS \
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000112 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
113 -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000114
Igor Sysoev02c8d182007-03-19 13:36:56 +0000115 ngx_incs=`echo $MAIL_INCS \
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000116 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
117 -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000118
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000119 cat << END >> $NGX_MAKEFILE
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000120
Igor Sysoev02c8d182007-03-19 13:36:56 +0000121MAIL_DEPS = $ngx_deps
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000122
123
Igor Sysoev02c8d182007-03-19 13:36:56 +0000124MAIL_INCS = $ngx_include_opt$ngx_incs
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000125
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000126END
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000127
128fi
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000129
130
Igor Sysoev85dd8fc2008-03-18 10:36:27 +0000131ngx_all_srcs="$ngx_all_srcs $NGX_MISC_SRCS"
132
133
Igor Sysoev1ebfead2005-02-16 13:40:36 +0000134if test -n "$NGX_ADDON_SRCS"; then
135
136cat << END >> $NGX_MAKEFILE
137
Igor Sysoeve5733802005-09-08 14:36:09 +0000138ADDON_DEPS = \$(CORE_DEPS) $NGX_ADDON_DEPS
Igor Sysoev1ebfead2005-02-16 13:40:36 +0000139
140END
141
142fi
143
144
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000145# nginx
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000146
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000147ngx_all_srcs=`echo $ngx_all_srcs | sed -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoev1ebfead2005-02-16 13:40:36 +0000148
149for ngx_src in $NGX_ADDON_SRCS
150do
151 ngx_obj="addon/`basename \`dirname $ngx_src\``"
152
153 test -d $NGX_OBJS/$ngx_obj || mkdir -p $NGX_OBJS/$ngx_obj
154
155 ngx_obj=`echo $ngx_obj/\`basename $ngx_src\` \
156 | sed -e "s/\//$ngx_regex_dirsep/g"`
157
158 ngx_all_srcs="$ngx_all_srcs $ngx_obj"
159done
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000160
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000161ngx_all_objs=`echo $ngx_all_srcs \
Igor Sysoevbb28b6d2006-07-11 13:20:19 +0000162 | sed -e "s#\([^ ]*\.\)cpp#$NGX_OBJS\/\1$ngx_objext#g" \
163 -e "s#\([^ ]*\.\)cc#$NGX_OBJS\/\1$ngx_objext#g" \
164 -e "s#\([^ ]*\.\)c#$NGX_OBJS\/\1$ngx_objext#g" \
165 -e "s#\([^ ]*\.\)S#$NGX_OBJS\/\1$ngx_objext#g"`
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000166
Igor Sysoev1ebfead2005-02-16 13:40:36 +0000167ngx_modules_c=`echo $NGX_MODULES_C | sed -e "s/\//$ngx_regex_dirsep/g"`
168
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000169ngx_modules_obj=`echo $ngx_modules_c | sed -e "s/\(.*\.\)c/\1$ngx_objext/"`
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000170
Igor Sysoev1b735832004-11-11 14:07:14 +0000171
172if test -n "$NGX_RES"; then
173 ngx_res=$NGX_RES
174else
175 ngx_res="$NGX_RC $NGX_ICONS"
176 ngx_rcc=`echo $NGX_RCC | sed -e "s/\//$ngx_regex_dirsep/g"`
177fi
178
179ngx_deps=`echo $ngx_all_objs $ngx_modules_obj $ngx_res $LINK_DEPS \
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000180 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
181 -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoeva5362982004-03-04 07:04:55 +0000182
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000183ngx_objs=`echo $ngx_all_objs $ngx_modules_obj \
Igor Sysoev09c684b2005-11-09 17:25:55 +0000184 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_long_regex_cont\1/g" \
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000185 -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000186
Igor Sysoev8f125582006-07-28 15:16:17 +0000187if test -n "$NGX_LD_OPT$CORE_LIBS"; then
188 ngx_libs=`echo $NGX_LD_OPT $CORE_LIBS \
189 | sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`
190fi
Igor Sysoeva5362982004-03-04 07:04:55 +0000191
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000192ngx_link=${CORE_LINK:+`echo $CORE_LINK \
Igor Sysoev09c684b2005-11-09 17:25:55 +0000193 | sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`}
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000194
Igor Sysoev1b735832004-11-11 14:07:14 +0000195
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000196cat << END >> $NGX_MAKEFILE
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000197
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000198$NGX_OBJS${ngx_dirsep}nginx${ngx_binext}: $ngx_deps$ngx_spacer
Igor Sysoev09c684b2005-11-09 17:25:55 +0000199 \$(LINK) ${ngx_long_start}${ngx_binout}$NGX_OBJS${ngx_dirsep}nginx$ngx_long_cont$ngx_objs$ngx_libs$ngx_link
Igor Sysoev1b735832004-11-11 14:07:14 +0000200 $ngx_rcc
Igor Sysoev09c684b2005-11-09 17:25:55 +0000201${ngx_long_end}
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000202END
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000203
204
205# ngx_modules.c
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000206
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000207if test -n "$NGX_PCH"; then
208 ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000209else
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000210 ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) \$(CORE_INCS)"
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000211fi
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000212
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000213cat << END >> $NGX_MAKEFILE
214
215$ngx_modules_obj: \$(CORE_DEPS)$ngx_cont$ngx_modules_c
Igor Sysoev78452232005-10-12 13:50:36 +0000216 $ngx_cc$ngx_tab$ngx_objout$ngx_modules_obj$ngx_tab$ngx_modules_c$NGX_AUX
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000217
218END
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000219
220
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000221# the core sources
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000222
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000223for ngx_src in $CORE_SRCS
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000224do
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000225 ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
226 ngx_obj=`echo $ngx_src \
Igor Sysoevbb28b6d2006-07-11 13:20:19 +0000227 | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
228 -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
229 -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
230 -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000231
232 cat << END >> $NGX_MAKEFILE
233
234$ngx_obj: \$(CORE_DEPS)$ngx_cont$ngx_src
Igor Sysoev78452232005-10-12 13:50:36 +0000235 $ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000236
237END
238
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000239done
240
241
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000242# the http sources
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000243
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000244if [ $HTTP = YES ]; then
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000245
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000246 if test -n "$NGX_PCH"; then
247 ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000248 else
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000249 ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) \$(CORE_INCS) \$(HTTP_INCS)"
Igor Sysoevda173ab2006-08-30 10:39:17 +0000250 ngx_perl_cc="\$(CC) $ngx_compile_opt \$(NGX_PERL_CFLAGS) "
251 ngx_perl_cc="$ngx_perl_cc \$(CORE_INCS) \$(HTTP_INCS)"
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000252 fi
253
Igor Sysoevda173ab2006-08-30 10:39:17 +0000254 for ngx_source in $HTTP_SRCS
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000255 do
Igor Sysoevda173ab2006-08-30 10:39:17 +0000256 ngx_src=`echo $ngx_source | sed -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000257 ngx_obj=`echo $ngx_src \
Igor Sysoevbb28b6d2006-07-11 13:20:19 +0000258 | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
259 -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
260 -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
261 -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000262
Igor Sysoevda173ab2006-08-30 10:39:17 +0000263 if [ $ngx_source = src/http/modules/perl/ngx_http_perl_module.c ]; then
264
265 cat << END >> $NGX_MAKEFILE
266
267$ngx_obj: \$(CORE_DEPS) \$(HTTP_DEPS)$ngx_cont$ngx_src
268 $ngx_perl_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
269
270END
271 else
272
273 cat << END >> $NGX_MAKEFILE
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000274
275$ngx_obj: \$(CORE_DEPS) \$(HTTP_DEPS)$ngx_cont$ngx_src
Igor Sysoev78452232005-10-12 13:50:36 +0000276 $ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000277
278END
Igor Sysoevda173ab2006-08-30 10:39:17 +0000279
280 fi
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000281 done
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000282
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000283fi
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000284
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000285
Igor Sysoev02c8d182007-03-19 13:36:56 +0000286# the mail sources
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000287
Igor Sysoev02c8d182007-03-19 13:36:56 +0000288if [ $MAIL = YES ]; then
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000289
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000290 if test -n "$NGX_PCH"; then
291 ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000292 else
Igor Sysoev02c8d182007-03-19 13:36:56 +0000293 ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) \$(CORE_INCS) \$(MAIL_INCS)"
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000294 fi
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000295
Igor Sysoev02c8d182007-03-19 13:36:56 +0000296 for ngx_src in $MAIL_SRCS
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000297 do
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000298 ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
299 ngx_obj=`echo $ngx_src \
Igor Sysoevbb28b6d2006-07-11 13:20:19 +0000300 | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
301 -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
302 -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
303 -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000304
305 cat << END >> $NGX_MAKEFILE
306
Igor Sysoev02c8d182007-03-19 13:36:56 +0000307$ngx_obj: \$(CORE_DEPS) \$(MAIL_DEPS)$ngx_cont$ngx_src
Igor Sysoev78452232005-10-12 13:50:36 +0000308 $ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000309
310END
Igor Sysoev1ebfead2005-02-16 13:40:36 +0000311 done
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000312
Igor Sysoev1ebfead2005-02-16 13:40:36 +0000313fi
314
315
Igor Sysoev85dd8fc2008-03-18 10:36:27 +0000316# the misc sources
317
318if test -n "$NGX_MISC_SRCS"; then
319
320 ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
321
322 for ngx_src in $NGX_MISC_SRCS
323 do
324 ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
325 ngx_obj=`echo $ngx_src \
326 | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
327 -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
328 -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
329 -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
330
331 cat << END >> $NGX_MAKEFILE
332
333$ngx_obj: \$(CORE_DEPS) $ngx_cont$ngx_src
334 $ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
335
336END
337 done
338
339fi
340
341
Igor Sysoev1ebfead2005-02-16 13:40:36 +0000342# the addons sources
343
344if test -n "$NGX_ADDON_SRCS"; then
345
346 ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
347
348 for ngx_src in $NGX_ADDON_SRCS
349 do
350 ngx_obj="addon/`basename \`dirname $ngx_src\``"
351
352 ngx_obj=`echo $ngx_obj/\`basename $ngx_src\` \
353 | sed -e "s/\//$ngx_regex_dirsep/g"`
354
355 ngx_obj=`echo $ngx_obj \
Igor Sysoevbb28b6d2006-07-11 13:20:19 +0000356 | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
357 -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
358 -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
359 -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
Igor Sysoev1ebfead2005-02-16 13:40:36 +0000360
361 ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
362
363 cat << END >> $NGX_MAKEFILE
364
365$ngx_obj: \$(ADDON_DEPS)$ngx_cont$ngx_src
Igor Sysoev78452232005-10-12 13:50:36 +0000366 $ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
Igor Sysoev1ebfead2005-02-16 13:40:36 +0000367
368END
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000369 done
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000370
371fi
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000372
373
Igor Sysoev305a9d82005-12-26 17:07:48 +0000374# the addons config.make
375
376if test -n "$NGX_ADDONS"; then
377
378 for ngx_addon_dir in $NGX_ADDONS
379 do
380 if test -f $ngx_addon_dir/config.make; then
381 . $ngx_addon_dir/config.make
382 fi
383 done
384fi
385
386
Igor Sysoev1b735832004-11-11 14:07:14 +0000387# Win32 resource file
388
389if test -n "$NGX_RES"; then
390
391 ngx_res=`echo "$NGX_RES: $NGX_RC $NGX_ICONS" \
392 | sed -e "s/\//$ngx_regex_dirsep/g"`
393 ngx_rcc=`echo $NGX_RCC | sed -e "s/\//$ngx_regex_dirsep/g"`
394
395 cat << END >> $NGX_MAKEFILE
396
397$ngx_res
398 $ngx_rcc
399
400END
401
402fi
403
404
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000405# the precompiled headers
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000406
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000407if test -n "$NGX_PCH"; then
Igor Sysoevf6906042004-11-25 16:17:31 +0000408 echo "#include <ngx_config.h>" > $NGX_OBJS/ngx_pch.c
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000409
Igor Sysoevf6906042004-11-25 16:17:31 +0000410 ngx_pch="src/core/ngx_config.h $OS_CONFIG $NGX_OBJS/ngx_auto_config.h"
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000411 ngx_pch=`echo "$NGX_PCH: $ngx_pch" | sed -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000412
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000413 ngx_src="\$(CC) \$(CFLAGS) $NGX_BUILD_PCH $ngx_compile_opt \$(ALL_INCS)"
Igor Sysoevf6906042004-11-25 16:17:31 +0000414 ngx_src="$ngx_src $ngx_objout$NGX_OBJS/ngx_pch.obj $NGX_OBJS/ngx_pch.c"
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000415 ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
416
417 cat << END >> $NGX_MAKEFILE
418
419$ngx_pch
420 $ngx_src
421
422END
423
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000424fi