hv: enhance Makefile to compile debug/release into 2 libraries

enhance Makefile to compile debug/release into 2 libraries

v1 -> v2:
 * auto make all the libraries

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
This commit is contained in:
Shiqing Gao
2018-11-21 15:11:44 +08:00
committed by wenlingz
parent 19b35f9730
commit 81db242292
3 changed files with 81 additions and 7 deletions

View File

@@ -0,0 +1,25 @@
#
# ACRN Hypervisor Static Library for Release Version
#
FILE_PATH := $(dir $(MKFL_NAME))
SRCS += $(wildcard $(FILE_PATH)/*.c)
OBJS += $(patsubst %.c,$(HV_OBJDIR)/%.o,$(SRCS))
.PHONY: default
default: lib
ifeq ($(CONFIG_RELEASE),y)
lib: $(OBJS)
$(AR) $(ARFLAGS) $(LIB_RELEASE) $(OBJS)
endif
.PHONY: clean
clean:
rm -f $(OBJS)
-include $(OBJS:.o=.d)
$(HV_OBJDIR)/%.o: %.c
[ ! -e $@ ] && mkdir -p $(dir $@); \
$(CC) $(patsubst %, -I%, $(INCLUDE_PATH)) -I. -c $(CFLAGS) $(ARCH_CFLAGS) $< -o $@ -MMD -MT $@