gccgo_AR := $(cc_AR)
gccgo_AROBJ := $(cc_AROBJ)
# Shell functions to determine what libraries can be linked by the compiler
-cc_LDLIBS := $(shell ldconfig -p | head -n -2 | grep -v Broken | sed -e 's@^.*lib\([_\+a-Z0-9\-]*\)\..*@\1@g' -e '1d')
+cc_LDLIBS := $(shell ls /usr/lib | grep ".so" | sed -e 's@^.*lib\([_\+a-zA-Z0-9\-]*\)\..*@\1@g')
gcc_LDLIBS := $(cc_LDLIBS)
emcc_LDLIBS :=
g++_LDLIBS := $(cc_LDLIBS)
# Set up lib inclusions, and scan for built libs
c_FLAGS += -I$(LIBINC_DIR)
c_OBJ := $($(c_C)_OBJ)
-# If we have a linker, include 'LIB_DIR' in the paths it looks in
-$(foreach lang,$(LANGS),$(if $($($(lang)_C)_LD),$(eval\
-$(lang)_FLAGS += -L$(LIB_DIR)\
-)))
# Modules are any directories other than 'DRIVER_MODULE' in './' and produce a
# single object file in './' containing all of the module's symbols and
# binaries.
# (i.e. yacc/bison also produce accompanying .h files), add them to the list of
# source files that this makefile can generate ('$1_MKSRC'), to later be deleted
# during the clean rule.
-$(info $1_SOURCES: $($1_SOURCES))
$(foreach srcl,$($1_SRCL),\
$(eval $1_MKSRC := $(shell find -name "*.$(srcl)" \
| sed -e 's@^\(.*\).$(srcl)@\1$($(srcl)_STEM:%=.%).$1@g' -e 's@\./@@'))\
$(if $($(srcl)_DUP),\
$(eval $1_SOURCES += $($1_MKSRC:%.$1=%.$($(srcl)_DUP))))\
)
-$(info $1_SOURCES: $($1_SOURCES))
$(eval $1_DRV_SRC := $(filter $(DRIVER_DIR)/%,$($1_SOURCES)))
$(eval DRV_SRC += $($1_DRV_SRC))
# adding '-lLIBNAME' options to the language flags if the linker has them, or to
# the list of missing libraries for this language if the linker cannot find them.
# If this compiler has no linker, mark all libs as missing
+# $($1_SOBS:$(LIB_DIR)/lib%.so=%))
$(eval $1_LD_LIBS := $(sort $1_LD_LIBS))
$(if $($($1_C)_LD),\
-$(eval $1_LD_LIBS := $($($1_C)_LDLIBS) $($1_SOBS:$(LIB_DIR)/lib%.so=%))\
+$(eval $1_LD_LIBS := $($($1_C)_LDLIBS))\
$(foreach lib,$($1_LIBS),\
$(if $(findstring $(lib),$($1_LD_LIBS)),\
$(eval $1_FLAGS += -l$(lib)),\
$(eval $1_MISSING_LIBS += $(lib))\
-$(eval $1_FLAGS += $(LIB_DIR)/lib$(lib).so)\
+$(eval $1_FLAGS += $(LIB_DIR)/lib$(lib).a)\
)),\
$(eval $1_MISSING_LIBS := $(filter-out $($1_LD_LIBS),$($1_LIBS)))\
)
# source files, and allow the compiler to output in its default current working
# directory 'cwd'. this is done by setting the $1_CHDIR flag to 't'
define SRCLANG_TRGLANG_BUILDRULE =
-$(info SRCLANG_TRGLANG_BUILDRULE $1 $2)
%$($1_STEM:%=.%).$2$(if $($1_DUP), %$($1_STEM:%=.%).$($1_DUP)): %.$1
$(if $($1_CHDIR),cd $$(shell dirname $$@) && )$$($1_C) $$($1_FLAGS)$(if $($1_CHDIR),\
$$(shell echo $$@ | sed -e 's@^.*/\([^\.]*\).*@\1@').$1,\