aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--Makefile.moddir_rules6
-rw-r--r--Makefile.rules16
-rw-r--r--agi/Makefile2
-rw-r--r--channels/Makefile4
-rw-r--r--utils/Makefile13
6 files changed, 22 insertions, 21 deletions
diff --git a/Makefile b/Makefile
index e21b79a58..84cf32979 100644
--- a/Makefile
+++ b/Makefile
@@ -496,7 +496,7 @@ asterisk: include/asterisk/buildopts.h editline/libedit.a db1-ast/libdb1.a $(OBJ
@$(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a $(LIBS)
muted: muted.o
-muted: LDFLAGS+=$(AUDIO_LIBS)
+muted: LIBS+=$(AUDIO_LIBS)
$(SUBDIRS_CLEAN_DEPEND):
@$(MAKE) -C $(@:-clean-depend=) clean-depend
diff --git a/Makefile.moddir_rules b/Makefile.moddir_rules
index e8a239fbe..15beec313 100644
--- a/Makefile.moddir_rules
+++ b/Makefile.moddir_rules
@@ -25,12 +25,14 @@ endef
define module_so_o_template
$(1).so: $(1).o
-$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
+$(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
+$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
endef
define module_so_oo_template
$(1).so: $(1).oo
-$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
+$(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
+$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
endef
$(foreach mod,$(filter-out $(CC_MODS),$(SELECTED_MODS)),$(eval $(call module_o_c_template,$(mod))))
diff --git a/Makefile.rules b/Makefile.rules
index 5a0153e6e..4982b2d3b 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -40,13 +40,13 @@ endef
define ast_make_so_o
$(1): $(2)
@echo " [LD] $$^ -> $$@"
- @$$(CC) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
+ @$$(CC) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
endef
define ast_make_so_oo
$(1): $(2)
@echo " [LDXX] $$^ -> $$@"
- @$$(CXX) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
+ @$$(CXX) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
endef
define ast_make_a_o
@@ -59,13 +59,13 @@ endef
define ast_make_final
$(1): $(2)
@echo " [LD] $$^ -> $$@"
- @$$(CC) -o $$@ $$^ $$(LDFLAGS)
+ @$$(CC) -o $$@ $$(LDFLAGS) $$^ $$(LIBS)
endef
define ast_make_final_host
$(1): $(2)
@echo " [LD] $$^ -> $$@"
- @$$(HOST_CC) -o $$@ $$^ $$(CFLAGS) $$(LDFLAGS)
+ @$$(HOST_CC) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS)
endef
else
@@ -92,12 +92,12 @@ endef
define ast_make_so_o
$(1): $(2)
- $$(CC) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
+ $$(CC) -o $$@ $$(LDFAGS) $$(SOLINK) $$^ $$(LIBS)
endef
define ast_make_so_oo
$(1): $(2)
- $$(CXX) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
+ $$(CXX) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
endef
define ast_make_a_o
@@ -108,12 +108,12 @@ endef
define ast_make_final
$(1): $(2)
- $$(CC) -o $$@ $$^ $$(LDFLAGS)
+ $$(CC) -o $$@ $$(LDFLAGS) $$^ $$(LIBS)
endef
define ast_make_final_host
$(1): $(2)
- $$(HOST_CC) -o $$@ $$^ $$(CFLAGS) $$(LDFLAGS)
+ $$(HOST_CC) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS)
endef
endif
diff --git a/agi/Makefile b/agi/Makefile
index 907d5efe4..e65357c5c 100644
--- a/agi/Makefile
+++ b/agi/Makefile
@@ -16,7 +16,7 @@
AGIS=agi-test.agi eagi-test eagi-sphinx-test jukebox.agi
ifeq ($(OSARCH),SunOS)
- LDFLAGS+=-lsocket -lnsl ../strcompat.o
+ LIBS+=-lsocket -lnsl ../strcompat.o
endif
include $(ASTTOPDIR)/Makefile.rules
diff --git a/channels/Makefile b/channels/Makefile
index 37340f887..55fa4ae47 100644
--- a/channels/Makefile
+++ b/channels/Makefile
@@ -68,7 +68,7 @@ ifneq ($(wildcard $(PWD)/Makefile.ast),)
endif
$(eval $(call ast_make_final_host,gentone,gentone.c))
-gentone: LDFLAGS+=-lm
+gentone: LIBS+=-lm
busy.h: gentone
./gentone busy 480 620
@@ -98,4 +98,4 @@ 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
-chan_misdn.so: LDFLAGS+=-lisdnnet -lmISDN
+chan_misdn.so: LIBS+=-lisdnnet -lmISDN
diff --git a/utils/Makefile b/utils/Makefile
index f6f24710d..1d7a9512a 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -16,7 +16,7 @@
UTILS:=astman smsq stereorize streamplayer aelparse
ifeq (${OSARCH},SunOS)
- LDFLAGS+=../strcompat.o -lsocket -lnsl
+ LIBS+=../strcompat.o -lsocket -lnsl
endif
ifeq ($(POPT_LIB),)
@@ -51,11 +51,11 @@ clean-depend:
clean: clean-depend
rm -f *.o $(UTILS) check_expr
-astman: astman.o ../md5.o
-astman: LDFLAGS+=-lnewt
+$(eval $(call ast_make_final,astman,astman.o ../md5.o))
+astman: LIBS+=-lnewt
-stereorize: stereorize.o frame.o
-stereorize: LDFLAGS+=-lm
+$(eval $(call ast_make_final,stereorize,stereorize.o frame.o))
+stereorize: LIBS+=-lm
../ast_expr2.c:
@echo " [BISON] ../ast_expr2.y -> $@"
@@ -92,7 +92,7 @@ testexpr2s: ../ast_expr2f.c ../ast_expr2.c ../ast_expr2.h
./testexpr2s expr2.testinput
smsq: smsq.o
-smsq: LDFLAGS+=-lpopt
+smsq: LIBS+=-lpopt
streamplayer: streamplayer.o
@@ -104,4 +104,3 @@ depend: .depend
.depend:
../build_tools/mkdep $(CFLAGS) `ls *.c`
-