Skip to content

Commit

Permalink
Only include needed files in distribution tarball
Browse files Browse the repository at this point in the history
With the recent build changes a number of unneded files
crept into tarballs, including .o and .d files.

This patch is farily verbose, but hopefully in the long
run this system will be obvious enough to be maintainable.

Signed-off-by: Simon Horman <[email protected]>
  • Loading branch information
horms committed Feb 21, 2008
1 parent d098d61 commit e959e49
Show file tree
Hide file tree
Showing 27 changed files with 245 additions and 105 deletions.
22 changes: 14 additions & 8 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,23 @@ all: $(TARGETS)
# collect objects to be removed in 'make clean'
clean =

# collect objects to be removed in 'make clean'
dist = AUTHORS COPYING News TODO Makefile.in configure.ac \
kexec-tools.spec.in config/

# utility function for converting a list of files (with extension) to
# file.o (or file.d) format.
objify = $(addsuffix .o, $(basename $(1)))
depify = $(addsuffix .d, $(basename $(1)))

# Documentation
#
include $(srcdir)/doc/Makefile

# Headers
#
include $(srcdir)/include/Makefile

# Utility function library
#
include $(srcdir)/util_lib/Makefile
Expand Down Expand Up @@ -155,20 +167,13 @@ include $(srcdir)/kdump/Makefile
#
# kexec_test (test program)
#
ifeq ($(ARCH),i386)
include $(srcdir)/kexec_test/Makefile
endif
ifeq ($(ARCH),x86_64)
include $(srcdir)/kexec_test/Makefile
endif

SPEC=$(PACKAGE_NAME).spec
GENERATED_SRCS:= $(SPEC)
TARBALL=$(PACKAGE_NAME)-$(PACKAGE_VERSION).tar
TARBALL.gz=$(TARBALL).gz
SRCS:= AUTHORS COPYING News TODO Makefile.in configure.ac \
kexec-tools.spec.in config doc include kexec purgatory kexec_test \
kdump util util_lib configure
SRCS:= $(dist)
PSRCS:=$(foreach s, $(SRCS), $(PACKAGE_NAME)-$(PACKAGE_VERSION)/$(s))
PGSRCS:=$(foreach s, $(GENERATED_SRCS), $(PACKAGE_NAME)-$(PACKAGE_VERSION)/$(s))

Expand All @@ -188,6 +193,7 @@ $(TARBALL): $(SRCS) $(GENERATED_SRCS)
$(LN) -sf . $(PACKAGE_NAME)-$(PACKAGE_VERSION)
$(TAR) -rf $@ $(PGSRCS)
$(RM) -f $(PACKAGE_NAME)-$(PACKAGE_VERSION)
@echo $(dist)

$(TARBALL.gz): $(TARBALL)
gzip -c < $^ > $@
Expand Down
5 changes: 5 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist += doc/Makefile \
doc/linux-i386-boot.txt \
doc/linux-i386-zero-page.txt \
doc/multiboot.html \
doc/nbi-spec.txt
9 changes: 9 additions & 0 deletions include/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dist += include/Makefile \
include/config.h \
include/x86/x86-linux.h \
include/x86/mb_info.h \
include/x86/mb_header.h \
include/elf.h \
include/boot/linuxbios_tables.h \
include/boot/beoboot.h \
include/boot/elf_boot.h
1 change: 1 addition & 0 deletions kdump/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ KDUMP_DEPS = $(call depify, $(KDUMP_OBJS))
KDUMP = $(SBINDIR)/kdump
KDUMP_MANPAGE = $(MANDIR)/man8/kdump.8

dist += kdump/Makefile $(KDUMP_SRCS) kdump/kdump.8
clean += $(KDUMP_OBJS) $(KDUMP_DEPS) $(KDUMP) $(KDUMP_MANPAGE)

-include $(KDUMP_DEPS)
Expand Down
18 changes: 17 additions & 1 deletion kexec/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,23 @@ KEXEC_SRCS += kexec/crashdump-xen.c

KEXEC_GENERATED_SRCS += $(PURGATORY_HEX_C)

include $(srcdir)/kexec/arch/$(ARCH)/Makefile
dist += kexec/Makefile $(KEXEC_SRCS) $(KEXEC_GENERATED_SRCS) \
kexec/crashdump-elf.c \
kexec/crashdump.h kexec/kexec-elf-boot.h \
kexec/kexec-elf.h kexec/kexec-sha256.h \
kexec/kexec-syscall.h kexec/kexec.h kexec/kexec.8

include $(srcdir)/kexec/arch/alpha/Makefile
include $(srcdir)/kexec/arch/arm/Makefile
include $(srcdir)/kexec/arch/i386/Makefile
include $(srcdir)/kexec/arch/ia64/Makefile
include $(srcdir)/kexec/arch/ppc/Makefile
include $(srcdir)/kexec/arch/ppc64/Makefile
include $(srcdir)/kexec/arch/s390/Makefile
include $(srcdir)/kexec/arch/sh/Makefile
include $(srcdir)/kexec/arch/x86_64/Makefile

KEXEC_SRCS += $($(ARCH)_KEXEC_SRCS)

KEXEC_OBJS = $(call objify, $(KEXEC_SRCS) $(KEXEC_GENERATED_SRCS))
KEXEC_DEPS = $(call depify, $(KEXEC_OBJS))
Expand Down
4 changes: 4 additions & 0 deletions kexec/arch/alpha/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
alpha_KEXEC_SRCS=
dist += kexec/arch/alpha/Makefile kexec/arch/alpha/include/arch/options.h
$(alpha_KEXEC_SRCS)

10 changes: 7 additions & 3 deletions kexec/arch/arm/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#
# kexec arm (linux booting linux)
#
KEXEC_SRCS+= kexec/arch/arm/kexec-elf-rel-arm.c
KEXEC_SRCS+= kexec/arch/arm/kexec-zImage-arm.c
KEXEC_SRCS+= kexec/arch/arm/kexec-arm.c
arm_KEXEC_SRCS= kexec/arch/arm/kexec-elf-rel-arm.c
arm_KEXEC_SRCS+= kexec/arch/arm/kexec-zImage-arm.c
arm_KEXEC_SRCS+= kexec/arch/arm/kexec-arm.c

dist += kexec/arch/arm/Makefile $(arm_KEXEC_SRCS) \
kexec/arch/arm/kexec-arm.h \
kexec/arch/arm/include/arch/options.h
23 changes: 14 additions & 9 deletions kexec/arch/i386/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#
# kexec i386 (linux booting linux)
#
KEXEC_SRCS += kexec/arch/i386/kexec-x86.c
KEXEC_SRCS += kexec/arch/i386/kexec-elf-x86.c
KEXEC_SRCS += kexec/arch/i386/kexec-elf-rel-x86.c
KEXEC_SRCS += kexec/arch/i386/kexec-bzImage.c
KEXEC_SRCS += kexec/arch/i386/kexec-multiboot-x86.c
KEXEC_SRCS += kexec/arch/i386/kexec-beoboot-x86.c
KEXEC_SRCS += kexec/arch/i386/kexec-nbi.c
KEXEC_SRCS += kexec/arch/i386/x86-linux-setup.c
KEXEC_SRCS += kexec/arch/i386/crashdump-x86.c
i386_KEXEC_SRCS = kexec/arch/i386/kexec-x86.c
i386_KEXEC_SRCS += kexec/arch/i386/kexec-elf-x86.c
i386_KEXEC_SRCS += kexec/arch/i386/kexec-elf-rel-x86.c
i386_KEXEC_SRCS += kexec/arch/i386/kexec-bzImage.c
i386_KEXEC_SRCS += kexec/arch/i386/kexec-multiboot-x86.c
i386_KEXEC_SRCS += kexec/arch/i386/kexec-beoboot-x86.c
i386_KEXEC_SRCS += kexec/arch/i386/kexec-nbi.c
i386_KEXEC_SRCS += kexec/arch/i386/x86-linux-setup.c
i386_KEXEC_SRCS += kexec/arch/i386/crashdump-x86.c

dist += kexec/arch/i386/Makefile $(i386_KEXEC_SRCS) \
kexec/arch/i386/kexec-x86.h kexec/arch/i386/crashdump-x86.h \
kexec/arch/i386/x86-linux-setup.h \
kexec/arch/i386/include/arch/options.h
15 changes: 10 additions & 5 deletions kexec/arch/ia64/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#
# kexec ia64 (linux booting linux)
#
KEXEC_SRCS += kexec/arch/ia64/kexec-iomem.c
KEXEC_SRCS += kexec/arch/ia64/kexec-ia64.c
KEXEC_SRCS += kexec/arch/ia64/kexec-elf-ia64.c
KEXEC_SRCS += kexec/arch/ia64/kexec-elf-rel-ia64.c
KEXEC_SRCS += kexec/arch/ia64/crashdump-ia64.c
ia64_KEXEC_SRCS = kexec/arch/ia64/kexec-iomem.c
ia64_KEXEC_SRCS += kexec/arch/ia64/kexec-ia64.c
ia64_KEXEC_SRCS += kexec/arch/ia64/kexec-elf-ia64.c
ia64_KEXEC_SRCS += kexec/arch/ia64/kexec-elf-rel-ia64.c
ia64_KEXEC_SRCS += kexec/arch/ia64/crashdump-ia64.c

dist += kexec/arch/ia64/Makefile $(ia64_KEXEC_SRCS) \
kexec/arch/ia64/kexec-ia64.h kexec/arch/ia64/crashdump-ia64.h \
kexec/arch/ia64/include/arch/options.h


17 changes: 11 additions & 6 deletions kexec/arch/ppc/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#
# kexec ppc (linux booting linux)
#
KEXEC_SRCS += kexec/arch/ppc/kexec-ppc.c
KEXEC_SRCS += kexec/arch/ppc/kexec-elf-ppc.c
KEXEC_SRCS += kexec/arch/ppc/kexec-elf-rel-ppc.c
KEXEC_SRCS += kexec/arch/ppc/kexec-dol-ppc.c
KEXEC_SRCS += kexec/arch/ppc/ppc-setup-simple.S
KEXEC_SRCS += kexec/arch/ppc/ppc-setup-dol.S
ppc_KEXEC_SRCS = kexec/arch/ppc/kexec-ppc.c
ppc_KEXEC_SRCS += kexec/arch/ppc/kexec-elf-ppc.c
ppc_KEXEC_SRCS += kexec/arch/ppc/kexec-elf-rel-ppc.c
ppc_KEXEC_SRCS += kexec/arch/ppc/kexec-dol-ppc.c
ppc_KEXEC_SRCS += kexec/arch/ppc/ppc-setup-simple.S
ppc_KEXEC_SRCS += kexec/arch/ppc/ppc-setup-dol.S

dist += kexec/arch/ppc/Makefile $(ppc_KEXEC_SRCS) \
kexec/arch/ppc/kexec-ppc.h kexec/arch/ppc/ppc_asm.h \
kexec/arch/ppc/include/arch/options.h

17 changes: 11 additions & 6 deletions kexec/arch/ppc64/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
#
# kexec ppc64 (linux booting linux)
#
KEXEC_SRCS += kexec/arch/ppc64/kexec-elf-rel-ppc64.c
KEXEC_SRCS += kexec/arch/ppc64/kexec-zImage-ppc64.c
KEXEC_SRCS += kexec/arch/ppc64/fs2dt.c
KEXEC_SRCS += kexec/arch/ppc64/kexec-elf-ppc64.c
KEXEC_SRCS += kexec/arch/ppc64/kexec-ppc64.c
KEXEC_SRCS += kexec/arch/ppc64/crashdump-ppc64.c
ppc64_KEXEC_SRCS = kexec/arch/ppc64/kexec-elf-rel-ppc64.c
ppc64_KEXEC_SRCS += kexec/arch/ppc64/kexec-zImage-ppc64.c
ppc64_KEXEC_SRCS += kexec/arch/ppc64/fs2dt.c
ppc64_KEXEC_SRCS += kexec/arch/ppc64/kexec-elf-ppc64.c
ppc64_KEXEC_SRCS += kexec/arch/ppc64/kexec-ppc64.c
ppc64_KEXEC_SRCS += kexec/arch/ppc64/crashdump-ppc64.c

dist += kexec/arch/ppc64/Makefile $(ppc64_KEXEC_SRCS) \
kexec/arch/ppc64/kexec-ppc64.h kexec/arch/ppc64/crashdump-ppc64.h \
kexec/arch/ppc64/include/arch/options.h

10 changes: 7 additions & 3 deletions kexec/arch/s390/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#
# kexec s390 (linux booting linux)
#
KEXEC_SRCS += kexec/arch/s390/kexec-s390.c
KEXEC_SRCS += kexec/arch/s390/kexec-image.c
KEXEC_SRCS += kexec/arch/s390/kexec-elf-rel-s390.c
s390_KEXEC_SRCS = kexec/arch/s390/kexec-s390.c
s390_KEXEC_SRCS += kexec/arch/s390/kexec-image.c
s390_KEXEC_SRCS += kexec/arch/s390/kexec-elf-rel-s390.c

dist += kexec/arch/s390/Makefile $(s390_KEXEC_SRCS) \
kexec/arch/s390/kexec-s390.h \
kexec/arch/s390/include/arch/options.h
14 changes: 9 additions & 5 deletions kexec/arch/sh/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#
# kexec sh (linux booting linux)
#
KEXEC_SRCS += kexec/arch/sh/kexec-sh.c
KEXEC_SRCS += kexec/arch/sh/kexec-zImage-sh.c
KEXEC_SRCS += kexec/arch/sh/kexec-netbsd-sh.c
KEXEC_SRCS += kexec/arch/sh/kexec-elf-rel-sh.c
KEXEC_SRCS += kexec/arch/sh/netbsd_booter.S
sh_KEXEC_SRCS += kexec/arch/sh/kexec-sh.c
sh_KEXEC_SRCS += kexec/arch/sh/kexec-zImage-sh.c
sh_KEXEC_SRCS += kexec/arch/sh/kexec-netbsd-sh.c
sh_KEXEC_SRCS += kexec/arch/sh/kexec-elf-rel-sh.c
sh_KEXEC_SRCS += kexec/arch/sh/netbsd_booter.S

dist += kexec/arch/sh/Makefile $(sh_KEXEC_SRCS) \
kexec/arch/sh/kexec-sh.h \
kexec/arch/sh/include/arch/options.h
24 changes: 14 additions & 10 deletions kexec/arch/x86_64/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#
# kexec x86_64 (linux booting linux)
#
KEXEC_SRCS += kexec/arch/i386/kexec-elf-x86.c
KEXEC_SRCS += kexec/arch/i386/kexec-bzImage.c
KEXEC_SRCS += kexec/arch/i386/kexec-multiboot-x86.c
KEXEC_SRCS += kexec/arch/i386/kexec-beoboot-x86.c
KEXEC_SRCS += kexec/arch/i386/kexec-nbi.c
KEXEC_SRCS += kexec/arch/i386/x86-linux-setup.c
KEXEC_SRCS += kexec/arch/x86_64/crashdump-x86_64.c
KEXEC_SRCS += kexec/arch/x86_64/kexec-x86_64.c
KEXEC_SRCS += kexec/arch/x86_64/kexec-elf-x86_64.c
KEXEC_SRCS += kexec/arch/x86_64/kexec-elf-rel-x86_64.c
x86_64_KEXEC_SRCS = kexec/arch/i386/kexec-elf-x86.c
x86_64_KEXEC_SRCS += kexec/arch/i386/kexec-bzImage.c
x86_64_KEXEC_SRCS += kexec/arch/i386/kexec-multiboot-x86.c
x86_64_KEXEC_SRCS += kexec/arch/i386/kexec-beoboot-x86.c
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/x86_64/crashdump-x86_64.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) \
kexec/arch/x86_64/kexec-x86_64.h kexec/arch/x86_64/crashdump-x86_64.h \
kexec/arch/x86_64/include/arch/options.h
15 changes: 15 additions & 0 deletions kexec_test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@
RELOC:=0x10000
KEXEC_TEST_SRCS:= kexec_test/kexec_test16.S kexec_test/kexec_test.S

dist += kexec_test/Makefile $(KEXEC_TEST_SRCS) \
kexec_test/x86-setup-legacy-pic.S

BUILD_KEXEC_TEST = no
ifeq ($(ARCH),i386)
BUILD_KEXEC_TEST = yes
endif
ifeq ($(ARCH),x86_64)
BUILD_KEXEC_TEST = yes
endif

ifeq ($(BUILD_KEXEC_TEST),yes)

KEXEC_TEST_OBJS = $(call objify, $(KEXEC_TEST_SRCS))
KEXEC_TEST_DEPS = $(call depify, $(KEXEC_TEST_OBJS))

Expand All @@ -23,3 +36,5 @@ $(KEXEC_TEST): $(KEXEC_TEST_OBJS)
mkdir -p $(@D)
#$(LINK.o) -o $@ $^
$(LD) $(LDFLAGS) -o $@ $^

endif
24 changes: 20 additions & 4 deletions purgatory/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,20 @@ PURGATORY_SRCS += purgatory/purgatory.c
PURGATORY_SRCS += purgatory/printf.c
PURGATORY_SRCS += purgatory/string.c

include $(srcdir)/purgatory/arch/$(ARCH)/Makefile
dist += purgatory/Makefile $(PURGATORY_SRCS) \
purgatory/include/purgatory.h purgatory/include/string.h

include $(srcdir)/purgatory/arch/alpha/Makefile
include $(srcdir)/purgatory/arch/arm/Makefile
include $(srcdir)/purgatory/arch/i386/Makefile
include $(srcdir)/purgatory/arch/ia64/Makefile
include $(srcdir)/purgatory/arch/ppc/Makefile
include $(srcdir)/purgatory/arch/ppc64/Makefile
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 All @@ -31,13 +44,16 @@ purgatory/sha256.o: $(srcdir)/util_lib/sha256.c
$(COMPILE.c) -o $@ $^

$(PURGATORY): CC=$(TARGET_CC)
$(PURGATORY): CFLAGS+=-Os -fno-builtin -ffreestanding \
$(PURGATORY): CFLAGS+=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
-Os -fno-builtin -ffreestanding \
-fno-zero-initialized-in-bss

$(PURGATORY): CPPFLAGS+=-I$(srcdir)/purgatory/include \
$(PURGATORY): CPPFLAGS+=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
-I$(srcdir)/purgatory/include \
-I$(srcdir)/purgatory/arch/$(ARCH)/include \
-I$(shell $(CC) -print-file-name=include)
$(PURGATORY): LDFLAGS+=--no-undefined -nostartfiles -nostdlib -nodefaultlibs \
$(PURGATORY): LDFLAGS+=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\
--no-undefined -nostartfiles -nostdlib -nodefaultlibs \
-e purgatory_start -r

$(PURGATORY): $(PURGATORY_OBJS)
Expand Down
4 changes: 3 additions & 1 deletion purgatory/arch/alpha/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
# Purgatory alpha
#

PURGATORY_SRCS +=
alpha_PURGATORY_SRCS =

dist += purgatory/arch/alpha/Makefile $(alpha_PURGATORY_SRCS)

5 changes: 4 additions & 1 deletion purgatory/arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
# Purgatory arm
#

PURGATORY_SRCS +=
arm_PURGATORY_SRCS =

dist += purgatory/arch/arm/Makefile $(arm_PURGATORY_SRCS)


28 changes: 17 additions & 11 deletions purgatory/arch/i386/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
# Purgatory i386
#

PURGATORY_SRCS += purgatory/arch/i386/entry32-16.S
PURGATORY_SRCS += purgatory/arch/i386/entry32-16-debug.S
PURGATORY_SRCS += purgatory/arch/i386/entry32.S
PURGATORY_SRCS += purgatory/arch/i386/setup-x86.S
PURGATORY_SRCS += purgatory/arch/i386/stack.S
PURGATORY_SRCS += purgatory/arch/i386/compat_x86_64.S
PURGATORY_SRCS += purgatory/arch/i386/purgatory-x86.c
PURGATORY_SRCS += purgatory/arch/i386/console-x86.c
PURGATORY_SRCS += purgatory/arch/i386/vga.c
PURGATORY_SRCS += purgatory/arch/i386/pic.c
PURGATORY_SRCS += purgatory/arch/i386/crashdump_backup.c
i386_PURGATORY_SRCS = purgatory/arch/i386/entry32-16.S
i386_PURGATORY_SRCS += purgatory/arch/i386/entry32-16-debug.S
i386_PURGATORY_SRCS += purgatory/arch/i386/entry32.S
i386_PURGATORY_SRCS += purgatory/arch/i386/setup-x86.S
i386_PURGATORY_SRCS += purgatory/arch/i386/stack.S
i386_PURGATORY_SRCS += purgatory/arch/i386/compat_x86_64.S
i386_PURGATORY_SRCS += purgatory/arch/i386/purgatory-x86.c
i386_PURGATORY_SRCS += purgatory/arch/i386/console-x86.c
i386_PURGATORY_SRCS += purgatory/arch/i386/vga.c
i386_PURGATORY_SRCS += purgatory/arch/i386/pic.c
i386_PURGATORY_SRCS += purgatory/arch/i386/crashdump_backup.c

dist += purgatory/arch/i386/Makefile $(i386_PURGATORY_SRCS) \
purgatory/arch/i386/purgatory-x86.h \
purgatory/arch/i386/include/arch/io.h \
purgatory/arch/i386/include/arch/debug.h

Loading

0 comments on commit e959e49

Please sign in to comment.