blob: 029918c8110504d2721c8fd771175d89a17f4f4e [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 Sysoevf6906042004-11-25 16:17:31 +00009 $NGX_OBJS/src/imap
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000010
11
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000012ngx_objs_dir=$NGX_OBJS$ngx_regex_dirsep
13ngx_use_pch=`echo $NGX_USE_PCH | sed -e "s/\//$ngx_regex_dirsep/g"`
14
15
Igor Sysoevd43bee82004-11-20 19:52:20 +000016cat << END > $NGX_MAKEFILE
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000017
18CC = $CC
19CFLAGS = $CFLAGS
20CPP = $CPP
21LINK = $LINK
22
23END
24
Igor Sysoevda173ab2006-08-30 10:39:17 +000025if test -n "$NGX_PERL_CFLAGS"; then
26 echo NGX_PERL_CFLAGS = $NGX_PERL_CFLAGS >> $NGX_MAKEFILE
27 echo NGX_PM_CFLAGS = $NGX_PM_CFLAGS >> $NGX_MAKEFILE
28fi
29
Igor Sysoev8a2b2fb2006-04-14 09:53:38 +000030if [ "$BMAKE" = wmake ]; then
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000031 echo MAKE = wmake >> $NGX_MAKEFILE
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000032
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000033 ngx_regex_cont=' '
Igor Sysoev09c684b2005-11-09 17:25:55 +000034 ngx_long_regex_cont=' '
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000035 ngx_cont=' '
Igor Sysoev09c684b2005-11-09 17:25:55 +000036 ngx_long_cont=' '
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000037 ngx_tab=' '
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000038
Igor Sysoevfc5a10a2004-03-09 19:47:07 +000039fi
40
Igor Sysoevfc5a10a2004-03-09 19:47:07 +000041
Igor Sysoev1ebfead2005-02-16 13:40:36 +000042# ALL_INCS, required by the addons and by OpenWatcom C precompiled headers
Igor Sysoevfc5a10a2004-03-09 19:47:07 +000043
Igor Sysoevf6906042004-11-25 16:17:31 +000044ngx_incs=`echo $CORE_INCS $NGX_OBJS $HTTP_INCS $IMAP_INCS\
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000045 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
46 -e "s/\//$ngx_regex_dirsep/g"`
47
48cat << END >> $NGX_MAKEFILE
49
50ALL_INCS = $ngx_include_opt$ngx_incs
51
52END
Igor Sysoev59cf56c2004-09-07 15:29:22 +000053
Igor Sysoevfc5a10a2004-03-09 19:47:07 +000054
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000055ngx_all_srcs="$CORE_SRCS"
Igor Sysoevab9d5fd2004-03-05 08:34:24 +000056
57
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000058# the core dependences and include pathes
Igor Sysoevab9d5fd2004-03-05 08:34:24 +000059
Igor Sysoevd43bee82004-11-20 19:52:20 +000060ngx_deps=`echo $CORE_DEPS $NGX_AUTO_CONFIG_H $NGX_PCH \
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000061 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
62 -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000063
Igor Sysoevf6906042004-11-25 16:17:31 +000064ngx_incs=`echo $CORE_INCS $NGX_OBJS \
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000065 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
66 -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000067
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000068cat << END >> $NGX_MAKEFILE
Igor Sysoevab9d5fd2004-03-05 08:34:24 +000069
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000070CORE_DEPS = $ngx_deps
71
72
73CORE_INCS = $ngx_include_opt$ngx_incs
74
75END
76
77
78# the http dependences and include pathes
Igor Sysoevab9d5fd2004-03-05 08:34:24 +000079
Igor Sysoev59cf56c2004-09-07 15:29:22 +000080if [ $HTTP = YES ]; then
Igor Sysoevab9d5fd2004-03-05 08:34:24 +000081
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000082 ngx_all_srcs="$ngx_all_srcs $HTTP_SRCS"
Igor Sysoevab9d5fd2004-03-05 08:34:24 +000083
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000084 ngx_deps=`echo $HTTP_DEPS \
85 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
86 -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000087
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000088 ngx_incs=`echo $HTTP_INCS \
89 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
90 -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoevab9d5fd2004-03-05 08:34:24 +000091
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000092 cat << END >> $NGX_MAKEFILE
Igor Sysoevab9d5fd2004-03-05 08:34:24 +000093
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000094HTTP_DEPS = $ngx_deps
Igor Sysoev59cf56c2004-09-07 15:29:22 +000095
96
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000097HTTP_INCS = $ngx_include_opt$ngx_incs
Igor Sysoev59cf56c2004-09-07 15:29:22 +000098
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000099END
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000100
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000101fi
102
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000103
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000104# the imap dependences and include pathes
105
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000106if [ $IMAP = YES ]; then
107
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000108 ngx_all_srcs="$ngx_all_srcs $IMAP_SRCS"
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000109
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000110 ngx_deps=`echo $IMAP_DEPS \
111 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
112 -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000113
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000114 ngx_incs=`echo $IMAP_INCS \
115 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
116 -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000117
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000118 cat << END >> $NGX_MAKEFILE
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000119
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000120IMAP_DEPS = $ngx_deps
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000121
122
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000123IMAP_INCS = $ngx_include_opt$ngx_incs
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000124
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000125END
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000126
127fi
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000128
129
Igor Sysoev1ebfead2005-02-16 13:40:36 +0000130if test -n "$NGX_ADDON_SRCS"; then
131
132cat << END >> $NGX_MAKEFILE
133
Igor Sysoeve5733802005-09-08 14:36:09 +0000134ADDON_DEPS = \$(CORE_DEPS) $NGX_ADDON_DEPS
Igor Sysoev1ebfead2005-02-16 13:40:36 +0000135
136END
137
138fi
139
140
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000141# nginx
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000142
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000143ngx_all_srcs=`echo $ngx_all_srcs | sed -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoev1ebfead2005-02-16 13:40:36 +0000144
145for ngx_src in $NGX_ADDON_SRCS
146do
147 ngx_obj="addon/`basename \`dirname $ngx_src\``"
148
149 test -d $NGX_OBJS/$ngx_obj || mkdir -p $NGX_OBJS/$ngx_obj
150
151 ngx_obj=`echo $ngx_obj/\`basename $ngx_src\` \
152 | sed -e "s/\//$ngx_regex_dirsep/g"`
153
154 ngx_all_srcs="$ngx_all_srcs $ngx_obj"
155done
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000156
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000157ngx_all_objs=`echo $ngx_all_srcs \
Igor Sysoevbb28b6d2006-07-11 13:20:19 +0000158 | sed -e "s#\([^ ]*\.\)cpp#$NGX_OBJS\/\1$ngx_objext#g" \
159 -e "s#\([^ ]*\.\)cc#$NGX_OBJS\/\1$ngx_objext#g" \
160 -e "s#\([^ ]*\.\)c#$NGX_OBJS\/\1$ngx_objext#g" \
161 -e "s#\([^ ]*\.\)S#$NGX_OBJS\/\1$ngx_objext#g"`
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000162
Igor Sysoev1ebfead2005-02-16 13:40:36 +0000163ngx_modules_c=`echo $NGX_MODULES_C | sed -e "s/\//$ngx_regex_dirsep/g"`
164
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000165ngx_modules_obj=`echo $ngx_modules_c | sed -e "s/\(.*\.\)c/\1$ngx_objext/"`
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000166
Igor Sysoev1b735832004-11-11 14:07:14 +0000167
168if test -n "$NGX_RES"; then
169 ngx_res=$NGX_RES
170else
171 ngx_res="$NGX_RC $NGX_ICONS"
172 ngx_rcc=`echo $NGX_RCC | sed -e "s/\//$ngx_regex_dirsep/g"`
173fi
174
175ngx_deps=`echo $ngx_all_objs $ngx_modules_obj $ngx_res $LINK_DEPS \
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000176 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
177 -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoeva5362982004-03-04 07:04:55 +0000178
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000179ngx_objs=`echo $ngx_all_objs $ngx_modules_obj \
Igor Sysoev09c684b2005-11-09 17:25:55 +0000180 | sed -e "s/ *\([^ ][^ ]*\)/$ngx_long_regex_cont\1/g" \
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000181 -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000182
Igor Sysoev8f125582006-07-28 15:16:17 +0000183if test -n "$NGX_LD_OPT$CORE_LIBS"; then
184 ngx_libs=`echo $NGX_LD_OPT $CORE_LIBS \
185 | sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`
186fi
Igor Sysoeva5362982004-03-04 07:04:55 +0000187
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000188ngx_link=${CORE_LINK:+`echo $CORE_LINK \
Igor Sysoev09c684b2005-11-09 17:25:55 +0000189 | sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`}
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000190
Igor Sysoev1b735832004-11-11 14:07:14 +0000191
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000192cat << END >> $NGX_MAKEFILE
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000193
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000194$NGX_OBJS${ngx_dirsep}nginx${ngx_binext}: $ngx_deps$ngx_spacer
Igor Sysoev09c684b2005-11-09 17:25:55 +0000195 \$(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 +0000196 $ngx_rcc
Igor Sysoev09c684b2005-11-09 17:25:55 +0000197${ngx_long_end}
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000198END
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000199
200
201# ngx_modules.c
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000202
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000203if test -n "$NGX_PCH"; then
204 ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000205else
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000206 ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) \$(CORE_INCS)"
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000207fi
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000208
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000209cat << END >> $NGX_MAKEFILE
210
211$ngx_modules_obj: \$(CORE_DEPS)$ngx_cont$ngx_modules_c
Igor Sysoev78452232005-10-12 13:50:36 +0000212 $ngx_cc$ngx_tab$ngx_objout$ngx_modules_obj$ngx_tab$ngx_modules_c$NGX_AUX
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000213
214END
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000215
216
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000217# the core sources
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000218
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000219for ngx_src in $CORE_SRCS
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000220do
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000221 ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
222 ngx_obj=`echo $ngx_src \
Igor Sysoevbb28b6d2006-07-11 13:20:19 +0000223 | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
224 -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
225 -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
226 -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000227
228 cat << END >> $NGX_MAKEFILE
229
230$ngx_obj: \$(CORE_DEPS)$ngx_cont$ngx_src
Igor Sysoev78452232005-10-12 13:50:36 +0000231 $ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000232
233END
234
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000235done
236
237
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000238# the http sources
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000239
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000240if [ $HTTP = YES ]; then
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000241
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000242 if test -n "$NGX_PCH"; then
243 ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000244 else
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000245 ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) \$(CORE_INCS) \$(HTTP_INCS)"
Igor Sysoevda173ab2006-08-30 10:39:17 +0000246 ngx_perl_cc="\$(CC) $ngx_compile_opt \$(NGX_PERL_CFLAGS) "
247 ngx_perl_cc="$ngx_perl_cc \$(CORE_INCS) \$(HTTP_INCS)"
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000248 fi
249
Igor Sysoevda173ab2006-08-30 10:39:17 +0000250 for ngx_source in $HTTP_SRCS
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000251 do
Igor Sysoevda173ab2006-08-30 10:39:17 +0000252 ngx_src=`echo $ngx_source | sed -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000253 ngx_obj=`echo $ngx_src \
Igor Sysoevbb28b6d2006-07-11 13:20:19 +0000254 | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
255 -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
256 -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
257 -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000258
Igor Sysoevda173ab2006-08-30 10:39:17 +0000259 if [ $ngx_source = src/http/modules/perl/ngx_http_perl_module.c ]; then
260
261 cat << END >> $NGX_MAKEFILE
262
263$ngx_obj: \$(CORE_DEPS) \$(HTTP_DEPS)$ngx_cont$ngx_src
264 $ngx_perl_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
265
266END
267 else
268
269 cat << END >> $NGX_MAKEFILE
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000270
271$ngx_obj: \$(CORE_DEPS) \$(HTTP_DEPS)$ngx_cont$ngx_src
Igor Sysoev78452232005-10-12 13:50:36 +0000272 $ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000273
274END
Igor Sysoevda173ab2006-08-30 10:39:17 +0000275
276 fi
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000277 done
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000278
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000279fi
Igor Sysoeva8fa0a62003-11-25 20:44:56 +0000280
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000281
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000282# the imap sources
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000283
284if [ $IMAP = YES ]; then
285
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000286 if test -n "$NGX_PCH"; then
287 ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000288 else
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000289 ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) \$(CORE_INCS) \$(IMAP_INCS)"
Igor Sysoevab9d5fd2004-03-05 08:34:24 +0000290 fi
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000291
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000292 for ngx_src in $IMAP_SRCS
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000293 do
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000294 ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
295 ngx_obj=`echo $ngx_src \
Igor Sysoevbb28b6d2006-07-11 13:20:19 +0000296 | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
297 -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
298 -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
299 -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000300
301 cat << END >> $NGX_MAKEFILE
302
303$ngx_obj: \$(CORE_DEPS) \$(IMAP_DEPS)$ngx_cont$ngx_src
Igor Sysoev78452232005-10-12 13:50:36 +0000304 $ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000305
306END
Igor Sysoev1ebfead2005-02-16 13:40:36 +0000307 done
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000308
Igor Sysoev1ebfead2005-02-16 13:40:36 +0000309fi
310
311
312# the addons sources
313
314if test -n "$NGX_ADDON_SRCS"; then
315
316 ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
317
318 for ngx_src in $NGX_ADDON_SRCS
319 do
320 ngx_obj="addon/`basename \`dirname $ngx_src\``"
321
322 ngx_obj=`echo $ngx_obj/\`basename $ngx_src\` \
323 | sed -e "s/\//$ngx_regex_dirsep/g"`
324
325 ngx_obj=`echo $ngx_obj \
Igor Sysoevbb28b6d2006-07-11 13:20:19 +0000326 | 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"`
Igor Sysoev1ebfead2005-02-16 13:40:36 +0000330
331 ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
332
333 cat << END >> $NGX_MAKEFILE
334
335$ngx_obj: \$(ADDON_DEPS)$ngx_cont$ngx_src
Igor Sysoev78452232005-10-12 13:50:36 +0000336 $ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
Igor Sysoev1ebfead2005-02-16 13:40:36 +0000337
338END
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000339 done
Igor Sysoev59cf56c2004-09-07 15:29:22 +0000340
341fi
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000342
343
Igor Sysoev305a9d82005-12-26 17:07:48 +0000344# the addons config.make
345
346if test -n "$NGX_ADDONS"; then
347
348 for ngx_addon_dir in $NGX_ADDONS
349 do
350 if test -f $ngx_addon_dir/config.make; then
351 . $ngx_addon_dir/config.make
352 fi
353 done
354fi
355
356
Igor Sysoev1b735832004-11-11 14:07:14 +0000357# Win32 resource file
358
359if test -n "$NGX_RES"; then
360
361 ngx_res=`echo "$NGX_RES: $NGX_RC $NGX_ICONS" \
362 | sed -e "s/\//$ngx_regex_dirsep/g"`
363 ngx_rcc=`echo $NGX_RCC | sed -e "s/\//$ngx_regex_dirsep/g"`
364
365 cat << END >> $NGX_MAKEFILE
366
367$ngx_res
368 $ngx_rcc
369
370END
371
372fi
373
374
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000375# the precompiled headers
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000376
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000377if test -n "$NGX_PCH"; then
Igor Sysoevf6906042004-11-25 16:17:31 +0000378 echo "#include <ngx_config.h>" > $NGX_OBJS/ngx_pch.c
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000379
Igor Sysoevf6906042004-11-25 16:17:31 +0000380 ngx_pch="src/core/ngx_config.h $OS_CONFIG $NGX_OBJS/ngx_auto_config.h"
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000381 ngx_pch=`echo "$NGX_PCH: $ngx_pch" | sed -e "s/\//$ngx_regex_dirsep/g"`
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000382
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000383 ngx_src="\$(CC) \$(CFLAGS) $NGX_BUILD_PCH $ngx_compile_opt \$(ALL_INCS)"
Igor Sysoevf6906042004-11-25 16:17:31 +0000384 ngx_src="$ngx_src $ngx_objout$NGX_OBJS/ngx_pch.obj $NGX_OBJS/ngx_pch.c"
Igor Sysoevc0edbcc2004-10-21 15:34:38 +0000385 ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
386
387 cat << END >> $NGX_MAKEFILE
388
389$ngx_pch
390 $ngx_src
391
392END
393
Igor Sysoevfc5a10a2004-03-09 19:47:07 +0000394fi