mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-25 06:51:49 +00:00
HV: make: consider header depenencies when rebuilding
With Kconfig, it would be common to rebuild the hypervisor with a few configuration symbols changed. But for a proper rebuild, users are required to execute ''make clean'' first, which deletes the configuration file at all. This patch leverages the compiler to generate a target that add involved headers as dependencies to a specific file. Any change to a header will now trigger the rebuilding of related sources properly. Signed-off-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
parent
11239ae654
commit
116038fafc
@ -279,10 +279,13 @@ $(VERSION):
|
||||
echo "#define HV_BUILD_TIME "\""$$TIME"\""" >> $(VERSION);\
|
||||
echo "#define HV_BUILD_USER "\""$$USER"\""" >> $(VERSION)
|
||||
|
||||
-include $(C_OBJS:.o=.d)
|
||||
-include $(S_OBJS:.o=.d)
|
||||
|
||||
$(HV_OBJDIR)/%.o: %.c $(HV_OBJDIR)/$(HV_CONFIG_H)
|
||||
[ ! -e $@ ] && mkdir -p $(dir $@); \
|
||||
$(CC) $(patsubst %, -I%, $(INCLUDE_PATH)) -I. -c $(CFLAGS) $(ARCH_CFLAGS) $< -o $@
|
||||
$(CC) $(patsubst %, -I%, $(INCLUDE_PATH)) -I. -c $(CFLAGS) $(ARCH_CFLAGS) $< -o $@ -MMD -MT $@
|
||||
|
||||
$(HV_OBJDIR)/%.o: %.S $(HV_OBJDIR)/$(HV_CONFIG_H)
|
||||
[ ! -e $@ ] && mkdir -p $(dir $@); \
|
||||
$(CC) $(patsubst %, -I%, $(INCLUDE_PATH)) -I. $(ASFLAGS) $(ARCH_ASFLAGS) -c $< -o $@
|
||||
$(CC) $(patsubst %, -I%, $(INCLUDE_PATH)) -I. $(ASFLAGS) $(ARCH_ASFLAGS) -c $< -o $@ -MMD -MT $@
|
||||
|
Loading…
Reference in New Issue
Block a user