[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL SUBSYSTEM s390x 10/11] pc-bios/s390-ccw: Generate and include depe
From: |
Thomas Huth |
Subject: |
[PULL SUBSYSTEM s390x 10/11] pc-bios/s390-ccw: Generate and include dependency files in the Makefile |
Date: |
Thu, 2 Jul 2020 13:50:44 +0200 |
The Makefile of the s390-ccw bios does not handle dependencies of the
*.c files from the headers yet, so that you often have to run a "make
clean" to get the build right when one of the headers has been changed.
Let's make sure that we generate and include dependency files for all
*.c files now to avoid this problem in the future.
Acked-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <20200630142955.7662-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
pc-bios/s390-ccw/Makefile | 3 +++
pc-bios/s390-ccw/netboot.mak | 13 +++++++------
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile
index a048b6b077..50bc880272 100644
--- a/pc-bios/s390-ccw/Makefile
+++ b/pc-bios/s390-ccw/Makefile
@@ -38,5 +38,8 @@ s390-netboot.img:
@echo "s390-netboot.img not built since roms/SLOF/ is not available."
endif
+ALL_OBJS = $(sort $(OBJECTS) $(NETOBJS) $(LIBCOBJS) $(LIBNETOBJS))
+-include $(ALL_OBJS:%.o=%.d)
+
clean:
rm -f *.o *.d *.img *.elf *~ *.a
diff --git a/pc-bios/s390-ccw/netboot.mak b/pc-bios/s390-ccw/netboot.mak
index 5eefb7c289..577c023afe 100644
--- a/pc-bios/s390-ccw/netboot.mak
+++ b/pc-bios/s390-ccw/netboot.mak
@@ -1,8 +1,7 @@
SLOF_DIR := $(SRC_PATH)/roms/SLOF
-NETOBJS := start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain.o \
- libnet.a libc.a
+NETOBJS := start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain.o
LIBC_INC := -nostdinc -I$(SLOF_DIR)/lib/libc/include
LIBNET_INC := -I$(SLOF_DIR)/lib/libnet
@@ -11,15 +10,16 @@ NETLDFLAGS := $(LDFLAGS) -Ttext=0x7800000
$(NETOBJS): QEMU_CFLAGS += $(LIBC_INC) $(LIBNET_INC)
-s390-netboot.elf: $(NETOBJS)
- $(call quiet-command,$(CC) $(NETLDFLAGS) -o $@
$(NETOBJS),"BUILD","$(TARGET_DIR)$@")
+s390-netboot.elf: $(NETOBJS) libnet.a libc.a
+ $(call quiet-command,$(CC) $(NETLDFLAGS) -o $@
$^,"BUILD","$(TARGET_DIR)$@")
s390-netboot.img: s390-netboot.elf
$(call quiet-command,$(STRIP) --strip-unneeded $< -o
$@,"STRIP","$(TARGET_DIR)$@")
# libc files:
-LIBC_CFLAGS := $(QEMU_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC)
+LIBC_CFLAGS = $(QEMU_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \
+ -MMD -MP -MT $@ -MF $(@:%.o=%.d)
CTYPE_OBJS = isdigit.o isxdigit.o toupper.o
%.o : $(SLOF_DIR)/lib/libc/ctype/%.c
@@ -52,7 +52,8 @@ libc.a: $(LIBCOBJS)
LIBNETOBJS := args.o dhcp.o dns.o icmpv6.o ipv6.o tcp.o udp.o bootp.o \
dhcpv6.o ethernet.o ipv4.o ndp.o tftp.o pxelinux.o
-LIBNETCFLAGS := $(QEMU_CFLAGS) $(CFLAGS) -DDHCPARCH=0x1F $(LIBC_INC)
$(LIBNET_INC)
+LIBNETCFLAGS = $(QEMU_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \
+ -DDHCPARCH=0x1F -MMD -MP -MT $@ -MF $(@:%.o=%.d)
%.o : $(SLOF_DIR)/lib/libnet/%.c
$(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@
$<,"CC","$(TARGET_DIR)$@")
--
2.18.1
- [PULL SUBSYSTEM s390x 00/11] s390-ccw bios update, Thomas Huth, 2020/07/02
- [PULL SUBSYSTEM s390x 01/11] pc-bios: s390x: cio.c cleanup and compile fix, Thomas Huth, 2020/07/02
- [PULL SUBSYSTEM s390x 02/11] pc-bios: s390x: Consolidate timing functions into time.h, Thomas Huth, 2020/07/02
- [PULL SUBSYSTEM s390x 03/11] pc-bios: s390x: Move sleep and yield to helper.h, Thomas Huth, 2020/07/02
- [PULL SUBSYSTEM s390x 05/11] pc-bios: s390x: Rename PSW_MASK_ZMODE to PSW_MASK_64, Thomas Huth, 2020/07/02
- [PULL SUBSYSTEM s390x 04/11] pc-bios: s390x: Get rid of magic offsets into the lowcore, Thomas Huth, 2020/07/02
- [PULL SUBSYSTEM s390x 06/11] pc-bios: s390x: Use PSW masks where possible and introduce PSW_MASK_SHORT_ADDR, Thomas Huth, 2020/07/02
- [PULL SUBSYSTEM s390x 07/11] pc-bios: s390x: Move panic() into header and add infinite loop, Thomas Huth, 2020/07/02
- [PULL SUBSYSTEM s390x 08/11] pc-bios: s390x: Use ebcdic2ascii table, Thomas Huth, 2020/07/02
- [PULL SUBSYSTEM s390x 09/11] pc-bios: s390x: Make u32 ptr check explicit, Thomas Huth, 2020/07/02
- [PULL SUBSYSTEM s390x 10/11] pc-bios/s390-ccw: Generate and include dependency files in the Makefile,
Thomas Huth <=
- [PULL SUBSYSTEM s390x 11/11] pc-bios/s390: Update s390-ccw bios binaries with the latest changes, Thomas Huth, 2020/07/02
- Re: [PULL SUBSYSTEM s390x 00/11] s390-ccw bios update, no-reply, 2020/07/02
- Re: [PULL SUBSYSTEM s390x 00/11] s390-ccw bios update, no-reply, 2020/07/02
- Re: [PULL SUBSYSTEM s390x 00/11] s390-ccw bios update, no-reply, 2020/07/02
- Re: [PULL SUBSYSTEM s390x 00/11] s390-ccw bios update, Cornelia Huck, 2020/07/03