Skip to content

Commit

Permalink
build: Avoid duplicate files in tarball
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Horman <horms@verge.net.au>
  • Loading branch information
horms committed Aug 2, 2012
1 parent df88cab commit 5e48916
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 39 deletions.
75 changes: 45 additions & 30 deletions kexec/Makefile
Expand Up @@ -7,47 +7,62 @@ $(PURGATORY_HEX_C): $(PURGATORY) $(BIN_TO_HEX)
$(MKDIR) -p $(@D)
$(BIN_TO_HEX) purgatory < $(PURGATORY) > $@

KEXEC_SRCS =
KEXEC_SRCS = $(KEXEC_SRCS_base)
KEXEC_GENERATED_SRCS =

KEXEC_SRCS += kexec/kexec.c
KEXEC_SRCS += kexec/ifdown.c
KEXEC_SRCS += kexec/kexec-elf.c
KEXEC_SRCS += kexec/kexec-elf-exec.c
KEXEC_SRCS += kexec/kexec-elf-core.c
KEXEC_SRCS += kexec/kexec-elf-rel.c
KEXEC_SRCS += kexec/kexec-elf-boot.c
KEXEC_SRCS += kexec/kexec-iomem.c
KEXEC_SRCS += kexec/firmware_memmap.c
KEXEC_SRCS += kexec/crashdump.c
KEXEC_SRCS += kexec/crashdump-xen.c
KEXEC_SRCS += kexec/phys_arch.c
KEXEC_SRCS += kexec/kernel_version.c
KEXEC_SRCS += kexec/lzma.c
KEXEC_SRCS += kexec/zlib.c
KEXEC_SRCS_base += kexec/kexec.c
KEXEC_SRCS_base += kexec/ifdown.c
KEXEC_SRCS_base += kexec/kexec-elf.c
KEXEC_SRCS_base += kexec/kexec-elf-exec.c
KEXEC_SRCS_base += kexec/kexec-elf-core.c
KEXEC_SRCS_base += kexec/kexec-elf-rel.c
KEXEC_SRCS_base += kexec/kexec-elf-boot.c
KEXEC_SRCS_base += kexec/kexec-iomem.c
KEXEC_SRCS_base += kexec/firmware_memmap.c
KEXEC_SRCS_base += kexec/crashdump.c
KEXEC_SRCS_base += kexec/crashdump-xen.c
KEXEC_SRCS_base += kexec/phys_arch.c
KEXEC_SRCS_base += kexec/kernel_version.c
KEXEC_SRCS_base += kexec/lzma.c
KEXEC_SRCS_base += kexec/zlib.c

KEXEC_GENERATED_SRCS += $(PURGATORY_HEX_C)

dist += kexec/Makefile $(KEXEC_SRCS) $(KEXEC_GENERATED_SRCS) \
kexec/crashdump-elf.c \
dist += kexec/Makefile $(KEXEC_GENERATED_SRCS) \
$(KEXEC_SRCS_base) kexec/crashdump-elf.c \
kexec/crashdump.h kexec/firmware_memmap.h \
kexec/kexec-elf-boot.h \
kexec/kexec-elf.h kexec/kexec-sha256.h \
kexec/kexec-zlib.h kexec/kexec-lzma.h \
kexec/kexec-syscall.h kexec/kexec.h kexec/kexec.8

$(ARCH)_PROC_IOMEM = kexec/proc_iomem.c
KEXEC_SRCS += $($(ARCH)_PROC_IOMEM)
$(ARCH)_VIRT_TO_PHYS = kexec/virt_to_phys.c
KEXEC_SRCS += $($(ARCH)_VIRT_TO_PHYS)
$(ARCH)_PHYS_TO_VIRT = kexec/phys_to_virt.c
KEXEC_SRCS += $($(ARCH)_PHYS_TO_VIRT)
$(ARCH)_ADD_SEGMENT = kexec/add_segment.c
KEXEC_SRCS += $($(ARCH)_ADD_SEGMENT)
$(ARCH)_ADD_BUFFER = kexec/add_buffer.c
KEXEC_SRCS += $($(ARCH)_ADD_BUFFER)
$(ARCH)_ARCH_REUSE_INITRD = kexec/arch_reuse_initrd.c
KEXEC_SRCS += $($(ARCH)_ARCH_REUSE_INITRD)
dist += kexec/proc_iomem.c
$(ARCH)_PROC_IOMEM = kexec/proc_iomem.c
KEXEC_SRCS += $($(ARCH)_PROC_IOMEM)

dist += kexec/virt_to_phys.c
$(ARCH)_VIRT_TO_PHYS = kexec/virt_to_phys.c
KEXEC_SRCS += $($(ARCH)_VIRT_TO_PHYS)

dist += kexec/phys_to_virt.c
$(ARCH)_PHYS_TO_VIRT = kexec/phys_to_virt.c
KEXEC_SRCS += $($(ARCH)_PHYS_TO_VIRT)

dist += kexec/add_segment.c
$(ARCH)_ADD_SEGMENT = kexec/add_segment.c
KEXEC_SRCS += $($(ARCH)_ADD_SEGMENT)

dist += kexec/add_buffer.c
$(ARCH)_ADD_BUFFER = kexec/add_buffer.c
KEXEC_SRCS += $($(ARCH)_ADD_BUFFER)

dist += kexec/arch_reuse_initrd.c
$(ARCH)_ARCH_REUSE_INITRD = kexec/arch_reuse_initrd.c
KEXEC_SRCS += $($(ARCH)_ARCH_REUSE_INITRD)

dist += kexec/kexec-uImage.c
$(ARCH)_UIMAGE =
KEXEC_SRCS += $($(ARCH)_UIMAGE)

include $(srcdir)/kexec/arch/alpha/Makefile
include $(srcdir)/kexec/arch/arm/Makefile
Expand Down
2 changes: 1 addition & 1 deletion kexec/arch/arm/Makefile
Expand Up @@ -6,8 +6,8 @@ arm_KEXEC_SRCS+= kexec/arch/arm/kexec-zImage-arm.c
arm_KEXEC_SRCS+= kexec/arch/arm/kexec-uImage-arm.c
arm_KEXEC_SRCS+= kexec/arch/arm/kexec-arm.c
arm_KEXEC_SRCS+= kexec/arch/arm/crashdump-arm.c
arm_KEXEC_SRCS+= kexec/kexec-uImage.c

arm_UIMAGE = kexec/kexec-uImage.c
arm_PHYS_TO_VIRT = kexec/arch/arm/phys_to_virt.c

dist += kexec/arch/arm/Makefile $(arm_KEXEC_SRCS) $(arm_PHYS_TO_VIRT) \
Expand Down
3 changes: 2 additions & 1 deletion kexec/arch/ppc/Makefile
Expand Up @@ -13,7 +13,8 @@ ppc_KEXEC_SRCS += kexec/arch/ppc/ppc-setup-dol.S
ppc_KEXEC_SRCS += kexec/arch/ppc/fixup_dtb.c
ppc_KEXEC_SRCS += kexec/arch/ppc/fs2dt.c
ppc_KEXEC_SRCS += kexec/arch/ppc/crashdump-powerpc.c
ppc_KEXEC_SRCS += kexec/kexec-uImage.c

ppc_UIMAGE = kexec/kexec-uImage.c

libfdt_SRCS = kexec/arch/ppc/libfdt-wrapper.c
libfdt_SRCS += $(LIBFDT_SRCS:%=kexec/arch/ppc/libfdt/%)
Expand Down
3 changes: 2 additions & 1 deletion kexec/arch/sh/Makefile
Expand Up @@ -9,7 +9,8 @@ sh_KEXEC_SRCS += kexec/arch/sh/kexec-elf-sh.c
sh_KEXEC_SRCS += kexec/arch/sh/kexec-elf-rel-sh.c
sh_KEXEC_SRCS += kexec/arch/sh/netbsd_booter.S
sh_KEXEC_SRCS += kexec/arch/sh/crashdump-sh.c
sh_KEXEC_SRCS += kexec/kexec-uImage.c

sh_UIMAGE = kexec/kexec-uImage.c

sh_ADD_BUFFER =
sh_ADD_SEGMENT =
Expand Down
12 changes: 8 additions & 4 deletions kexec/arch/x86_64/Makefile
Expand Up @@ -9,10 +9,14 @@ x86_64_KEXEC_SRCS += kexec/arch/i386/kexec-nbi.c
x86_64_KEXEC_SRCS += kexec/arch/i386/x86-linux-setup.c
x86_64_KEXEC_SRCS += kexec/arch/i386/kexec-x86-common.c
x86_64_KEXEC_SRCS += kexec/arch/i386/crashdump-x86.c
x86_64_KEXEC_SRCS += kexec/arch/x86_64/kexec-x86_64.c
x86_64_KEXEC_SRCS += kexec/arch/x86_64/kexec-elf-x86_64.c
x86_64_KEXEC_SRCS += kexec/arch/x86_64/kexec-elf-rel-x86_64.c

dist += kexec/arch/x86_64/Makefile $(x86_64_KEXEC_SRCS) \
x86_64_KEXEC_SRCS_native = kexec/arch/x86_64/kexec-x86_64.c
x86_64_KEXEC_SRCS_native += kexec/arch/x86_64/kexec-elf-x86_64.c
x86_64_KEXEC_SRCS_native += kexec/arch/x86_64/kexec-elf-rel-x86_64.c

x86_64_KEXEC_SRCS += $(x86_64_KEXEC_SRCS_native)

# Don't add sources in i386/ to dist, as i386/Makefile adds them
dist += kexec/arch/x86_64/Makefile $(x86_64_KEXEC_SRCS_native) \
kexec/arch/x86_64/kexec-x86_64.h \
kexec/arch/x86_64/include/arch/options.h
2 changes: 0 additions & 2 deletions purgatory/Makefile
Expand Up @@ -27,8 +27,6 @@ include $(srcdir)/purgatory/arch/s390/Makefile
include $(srcdir)/purgatory/arch/sh/Makefile
include $(srcdir)/purgatory/arch/x86_64/Makefile

PURGATORY_SRCS+=$($(ARCH)_PURGATORY_SRCS)

PURGATORY_OBJS = $(call objify, $(PURGATORY_SRCS)) purgatory/sha256.o
PURGATORY_DEPS = $(call depify, $(PURGATORY_OBJS))

Expand Down

0 comments on commit 5e48916

Please sign in to comment.