You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.5 KiB

################################################################################
# Copyright (c) Hisilicon Technologies Co., Ltd. 2014-2020. All rights reserved.
# Description: Makefile clean
# Author: SmartMedia_BSP
# Create: 2014-06-04
################################################################################
SRCS-y :=
FORCE-y :=
TEMPS :=
sinclude $(TOPDIR)/configs/config
include $(TOPDIR)/scripts/Makefile.define
include $(SRCDIR)Makefile
SRCS-y := $(addprefix $(SRCDIR),$(SRCS-y))
DOBJS := $(addsuffix $(BUILDOBJ).o,$(filter-out %.c %.S,$(SRCS-y)))
AOBJS := $(subst .S,.o,$(filter %.S,$(SRCS-y)))
COBJS := $(subst .c,.o,$(filter %.c,$(SRCS-y)))
FORCE-y := $(addprefix $(SRCDIR),$(FORCE-y))
AFORCE := $(subst .S,.o,$(filter %.S,$(FORCE-y)))
CFORCE := $(subst .c,.o,$(filter %.c,$(FORCE-y)))
OBJS := $(strip $(DOBJS) $(AOBJS) $(COBJS) $(AFORCE) $(CFORCE))
DEPS := $(OBJS:.o=.d)
TEMPS += $(OBJS) $(DEPS) $(SRCDIR)$(BUILDOBJ).o $(SRCDIR)$(BUILDOBJ).d
SRCS-n := $(addprefix $(SRCDIR),$(SRCS-) $(SRCS-n) $(FORCE-) $(FORCE-n))
TMPOBJS := $(subst .c,.o,$(filter %.c,$(SRCS-n))) \
$(subst .S,.o,$(filter %.S,$(SRCS-n))) \
$(addsuffix $(BUILDOBJ).o,$(filter-out %.c %.S,$(SRCS-n)))
SYMFILE := $(SRCDIR).symbol
TEMPS += $(BOOT).elf $(BOOT).map $(ZBOOT).elf $(ZBOOT).map $(SYMFILE).*
.PHONY: clean
clean: $(addsuffix .clean,$(filter %/$(BUILDOBJ).o,$(OBJS) $(TMPOBJS)))
$(Q)$(RM) -f $(TEMPS) $(SRCDIR)*.[od]
%/$(BUILDOBJ).o.clean:
$(call show_cmd,CLEAN,$(@D))
$(Q)$(MAKE) $(CLFLAGS) SRCDIR="$(@D)/" clean
force:;