Linux debugging

Check our new training course

Linux debugging, tracing, profiling & perf. analysis

Check our new training course
with Creative Commons CC-BY-SA
lecture and lab materials

Bootlin logo

Elixir Cross Referencer

# Input
# libname	tells the name of the lib and
# libdir	tells directory of lib which also is used as input to
#		mk/
# conf-file     [optional] if set, all objects will depend on $(conf-file)
# Output
# updated cleanfiles and
# updated libfiles, libdirs, libnames and libdeps

subdirs = $(libdir)
include mk/
include mk/

lib-libfile	 = $(out-dir)/$(base-prefix)$(libdir)/lib$(libname).a
cleanfiles	:= $(cleanfiles) $(lib-libfile)
libfiles	:= $(lib-libfile) $(libfiles) 
libdirs 	:= $(out-dir)/$(base-prefix)$(libdir) $(libdirs)
libnames	:= $(libname) $(libnames)
libdeps		:= $(lib-libfile) $(libdeps) 

define process-lib
ifeq ($(lib-use-ld), y)
$(lib-libfile): $(objs)
	@echo '  LD      $$@'
	@mkdir -p $$(dir $$@)
	$$(q)$$(LD) $(lib-ldflags) -o $$@ $$^
$(lib-libfile): $(objs)
	@echo '  AR      $$@'
	@mkdir -p $$(dir $$@)
	$$(q)$$(AR) rcs $$@ $$^
endef #process-lib

$(eval $(call process-lib))

$(objs): $(conf-file)

# Clean residues from processing
objs		:=
libname		:=
lib-use-ld	:=