Skip to content

Commit 1c9f655

Browse files
committed
pc-bios/s390-ccw: Generate and include dependency files in the Makefile
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 <[email protected]> Message-Id: <[email protected]> Signed-off-by: Thomas Huth <[email protected]>
1 parent 9598c22 commit 1c9f655

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

pc-bios/s390-ccw/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,8 @@ s390-netboot.img:
3838
@echo "s390-netboot.img not built since roms/SLOF/ is not available."
3939
endif
4040

41+
ALL_OBJS = $(sort $(OBJECTS) $(NETOBJS) $(LIBCOBJS) $(LIBNETOBJS))
42+
-include $(ALL_OBJS:%.o=%.d)
43+
4144
clean:
4245
rm -f *.o *.d *.img *.elf *~ *.a

pc-bios/s390-ccw/netboot.mak

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11

22
SLOF_DIR := $(SRC_PATH)/roms/SLOF
33

4-
NETOBJS := start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain.o \
5-
libnet.a libc.a
4+
NETOBJS := start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain.o
65

76
LIBC_INC := -nostdinc -I$(SLOF_DIR)/lib/libc/include
87
LIBNET_INC := -I$(SLOF_DIR)/lib/libnet
@@ -11,15 +10,16 @@ NETLDFLAGS := $(LDFLAGS) -Ttext=0x7800000
1110

1211
$(NETOBJS): QEMU_CFLAGS += $(LIBC_INC) $(LIBNET_INC)
1312

14-
s390-netboot.elf: $(NETOBJS)
15-
$(call quiet-command,$(CC) $(NETLDFLAGS) -o $@ $(NETOBJS),"BUILD","$(TARGET_DIR)$@")
13+
s390-netboot.elf: $(NETOBJS) libnet.a libc.a
14+
$(call quiet-command,$(CC) $(NETLDFLAGS) -o $@ $^,"BUILD","$(TARGET_DIR)$@")
1615

1716
s390-netboot.img: s390-netboot.elf
1817
$(call quiet-command,$(STRIP) --strip-unneeded $< -o $@,"STRIP","$(TARGET_DIR)$@")
1918

2019
# libc files:
2120

22-
LIBC_CFLAGS := $(QEMU_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC)
21+
LIBC_CFLAGS = $(QEMU_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \
22+
-MMD -MP -MT $@ -MF $(@:%.o=%.d)
2323

2424
CTYPE_OBJS = isdigit.o isxdigit.o toupper.o
2525
%.o : $(SLOF_DIR)/lib/libc/ctype/%.c
@@ -52,7 +52,8 @@ libc.a: $(LIBCOBJS)
5252

5353
LIBNETOBJS := args.o dhcp.o dns.o icmpv6.o ipv6.o tcp.o udp.o bootp.o \
5454
dhcpv6.o ethernet.o ipv4.o ndp.o tftp.o pxelinux.o
55-
LIBNETCFLAGS := $(QEMU_CFLAGS) $(CFLAGS) -DDHCPARCH=0x1F $(LIBC_INC) $(LIBNET_INC)
55+
LIBNETCFLAGS = $(QEMU_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \
56+
-DDHCPARCH=0x1F -MMD -MP -MT $@ -MF $(@:%.o=%.d)
5657

5758
%.o : $(SLOF_DIR)/lib/libnet/%.c
5859
$(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")

0 commit comments

Comments
 (0)