mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
use LDFLAGS and LIBS properly, and allow dependencies to provide LDFLAGS if needed (although none do today)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@37653 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
2
Makefile
2
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)
|
@$(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a $(LIBS)
|
||||||
|
|
||||||
muted: muted.o
|
muted: muted.o
|
||||||
muted: LDFLAGS+=$(AUDIO_LIBS)
|
muted: LIBS+=$(AUDIO_LIBS)
|
||||||
|
|
||||||
$(SUBDIRS_CLEAN_DEPEND):
|
$(SUBDIRS_CLEAN_DEPEND):
|
||||||
@$(MAKE) -C $(@:-clean-depend=) clean-depend
|
@$(MAKE) -C $(@:-clean-depend=) clean-depend
|
||||||
|
@@ -25,12 +25,14 @@ endef
|
|||||||
|
|
||||||
define module_so_o_template
|
define module_so_o_template
|
||||||
$(1).so: $(1).o
|
$(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
|
endef
|
||||||
|
|
||||||
define module_so_oo_template
|
define module_so_oo_template
|
||||||
$(1).so: $(1).oo
|
$(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
|
endef
|
||||||
|
|
||||||
$(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_o_c_template,$(mod))))
|
||||||
|
@@ -40,13 +40,13 @@ endef
|
|||||||
define ast_make_so_o
|
define ast_make_so_o
|
||||||
$(1): $(2)
|
$(1): $(2)
|
||||||
@echo " [LD] $$^ -> $$@"
|
@echo " [LD] $$^ -> $$@"
|
||||||
@$$(CC) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
|
@$$(CC) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define ast_make_so_oo
|
define ast_make_so_oo
|
||||||
$(1): $(2)
|
$(1): $(2)
|
||||||
@echo " [LDXX] $$^ -> $$@"
|
@echo " [LDXX] $$^ -> $$@"
|
||||||
@$$(CXX) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
|
@$$(CXX) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define ast_make_a_o
|
define ast_make_a_o
|
||||||
@@ -59,13 +59,13 @@ endef
|
|||||||
define ast_make_final
|
define ast_make_final
|
||||||
$(1): $(2)
|
$(1): $(2)
|
||||||
@echo " [LD] $$^ -> $$@"
|
@echo " [LD] $$^ -> $$@"
|
||||||
@$$(CC) -o $$@ $$^ $$(LDFLAGS)
|
@$$(CC) -o $$@ $$(LDFLAGS) $$^ $$(LIBS)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define ast_make_final_host
|
define ast_make_final_host
|
||||||
$(1): $(2)
|
$(1): $(2)
|
||||||
@echo " [LD] $$^ -> $$@"
|
@echo " [LD] $$^ -> $$@"
|
||||||
@$$(HOST_CC) -o $$@ $$^ $$(CFLAGS) $$(LDFLAGS)
|
@$$(HOST_CC) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
else
|
else
|
||||||
@@ -92,12 +92,12 @@ endef
|
|||||||
|
|
||||||
define ast_make_so_o
|
define ast_make_so_o
|
||||||
$(1): $(2)
|
$(1): $(2)
|
||||||
$$(CC) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
|
$$(CC) -o $$@ $$(LDFAGS) $$(SOLINK) $$^ $$(LIBS)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define ast_make_so_oo
|
define ast_make_so_oo
|
||||||
$(1): $(2)
|
$(1): $(2)
|
||||||
$$(CXX) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
|
$$(CXX) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define ast_make_a_o
|
define ast_make_a_o
|
||||||
@@ -108,12 +108,12 @@ endef
|
|||||||
|
|
||||||
define ast_make_final
|
define ast_make_final
|
||||||
$(1): $(2)
|
$(1): $(2)
|
||||||
$$(CC) -o $$@ $$^ $$(LDFLAGS)
|
$$(CC) -o $$@ $$(LDFLAGS) $$^ $$(LIBS)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define ast_make_final_host
|
define ast_make_final_host
|
||||||
$(1): $(2)
|
$(1): $(2)
|
||||||
$$(HOST_CC) -o $$@ $$^ $$(CFLAGS) $$(LDFLAGS)
|
$$(HOST_CC) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
AGIS=agi-test.agi eagi-test eagi-sphinx-test jukebox.agi
|
AGIS=agi-test.agi eagi-test eagi-sphinx-test jukebox.agi
|
||||||
|
|
||||||
ifeq ($(OSARCH),SunOS)
|
ifeq ($(OSARCH),SunOS)
|
||||||
LDFLAGS+=-lsocket -lnsl ../strcompat.o
|
LIBS+=-lsocket -lnsl ../strcompat.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include $(ASTTOPDIR)/Makefile.rules
|
include $(ASTTOPDIR)/Makefile.rules
|
||||||
|
@@ -68,7 +68,7 @@ ifneq ($(wildcard $(PWD)/Makefile.ast),)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
$(eval $(call ast_make_final_host,gentone,gentone.c))
|
$(eval $(call ast_make_final_host,gentone,gentone.c))
|
||||||
gentone: LDFLAGS+=-lm
|
gentone: LIBS+=-lm
|
||||||
|
|
||||||
busy.h: gentone
|
busy.h: gentone
|
||||||
./gentone busy 480 620
|
./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\"
|
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: chan_misdn.o misdn_config.o misdn/chan_misdn_lib.a
|
||||||
chan_misdn.so: LDFLAGS+=-lisdnnet -lmISDN
|
chan_misdn.so: LIBS+=-lisdnnet -lmISDN
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
UTILS:=astman smsq stereorize streamplayer aelparse
|
UTILS:=astman smsq stereorize streamplayer aelparse
|
||||||
|
|
||||||
ifeq (${OSARCH},SunOS)
|
ifeq (${OSARCH},SunOS)
|
||||||
LDFLAGS+=../strcompat.o -lsocket -lnsl
|
LIBS+=../strcompat.o -lsocket -lnsl
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(POPT_LIB),)
|
ifeq ($(POPT_LIB),)
|
||||||
@@ -51,11 +51,11 @@ clean-depend:
|
|||||||
clean: clean-depend
|
clean: clean-depend
|
||||||
rm -f *.o $(UTILS) check_expr
|
rm -f *.o $(UTILS) check_expr
|
||||||
|
|
||||||
astman: astman.o ../md5.o
|
$(eval $(call ast_make_final,astman,astman.o ../md5.o))
|
||||||
astman: LDFLAGS+=-lnewt
|
astman: LIBS+=-lnewt
|
||||||
|
|
||||||
stereorize: stereorize.o frame.o
|
$(eval $(call ast_make_final,stereorize,stereorize.o frame.o))
|
||||||
stereorize: LDFLAGS+=-lm
|
stereorize: LIBS+=-lm
|
||||||
|
|
||||||
../ast_expr2.c:
|
../ast_expr2.c:
|
||||||
@echo " [BISON] ../ast_expr2.y -> $@"
|
@echo " [BISON] ../ast_expr2.y -> $@"
|
||||||
@@ -92,7 +92,7 @@ testexpr2s: ../ast_expr2f.c ../ast_expr2.c ../ast_expr2.h
|
|||||||
./testexpr2s expr2.testinput
|
./testexpr2s expr2.testinput
|
||||||
|
|
||||||
smsq: smsq.o
|
smsq: smsq.o
|
||||||
smsq: LDFLAGS+=-lpopt
|
smsq: LIBS+=-lpopt
|
||||||
|
|
||||||
streamplayer: streamplayer.o
|
streamplayer: streamplayer.o
|
||||||
|
|
||||||
@@ -104,4 +104,3 @@ depend: .depend
|
|||||||
|
|
||||||
.depend:
|
.depend:
|
||||||
../build_tools/mkdep $(CFLAGS) `ls *.c`
|
../build_tools/mkdep $(CFLAGS) `ls *.c`
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user