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
1.4
Kevin P. Fleming 19 years ago
parent ad2a107e33
commit 396ef6f9e7

@ -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

@ -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))))

@ -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

@ -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

@ -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

@ -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`

Loading…
Cancel
Save