[asterisk-commits] rizzo: trunk r89376 - /trunk/Makefile

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Nov 17 05:57:52 CST 2007


Author: rizzo
Date: Sat Nov 17 05:57:52 2007
New Revision: 89376

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89376
Log:
support cygwin targets


Modified:
    trunk/Makefile

Modified: trunk/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/Makefile?view=diff&rev=89376&r1=89375&r2=89376
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Sat Nov 17 05:57:52 2007
@@ -251,9 +251,15 @@
 
 ASTCFLAGS+=$(MALLOC_DEBUG)$(BUSYDETECT)$(OPTIONS)
 
-MOD_SUBDIRS:=res channels pbx apps codecs formats cdr funcs main
+MOD_SUBDIRS:=channels pbx apps codecs formats cdr funcs
 OTHER_SUBDIRS:=utils agi
 SUBDIRS:=$(OTHER_SUBDIRS) $(MOD_SUBDIRS)
+# in cygwin we need to build main (i.e. asterisk.dll) first, then res.
+ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
+  SUBDIRS+= main res
+else
+  OTHER_SUBDIRS += res main
+endif
 SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
 SUBDIRS_CLEAN:=$(SUBDIRS:%=%-clean)
 SUBDIRS_DIST_CLEAN:=$(SUBDIRS:%=%-dist-clean)
@@ -339,12 +345,25 @@
 # a parallel build, since if there are modules selected to be embedded the
 # directories containing them must be completed before the main Asterisk
 # binary can be built
+ifeq ($(findstring $(OSARCH), mingw32 cygwin ),)
 main: $(filter-out main,$(MOD_SUBDIRS))
-
-$(MOD_SUBDIRS):
+else
+SUBDIR_DEPS=main res
+main:
+	@ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" \
+	ASTLDFLAGS="$(ASTLDFLAGS)" AST_LIBS="$(AST_LIBS)" \
+	$(MAKE) --no-print-directory --no-builtin-rules -C $@ SUBDIR=$@ all
+
+res:	main
+	@ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" \
+	ASTLDFLAGS="$(ASTLDFLAGS)" AST_LIBS="$(AST_LIBS)" \
+	$(MAKE) --no-print-directory --no-builtin-rules -C $@ SUBDIR=$@ all
+endif
+
+$(MOD_SUBDIRS): $(SUBDIR_DEPS)
 	@ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(MAKE) --no-print-directory --no-builtin-rules -C $@ SUBDIR=$@ all
 
-$(OTHER_SUBDIRS):
+$(OTHER_SUBDIRS): $(SUBDIR_DEPS)
 	@ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(MAKE) --no-print-directory --no-builtin-rules -C $@ SUBDIR=$@ all
 
 defaults.h: makeopts




More information about the asterisk-commits mailing list