aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.rules
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-06 23:20:14 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-07-06 23:20:14 +0000
commit6fd4ad8a66711b2a46b8d097d49a2599ef6f037e (patch)
treeee58318bc7a0026b86044d29ce847e849c1860b5 /Makefile.rules
parente319f5334edcad77277c820deb01040b833a9e0e (diff)
add missing file
ignore .oo files from C++ modules git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37274 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules133
1 files changed, 133 insertions, 0 deletions
diff --git a/Makefile.rules b/Makefile.rules
new file mode 100644
index 000000000..5a0153e6e
--- /dev/null
+++ b/Makefile.rules
@@ -0,0 +1,133 @@
+#
+# Asterisk -- A telephony toolkit for Linux.
+#
+# Makefile rules
+#
+# Copyright (C) 2006, Digium, Inc.
+#
+# Kevin P. Fleming <kpfleming@digium.com>
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License
+#
+
+ifeq ($(NOISY_BUILD),)
+
+define ast_make_o_c
+$(1): $(2)
+ @echo " [CC] $$< -> $$@"
+ @$$(CC) -o $$@ -c $$< $$(CFLAGS)
+endef
+
+define ast_make_oo_cc
+$(1): $(2)
+ @echo " [CXX] $$< -> $$@"
+ @$$(CXX) -o $$@ -c $$< $$(CFLAGS)
+endef
+
+define ast_make_c_y
+$(1): $(2)
+ @echo " [BISON] $$< -> $$@"
+ @bison -o $$@ -d --name-prefix=ast_yy $$<
+endef
+
+define ast_make_c_fl
+$(1): $(2)
+ @echo " [FLEX] $$< -> $$@"
+ @flex -o $$@ --full $$<
+endef
+
+define ast_make_so_o
+$(1): $(2)
+ @echo " [LD] $$^ -> $$@"
+ @$$(CC) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
+endef
+
+define ast_make_so_oo
+$(1): $(2)
+ @echo " [LDXX] $$^ -> $$@"
+ @$$(CXX) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
+endef
+
+define ast_make_a_o
+$(1): $(2)
+ @echo " [AR] $$^ -> $$@"
+ @$$(AR) cr $$@ $$^
+ @$$(RANLIB) $$@
+endef
+
+define ast_make_final
+$(1): $(2)
+ @echo " [LD] $$^ -> $$@"
+ @$$(CC) -o $$@ $$^ $$(LDFLAGS)
+endef
+
+define ast_make_final_host
+$(1): $(2)
+ @echo " [LD] $$^ -> $$@"
+ @$$(HOST_CC) -o $$@ $$^ $$(CFLAGS) $$(LDFLAGS)
+endef
+
+else
+
+define ast_make_o_c
+$(1): $(2)
+ $$(CC) -o $$@ -c $$< $$(CFLAGS)
+endef
+
+define ast_make_oo_cc
+$(1): $(2)
+ $$(CXX) -o $$@ -c $$< $$(CFLAGS)
+endef
+
+define ast_make_c_y
+$(1): $(2)
+ bison -o $$@ -d --name-prefix=ast_yy $$<
+endef
+
+define ast_make_c_fl
+$(1): $(2)
+ flex -o $$@ --full $$<
+endef
+
+define ast_make_so_o
+$(1): $(2)
+ $$(CC) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
+endef
+
+define ast_make_so_oo
+$(1): $(2)
+ $$(CXX) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
+endef
+
+define ast_make_a_o
+$(1): $(2)
+ $$(AR) cr $$@ $$^
+ $$(RANLIB) $$@
+endef
+
+define ast_make_final
+$(1): $(2)
+ $$(CC) -o $$@ $$^ $$(LDFLAGS)
+endef
+
+define ast_make_final_host
+$(1): $(2)
+ $$(HOST_CC) -o $$@ $$^ $$(CFLAGS) $$(LDFLAGS)
+endef
+
+endif
+
+$(eval $(call ast_make_o_c,%.o,%.c))
+
+$(eval $(call ast_make_oo_cc,%.oo,%.cc))
+
+$(eval $(call ast_make_so_o,%.so,%.o))
+
+$(eval $(call ast_make_so_oo,%.so,%.oo))
+
+$(eval $(call ast_make_final,%,%.o))
+
+$(eval $(call ast_make_c_y,%.c,%.y))
+
+$(eval $(call ast_make_c_fl,%.c,%.fl))