[asterisk-commits] trunk r37273 - in /trunk: ./ agi/ channels/ codecs/ codecs/gsm/ codecs/ilbc/ ...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Jul 6 16:18:46 MST 2006


Author: kpfleming
Date: Thu Jul  6 18:18:45 2006
New Revision: 37273

URL: http://svn.digium.com/view/asterisk?rev=37273&view=rev
Log:
make the build output less noisy (optional, can be controlled by the NOISY_BUILD variable in the top-level Makefile)

Added:
    trunk/channels/chan_vpb.cc
      - copied unchanged from r37212, trunk/channels/chan_vpb.c
Removed:
    trunk/channels/chan_vpb.c
Modified:
    trunk/Makefile
    trunk/Makefile.moddir_rules
    trunk/agi/Makefile
    trunk/channels/Makefile
    trunk/codecs/Makefile
    trunk/codecs/gsm/Makefile
    trunk/codecs/ilbc/Makefile
    trunk/codecs/lpc10/Makefile
    trunk/db1-ast/Makefile
    trunk/pbx/Makefile
    trunk/utils/Makefile

Modified: trunk/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/Makefile?rev=37273&r1=37272&r2=37273&view=diff
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Thu Jul  6 18:18:45 2006
@@ -12,6 +12,9 @@
 #
 
 .EXPORT_ALL_VARIABLES:
+
+#Uncomment this to see all build commands instead of 'quiet' output
+#NOISY_BUILD=yes
 
 # Create OPTIONS variable
 OPTIONS=
@@ -366,6 +369,8 @@
   HAVEDOT=no
 endif
 
+include Makefile.rules
+
 _all: all
 	@echo " +--------- Asterisk Build Complete ---------+"  
 	@echo " + Asterisk has successfully been built, but +"  
@@ -484,16 +489,17 @@
 channel.o: CFLAGS+=$(ZAPTEL_INCLUDE)
 
 asterisk: include/asterisk/buildopts.h editline/libedit.a db1-ast/libdb1.a $(OBJS)
-	build_tools/make_build_h > include/asterisk/build.h.tmp
-	if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \
+	@build_tools/make_build_h > include/asterisk/build.h.tmp
+	@if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \
 		mv include/asterisk/build.h.tmp include/asterisk/build.h ; \
 	fi
-	rm -f include/asterisk/build.h.tmp
-	$(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
-	$(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a $(LIBS)
+	@rm -f include/asterisk/build.h.tmp
+	@$(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
+	@echo "   [LD] $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.1 $(LIBS) -> $@"
+	@$(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a $(LIBS)
 
 muted: muted.o
-	$(CC) $(AUDIO_LIBS) -o muted muted.o
+muted: LDFLAGS+=$(AUDIO_LIBS)
 
 $(SUBDIRS_CLEAN_DEPEND):
 	@$(MAKE) -C $(@:-clean-depend=) clean-depend

Modified: trunk/Makefile.moddir_rules
URL: http://svn.digium.com/view/asterisk/trunk/Makefile.moddir_rules?rev=37273&r1=37272&r2=37273&view=diff
==============================================================================
--- trunk/Makefile.moddir_rules (original)
+++ trunk/Makefile.moddir_rules Thu Jul  6 18:18:45 2006
@@ -11,22 +11,35 @@
 # the GNU General Public License
 #
 
-define module_o_template
+include $(ASTTOPDIR)/Makefile.rules
+
+define module_o_c_template
 $(1).o: $(1).c
-	$$(CC) -c -o $$@ $$< $$(CFLAGS) $$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
+$(1).o: CFLAGS+=$$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
 endef
 
-define module_so_template
-$(1).so: $(1).o
-	$$(CC) $$(SOLINK) -o $$@ $$^ $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
+define module_oo_cc_template
+$(1).oo: $(1).cc
+$(1).oo: CFLAGS+=$$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
 endef
 
-%.o: %.c
-	$(CC) -c -o $@ $< $(CFLAGS)
+define module_so_o_template
+$(1).so: $(1).o
+$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
+endef
 
-$(foreach mod,$(SELECTED_MODS),$(eval $(call module_o_template,$(mod))))
+define module_so_oo_template
+$(1).so: $(1).oo
+$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
+endef
 
-$(foreach mod,$(SELECTED_MODS),$(eval $(call module_so_template,$(mod))))
+$(foreach mod,$(filter-out $(CC_MODS),$(SELECTED_MODS)),$(eval $(call module_o_c_template,$(mod))))
+
+$(foreach mod,$(filter-out $(CC_MODS),$(SELECTED_MODS)),$(eval $(call module_so_o_template,$(mod))))
+
+$(foreach mod,$(filter $(CC_MODS),$(SELECTED_MODS)),$(eval $(call module_oo_cc_template,$(mod))))
+
+$(foreach mod,$(filter $(CC_MODS),$(SELECTED_MODS)),$(eval $(call module_so_oo_template,$(mod))))
 
 .PHONY: clean clean-depend depend uninstall _all
 
@@ -36,7 +49,7 @@
 	rm -f .depend
 
 clean:: clean-depend
-	rm -f *.so *.o
+	rm -f *.so *.o *.oo
 
 install:: all
 	for x in $(SELECTED_MODS:%=%.so); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done

Modified: trunk/agi/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/agi/Makefile?rev=37273&r1=37272&r2=37273&view=diff
==============================================================================
--- trunk/agi/Makefile (original)
+++ trunk/agi/Makefile Thu Jul  6 18:18:45 2006
@@ -15,12 +15,17 @@
 
 AGIS=agi-test.agi eagi-test eagi-sphinx-test jukebox.agi
 
-LIBS=
 ifeq ($(OSARCH),SunOS)
-  LIBS=-lsocket -lnsl ../strcompat.o
+  LDFLAGS+=-lsocket -lnsl ../strcompat.o
 endif
 
+include $(ASTTOPDIR)/Makefile.rules
+
 all: $(AGIS)
+
+eagi-test: eagi-test.o
+
+eagi-sphinx-test: eagi-sphinx-test.o
 
 install: all
 	mkdir -p $(DESTDIR)$(AGI_DIR)
@@ -29,20 +34,11 @@
 uninstall:
 	for x in $(AGIS); do rm -f $(DESTDIR)$(AGI_DIR)/$$x ; done
 
-eagi-test: eagi-test.o
-	$(CC) $(CFLAGS) -include ../include/autoconfig.h -o eagi-test eagi-test.o $(LIBS)
-
-eagi-sphinx-test: eagi-sphinx-test.o
-	$(CC) $(CFLAGS) -include ../include/autoconfig.h -o eagi-sphinx-test eagi-sphinx-test.o $(LIBS) 
-
 clean-depend:
 	rm -f .depend
 
 clean: clean-depend
 	rm -f *.so *.o look eagi-test eagi-sphinx-test
-
-%.so : %.o
-	$(CC) -shared -Xlinker -x -o $@ $<
 
 ifneq ($(wildcard .depend),)
 include .depend

Modified: trunk/channels/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/channels/Makefile?rev=37273&r1=37272&r2=37273&view=diff
==============================================================================
--- trunk/channels/Makefile (original)
+++ trunk/channels/Makefile Thu Jul  6 18:18:45 2006
@@ -14,7 +14,9 @@
   include ../menuselect.makedeps
 endif
 
-SELECTED_MODS:=$(filter-out $(MENUSELECT_CHANNELS),$(patsubst %.c,%,$(wildcard chan_*.c)))
+SELECTED_MODS:=$(filter-out $(MENUSELECT_CHANNELS),$(patsubst %.c,%,$(wildcard chan_*.c)) $(patsubst %.cc,%,$(wildcard chan_*.cc)))
+
+CC_MODS=chan_vpb
 
 ifeq ($(OSARCH),OpenBSD)
   PTLIB=-lpt_OpenBSD_x86_r
@@ -44,8 +46,6 @@
 
 ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/mISDNuser/mISDNlib.h),)
   SELECTED_MODS:=$(filter-out chan_misdn,$(SELECTED_MODS))
-else
-  CFLAGS+=-Imisdn 
 endif
 
 ifndef OPENH323DIR
@@ -56,25 +56,19 @@
   PWLIBDIR=$(HOME)/pwlib
 endif
 
-MENUSELECT_OPTS_chan_misdn+=CHAN_MISDN_VERSION=\"0.3.0\"
-
 all: _all
 
 include $(ASTTOPDIR)/Makefile.moddir_rules
 
 clean::
-	rm -f busy.h ringtone.h gentone gentone-ulaw
+	rm -f busy.h ringtone.h gentone
 
-ifneq ($(wildcard $(ASTTOPDIR)/Makefile.ast),)
-  include $(ASTTOPDIR)/Makefile.ast
+ifneq ($(wildcard $(PWD)/Makefile.ast),)
+  include $(PWD)/Makefile.ast
 endif
 
-ifneq ($(wildcard m$(ASTTOPDIR)/Makefile.ast),)
-  include m$(ASTTOPDIR)/Makefile.ast
-endif
-
-gentone gentone-ulaw: %: %.c
-	$(HOST_CC) -o $@ $< -lm
+$(eval $(call ast_make_final_host,gentone,gentone.c))
+gentone: LDFLAGS+=-lm
 
 busy.h: gentone
 	./gentone busy 480 620
@@ -82,20 +76,14 @@
 ringtone.h: gentone
 	./gentone ringtone 440 480
 
-chan_oss.o: chan_oss.c busy.h ringtone.h
+chan_oss.o: busy.h ringtone.h
 
 chan_iax2.so: iax2-parser.o iax2-provision.o
 
 chan_alsa.o: busy.h ringtone.h
 
-chan_vpb.o: chan_vpb.c
-	$(CXX) -c $(CFLAGS:-Werror=) -o $@ chan_vpb.c
-
-chan_vpb.so: chan_vpb.o
-	 $(CXX) $(SOLINK) -o $@ $< -lvpb -lpthread -lm -ldl
-
 ifeq ($(OSARCH),Linux)
-chan_h323.so: chan_h323.o h323/libchanh323.a $(ASTTOPDIR)/Makefile.ast
+chan_h323.so: chan_h323.o h323/libchanh323.a $(PWD)/Makefile.ast
 	$(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) -lstdc++
 else
 chan_h323.so: chan_h323.o h323/libchanh323.a
@@ -105,5 +93,9 @@
 misdn/chan_misdn_lib.a:
 	make -C misdn
 
+chan_misdn.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\"
+
+misdn_config.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\"
+
 chan_misdn.so: chan_misdn.o misdn_config.o misdn/chan_misdn_lib.a
-	$(CC) $(SOLINK) -o $@ $^ -lisdnnet -lmISDN
+chan_misdn.so: LDFLAGS+=-lisdnnet -lmISDN

Modified: trunk/codecs/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/codecs/Makefile?rev=37273&r1=37272&r2=37273&view=diff
==============================================================================
--- trunk/codecs/Makefile (original)
+++ trunk/codecs/Makefile Thu Jul  6 18:18:45 2006
@@ -38,14 +38,15 @@
 	$(MAKE) -C ilbc clean
 
 gsm/lib/libgsm.a:
-	CFLAGS="$(ASTCFLAGS) -I." $(MAKE) -C gsm lib/libgsm.a
+	@mkdir -p gsm/lib
+	@CFLAGS="$(ASTCFLAGS) -I." $(MAKE) -C gsm lib/libgsm.a
 
 $(LIBLPC10):
-	CFLAGS="$(ASTCFLAGS)" $(MAKE) -C lpc10 all
+	@CFLAGS="$(ASTCFLAGS)" $(MAKE) -C lpc10 all
 
 codec_lpc10.so: $(LIBLPC10)
 
 $(LIBILBC):
-	CFLAGS="$(ASTCFLAGS)" $(MAKE) -C ilbc all
+	@CFLAGS="$(ASTCFLAGS)" $(MAKE) -C ilbc all
 
 codec_ilbc.so: $(LIBILBC)

Modified: trunk/codecs/gsm/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/codecs/gsm/Makefile?rev=37273&r1=37272&r2=37273&view=diff
==============================================================================
--- trunk/codecs/gsm/Makefile (original)
+++ trunk/codecs/gsm/Makefile Thu Jul  6 18:18:45 2006
@@ -71,11 +71,8 @@
 # CC		= /usr/lang/acc
 # CCFLAGS 	= -c -O
 
-CC		?= gcc
 CCFLAGS 	+= -c -DNeedFunctionPrototypes=1 -funroll-loops $(OPTIMIZE)
 CCFLAGS   += -fPIC
-
-LD 		= $(CC)
 
 # LD		= gcc
 # LDFLAGS 	=
@@ -326,6 +323,8 @@
 		$(CC) $(CFLAGS:-Werror=) $?
 		@-mv `$(BASENAME) $@` $@ > /dev/null 2>&1
 
+include $(ASTTOPDIR)/Makefile.rules
+
 # Target rules
 
 all:		$(LIBGSM) $(LIBGSMSO) $(TOAST) $(TCAT) $(UNTOAST)
@@ -353,11 +352,7 @@
 		ln -fs libgsm.so.1.0.10 lib/libgsm.so.1
 		ln -fs libgsm.so.1.0.10 lib/libgsm.so
 
-$(LIBGSM):	$(LIB) $(GSM_OBJECTS)
-		-rm $(RMFLAGS) $(LIBGSM)
-		$(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)
-		$(RANLIB) $(LIBGSM)
-
+$(eval $(call ast_make_a_o,$(LIBGSM),$(GSM_OBJECTS)))
 
 # Toast, Untoast and Tcat -- the compress-like frontends to gsm.
 

Modified: trunk/codecs/ilbc/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/codecs/ilbc/Makefile?rev=37273&r1=37272&r2=37273&view=diff
==============================================================================
--- trunk/codecs/ilbc/Makefile (original)
+++ trunk/codecs/ilbc/Makefile Thu Jul  6 18:18:45 2006
@@ -1,23 +1,17 @@
-ARCH=$(PROC)
-CFLAGS+=-Wall -O3 -funroll-loops
-CFLAGS += -fPIC
 LIB=libilbc.a
+CFLAGS+=-fPIC
 
-OBJS= anaFilter.o iCBSearch.o packing.o \
-        constants.o gainquant.o iLBC_decode.o StateConstructW.o \
-        createCB.o getCBvec.o iLBC_encode.o StateSearchW.o doCPLC.o \
-        helpfun.o syntFilter.o enhancer.o hpInput.o LPCdecode.o \
-        filter.o hpOutput.o LPCencode.o FrameClassify.o  iCBConstruct.o lsf.o
+OBJS=anaFilter.o iCBSearch.o packing.o \
+     constants.o gainquant.o iLBC_decode.o StateConstructW.o \
+     createCB.o getCBvec.o iLBC_encode.o StateSearchW.o doCPLC.o \
+     helpfun.o syntFilter.o enhancer.o hpInput.o LPCdecode.o \
+     filter.o hpOutput.o LPCencode.o FrameClassify.o iCBConstruct.o lsf.o
+
+include $(ASTTOPDIR)/Makefile.rules
 
 all: $(LIB)
 
-
-$(LIB): $(OBJS)
-	ar cr $(LIB) $(OBJS)
-	ranlib $(LIB)
+$(eval $(call ast_make_a_o,$(LIB),$(OBJS)))
 
 clean:
 	rm -f $(LIB) *.o
-
-install:
-

Modified: trunk/codecs/lpc10/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/codecs/lpc10/Makefile?rev=37273&r1=37272&r2=37273&view=diff
==============================================================================
--- trunk/codecs/lpc10/Makefile (original)
+++ trunk/codecs/lpc10/Makefile Thu Jul  6 18:18:45 2006
@@ -21,10 +21,7 @@
 # directives can find the machine.h file.
 # 
 
-WARNINGS = -Wall -Wno-comment -Wno-error
-CFLAGS += $(OPTIMIZE) -I$(LIB_TARGET_DIR) $(WARNINGS)
-CFLAGS += -fPIC
-#CFLAGS+= $(shell if uname -m | grep -q 86; then echo "-mpentium" ; fi)
+CFLAGS+= -fPIC -Wno-comment
 
 #fix for PPC processors and ALPHA, And UltraSparc too
 ifneq ($(OSARCH),Darwin)
@@ -56,18 +53,18 @@
 
 .PHONY: all clean
 
+include $(ASTTOPDIR)/Makefile.rules
+
 all:	$(LIB)
 
-OBJ=	f2clib.o analys.o bsynz.o chanwr.o dcbias.o decode.o \
-		deemp.o difmag.o dyptrk.o encode.o energy.o ham84.o \
-		hp100.o invert.o irc2pc.o ivfilt.o lpcdec.o lpcenc.o \
-		lpcini.o lpfilt.o median.o mload.o onset.o pitsyn.o \
-		placea.o placev.o preemp.o prepro.o random.o rcchk.o \
-		synths.o tbdm.o voicin.o vparms.o
+OBJ=f2clib.o analys.o bsynz.o chanwr.o dcbias.o decode.o \
+    deemp.o difmag.o dyptrk.o encode.o energy.o ham84.o \
+    hp100.o invert.o irc2pc.o ivfilt.o lpcdec.o lpcenc.o \
+    lpcini.o lpfilt.o median.o mload.o onset.o pitsyn.o \
+    placea.o placev.o preemp.o prepro.o random.o rcchk.o \
+    synths.o tbdm.o voicin.o vparms.o
 
-$(LIB): $(OBJ)
-	$(AR) cr $@ $(OBJ)
-	ranlib $@
+$(eval $(call ast_make_a_o,$(LIB),$(OBJ)))
 
 clean:
-	-rm -f *.o $(LIB)
+	rm -f *.o $(LIB)

Modified: trunk/db1-ast/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/db1-ast/Makefile?rev=37273&r1=37272&r2=37273&view=diff
==============================================================================
--- trunk/db1-ast/Makefile (original)
+++ trunk/db1-ast/Makefile Thu Jul  6 18:18:45 2006
@@ -19,25 +19,24 @@
 
 LIBDBSO=libdb.so.$(SOVER)
 PROG=	db_dump185
-OBJ1=	hash.o hash_bigkey.o hash_buf.o hash_func.o hash_log2.o hash_page.o \
-	ndbm.o
-OBJ2=	bt_close.o bt_conv.o bt_debug.o bt_delete.o bt_get.o bt_open.o \
-	bt_overflow.o bt_page.o bt_put.o bt_search.o bt_seq.o bt_split.o \
-	bt_utils.o
-OBJ3=	db.o
-OBJ4=	mpool.o
-OBJ5=	rec_close.o rec_delete.o rec_get.o rec_open.o rec_put.o rec_search.o \
-	rec_seq.o rec_utils.o
+OBJ1=	hash/hash.o hash/hash_bigkey.o hash/hash_buf.o hash/hash_func.o hash/hash_log2.o hash/hash_page.o \
+	hash/ndbm.o
+OBJ2=	btree/bt_close.o btree/bt_conv.o btree/bt_debug.o btree/bt_delete.o btree/bt_get.o btree/bt_open.o \
+	btree/bt_overflow.o btree/bt_page.o btree/bt_put.o btree/bt_search.o btree/bt_seq.o btree/bt_split.o \
+	btree/bt_utils.o
+OBJ3=	db/db.o
+OBJ4=	mpool/mpool.o
+OBJ5=	recno/rec_close.o recno/rec_delete.o recno/rec_get.o recno/rec_open.o recno/rec_put.o recno/rec_search.o \
+	recno/rec_seq.o recno/rec_utils.o
 MISC=
 OBJS=	$(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(MISC)
 SHOBJS=	$(patsubst %.o,%.os,$(OBJS))
 
+include $(ASTTOPDIR)/Makefile.rules
+
 all: $(LIBDB) #$(LIBDBSO) $(PROG)
 
-$(LIBDB): $(OBJS)
-	rm -f $@
-	ar cq $@ $(OBJS)
-	ranlib $@
+$(eval $(call ast_make_a_o,$(LIBDB),$(OBJS)))
 
 $(LIBDBSO): $(SHOBJS)
 	$(CC) -Wl,-O1 -Wl,--version-script=libdb.map -Wl,-soname=$(LIBDBSO) -shared -o $@ $^
@@ -51,32 +50,24 @@
 clean:
 	rm -f $(LIBDB) $(LIBDBSO) $(OBJS) $(SHOBJS)
 
-CL=	$(CC) $(CFLAGS) -Wall -c -D__DBINTERFACE_PRIVATE -I. -I.. -Iinclude
+CFLAGS+=-Wall -c -D__DBINTERFACE_PRIVATE -I. -I.. -Iinclude -Ihash -Ibtree -Irecno
 
 OSTYPE=$(shell uname -s)
 ifeq ($(OSTYPE),SunOS)
-CL+=-I../include -I../include/solaris-compat -DSOLARIS
+CFLAGS+=-I../include -I../include/solaris-compat -DSOLARIS
 endif
 
 db_dump185.o: db_dump185.c
 	$(CL) -o $@ $<
-%.o: hash/%.c
+x%.o: hash/%.c
 	$(CL) -Ihash $(OSARCH_DEFINE) -o $@ $<
 %.os: hash/%.c
 	$(CL) -Ihash -fPIC -o $@ $<
-%.o: btree/%.c
+x%.o: btree/%.c
 	$(CL) -Ibtree -o $@ $<
 %.os: btree/%.c
 	$(CL) -Ibtree -fPIC -o $@ $<
-db.o: db/db.c
-	$(CL) -o $@ $<
-db.os: db/db.c
-	$(CL) -fPIC -o $@ $<
-mpool.o: mpool/mpool.c
-	$(CL) -o $@ $<
-mpool.os: mpool/mpool.c
-	$(CL) -fPIC -o $@ $<
-%.o: recno/%.c
+x%.o: recno/%.c
 	$(CL) -Irecno -o $@ $<
 %.os: recno/%.c
 	$(CL) -Irecno -fPIC -o $@ $<

Modified: trunk/pbx/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/pbx/Makefile?rev=37273&r1=37272&r2=37273&view=diff
==============================================================================
--- trunk/pbx/Makefile (original)
+++ trunk/pbx/Makefile Thu Jul  6 18:18:45 2006
@@ -25,11 +25,11 @@
 clean::
 	rm -f ael/*.o
 
-ael/aelflex.o: ael/ael_lex.c ../include/asterisk/ael_structs.h ael/ael.tab.h
-	$(CC) $(CFLAGS) -I. -c -o $@ $<
+$(eval $(call ast_make_o_c,ael/aelflex.o,ael/ael_lex.c ../include/asterisk/ael_structs.h ael/ael.tab.h))
+ael/aelflex.o: CFLAGS+=-I.
 
-ael/aelbison.o: ael/ael.tab.c ael/ael.tab.h ../include/asterisk/ael_structs.h
-	$(CC) $(CFLAGS) -I. -c -o $@ $<
+$(eval $(call ast_make_o_c,ael/aelbison.o,ael/ael.tab.c ael/ael.tab.h ../include/asterisk/ael_structs.h))
+ael/aelbison.o: CFLAGS+=-I.
 
 pbx_ael.so: pbx_ael.o ael/aelbison.o ael/aelflex.o
 
@@ -39,7 +39,7 @@
 ael/ael.tab.c ael/ael.tab.h:
 	(cd ael; bison -v -d ael.y)
 
-dundi-parser.o: dundi-parser.c dundi-parser.h
-	$(CC) $(CFLAGS) -I. -c -o $@ $<
+$(eval $(call ast_make_o_c,dundi-parser.o,dundi-parser.c dundi-parser.h))
+dundi-parser.o: CFLAGS+=-I.
 
 pbx_dundi.so: pbx_dundi.o dundi-parser.o

Modified: trunk/utils/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/utils/Makefile?rev=37273&r1=37272&r2=37273&view=diff
==============================================================================
--- trunk/utils/Makefile (original)
+++ trunk/utils/Makefile Thu Jul  6 18:18:45 2006
@@ -16,8 +16,7 @@
 UTILS:=astman smsq stereorize streamplayer aelparse
 
 ifeq (${OSARCH},SunOS)
-  SOL=../strcompat.o
-  SOLLIBS=-lsocket -lnsl
+  LDFLAGS+=../strcompat.o -lsocket -lnsl
 endif
 
 ifeq ($(POPT_LIB),)
@@ -31,6 +30,8 @@
 ifneq ($(filter pbx_ael,$(MENUSELECT_PBX)),)
   UTILS:=$(filter-out aelparse,$(UTILS))
 endif
+
+include $(ASTTOPDIR)/Makefile.rules
 
 all: $(UTILS)
 
@@ -49,49 +50,39 @@
 
 clean: clean-depend
 	rm -f *.o $(UTILS) check_expr
-	rm -f ast_expr2.o ast_expr2f.o
-
-astman.o: astman.c
-	$(CC) $(CFLAGS) -c -o $@ $<
 
 astman: astman.o ../md5.o
-	$(CC) $(CFLAGS) -o $@ $< ../md5.o -lnewt
+astman: LDFLAGS+=-lnewt
 
 stereorize: stereorize.o frame.o
-	$(CC) $(CFLAGS) -o stereorize stereorize.o frame.o -lm
+stereorize: LDFLAGS+=-lm
 
 ../ast_expr2.c:
-	bison -o $@ -d --name-prefix=ast_yy ../ast_expr2.y
+	@echo "   [BISON] ../ast_expr2.y -> $@"
+	@bison -o $@ -d --name-prefix=ast_yy ../ast_expr2.y
 
 ../ast_expr2f.c:
-	flex -o $@ --full ../ast_expr2.fl
+	@echo "   [FLEX] ../ast_expr2.fl -> $@"
+	@flex -o $@ --full ../ast_expr2.fl
 
-ast_expr2.o: ../ast_expr2.c
-	gcc  $(CFLAGS) -c -o $@ $<
+$(eval $(call ast_make_o_c,ast_expr2.o,../ast_expr2.c))
 
-ast_expr2f.o: ../ast_expr2f.c
-	gcc  $(CFLAGS) -c -DSTANDALONE -o $@ $<
+$(eval $(call ast_make_o_c,ast_expr2f.o,../ast_expr2f.c))
+ast_expr2f.o: CFLAGS+=-DSTANDALONE
 
-check_expr: check_expr.c ast_expr2.o ast_expr2f.o
-	$(CC) $(CFLAGS) -o $@ $^
+$(eval $(call ast_make_final,check_expr,check_expr.c ast_expr2.o ast_expr2f.o))
 
-aelflex.o: ../pbx/ael/ael_lex.c ../include/asterisk/ael_structs.h ../pbx/ael/ael.tab.h
-	$(CC) $(CFLAGS) -I../pbx -DSTANDALONE -c -o $@ $<
+$(eval $(call ast_make_o_c,aelflex.o,../pbx/ael/ael_lex.c ../include/asterisk/ael_structs.h ../pbx/ael/ael.tab.h))
+aelflex.o: CFLAGS+=-I../pbx -DSTANDALONE
 
-aelbison.o: ../pbx/ael/ael.tab.c ../pbx/ael/ael.tab.h ../include/asterisk/ael_structs.h
-	$(CC) $(CFLAGS) -I../pbx -c -o $@ $<
+$(eval $(call ast_make_o_c,aelbison.o,../pbx/ael/ael.tab.c ../pbx/ael/ael.tab.h ../include/asterisk/ael_structs.h))
+aelbison.o: CFLAGS+=-I../pbx
 
-pbx_ael.o: ../pbx/pbx_ael.c
-	$(CC) $(CFLAGS) -c -o $@ $<
+$(eval $(call ast_make_o_c,pbx_ael.o,../pbx/pbx_ael.c))
 
-aelparse : aelflex.o aelbison.o pbx_ael.o ael_main.o ast_expr2f.o ast_expr2.o
-	$(CC) $(CFLAGS) -g -o aelparse aelflex.o aelbison.o ael_main.o pbx_ael.o ast_expr2f.o ast_expr2.o
+$(eval $(call ast_make_final,aelparse,aelflex.o aelbison.o pbx_ael.o ael_main.o ast_expr2f.o ast_expr2.o))
 
-ael_main.o : ael_main.c ../include/asterisk/ael_structs.h
-	$(CC) $(CFLAGS) -c -g -o ael_main.o ael_main.c
-
-ael_main1.o : ael_main.c ../include/asterisk/ael_structs.h
-	$(CC) $(CFLAGS) -c -g  -o ael_main1.o ael_main.c
+$(eval $(call ast_make_o_c,ael_main.o,ael_main.c ../include/asterisk/ael_structs.h))
 
 testexpr2s: ../ast_expr2f.c ../ast_expr2.c ../ast_expr2.h
 	$(CC) -g -c -I../include -DSTANDALONE ../ast_expr2f.c -o ast_expr2f.o
@@ -100,14 +91,10 @@
 	rm ast_expr2.o ast_expr2f.o 
 	./testexpr2s expr2.testinput
 
-smsq.o: smsq.c
-	$(CC) $(CFLAGS) -c -o $@ $<
-
 smsq: smsq.o
-	$(CC) $(CFLAGS) -o smsq ${SOL} smsq.o -lpopt
+smsq: LDFLAGS+=-lpopt
 
 streamplayer: streamplayer.o
-	$(CC) $(CFLAGS) -o streamplayer ${SOL} streamplayer.o ${SOLLIBS}
 
 ifneq ($(wildcard .depend),)
   include .depend



More information about the asterisk-commits mailing list