Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
3 changed files
with
81 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# | ||
# ACRN Hypervisor Static Library for Debug Features | ||
# | ||
|
||
FILE_PATH := $(dir $(MKFL_NAME)) | ||
SRCS += $(wildcard $(FILE_PATH)/*.c) | ||
OBJS += $(patsubst %.c,$(HV_OBJDIR)/%.o,$(SRCS)) | ||
|
||
.PHONY: default | ||
default: lib | ||
|
||
ifneq ($(CONFIG_RELEASE),y) | ||
lib: $(OBJS) | ||
$(AR) $(ARFLAGS) $(LIB_DEBUG) $(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 $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 $@ |