1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2014 Intel Corporation
4 # tell rte.compile-pre.mk to use HOSTCC instead of CC
6 include $(RTE_SDK)/mk/internal/rte.compile-pre.mk
7 include $(RTE_SDK)/mk/internal/rte.install-pre.mk
8 include $(RTE_SDK)/mk/internal/rte.clean-pre.mk
9 include $(RTE_SDK)/mk/internal/rte.build-pre.mk
11 # VPATH contains at least SRCDIR
15 _INSTALL = $(INSTALL-FILES-y) $(SYMLINK-FILES-y) $(RTE_OUTPUT)/hostlib/$(HOSTLIB)
22 install: build _postinstall
29 exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1))))
31 O_TO_A = $(AR) crus $(HOSTLIB) $(OBJS-y)
32 O_TO_A_STR = $(subst ','\'',$(O_TO_A)) #'# fix syntax highlight
33 O_TO_A_DISP = $(if $(V),"$(O_TO_A_STR)"," HOSTAR $(@)")
34 O_TO_A_CMD = "cmd_$@ = $(O_TO_A_STR)"
35 O_TO_A_DO = @set -e; \
36 echo $(O_TO_A_DISP); \
38 echo $(O_TO_A_CMD) > $(call exe2cmd,$(@))
40 -include .$(HOSTLIB).cmd
43 # Archive objects in .a file if needed
45 $(HOSTLIB): $(OBJS-y) FORCE
46 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
48 @echo -n "$@ -> $< " ; \
49 echo -n "file_missing=$(call boolean,$(file_missing)) " ; \
50 echo -n "cmdline_changed=$(call boolean,$(call cmdline_changed,$(O_TO_A_STR))) " ; \
51 echo -n "depfile_missing=$(call boolean,$(depfile_missing)) " ; \
52 echo "depfile_newer=$(call boolean,$(depfile_newer)) ")
55 $(call cmdline_changed,$(O_TO_A_STR)),\
61 # install lib in $(RTE_OUTPUT)/hostlib
63 $(RTE_OUTPUT)/hostlib/$(HOSTLIB): $(HOSTLIB)
64 @echo " INSTALL-HOSTLIB $(HOSTLIB)"
65 @[ -d $(RTE_OUTPUT)/hostlib ] || mkdir -p $(RTE_OUTPUT)/hostlib
66 $(Q)cp -f $(HOSTLIB) $(RTE_OUTPUT)/hostlib
69 # Clean all generated files
76 $(Q)rm -rf $(HOSTLIB) $(OBJS-all) $(DEPS-all) $(DEPSTMP-all) \
77 $(CMDS-all) $(INSTALL-FILES-all)
78 $(Q)rm -f $(_BUILD_TARGETS) $(_INSTALL_TARGETS) $(_CLEAN_TARGETS)
80 include $(RTE_SDK)/mk/internal/rte.compile-post.mk
81 include $(RTE_SDK)/mk/internal/rte.install-post.mk
82 include $(RTE_SDK)/mk/internal/rte.clean-post.mk
83 include $(RTE_SDK)/mk/internal/rte.build-post.mk