2017-07-12 15:49:51 +03:00
|
|
|
|
|
|
|
SLOF_DIR := $(SRC_PATH)/roms/SLOF
|
|
|
|
|
2020-06-30 17:17:30 +03:00
|
|
|
NETOBJS := start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain.o
|
2017-07-12 15:49:51 +03:00
|
|
|
|
|
|
|
LIBC_INC := -nostdinc -I$(SLOF_DIR)/lib/libc/include
|
|
|
|
LIBNET_INC := -I$(SLOF_DIR)/lib/libnet
|
|
|
|
|
|
|
|
NETLDFLAGS := $(LDFLAGS) -Ttext=0x7800000
|
|
|
|
|
|
|
|
$(NETOBJS): QEMU_CFLAGS += $(LIBC_INC) $(LIBNET_INC)
|
|
|
|
|
2020-06-30 17:17:30 +03:00
|
|
|
s390-netboot.elf: $(NETOBJS) libnet.a libc.a
|
|
|
|
$(call quiet-command,$(CC) $(NETLDFLAGS) -o $@ $^,"BUILD","$(TARGET_DIR)$@")
|
2017-07-12 15:49:51 +03:00
|
|
|
|
|
|
|
s390-netboot.img: s390-netboot.elf
|
|
|
|
$(call quiet-command,$(STRIP) --strip-unneeded $< -o $@,"STRIP","$(TARGET_DIR)$@")
|
|
|
|
|
|
|
|
# libc files:
|
|
|
|
|
2020-06-30 17:17:30 +03:00
|
|
|
LIBC_CFLAGS = $(QEMU_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \
|
|
|
|
-MMD -MP -MT $@ -MF $(@:%.o=%.d)
|
2017-07-12 15:49:51 +03:00
|
|
|
|
|
|
|
CTYPE_OBJS = isdigit.o isxdigit.o toupper.o
|
|
|
|
%.o : $(SLOF_DIR)/lib/libc/ctype/%.c
|
|
|
|
$(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")
|
|
|
|
|
2018-05-22 12:37:29 +03:00
|
|
|
STRING_OBJS = strcat.o strchr.o strrchr.o strcpy.o strlen.o strncpy.o \
|
|
|
|
strcmp.o strncmp.o strcasecmp.o strncasecmp.o strstr.o \
|
|
|
|
memset.o memcpy.o memmove.o memcmp.o
|
2017-07-12 15:49:51 +03:00
|
|
|
%.o : $(SLOF_DIR)/lib/libc/string/%.c
|
|
|
|
$(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")
|
|
|
|
|
|
|
|
STDLIB_OBJS = atoi.o atol.o strtoul.o strtol.o rand.o malloc.o free.o
|
|
|
|
%.o : $(SLOF_DIR)/lib/libc/stdlib/%.c
|
|
|
|
$(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")
|
|
|
|
|
2018-05-18 12:31:27 +03:00
|
|
|
STDIO_OBJS = sprintf.o snprintf.o vfprintf.o vsnprintf.o vsprintf.o fprintf.o \
|
2017-07-12 15:49:51 +03:00
|
|
|
printf.o putc.o puts.o putchar.o stdchnls.o fileno.o
|
|
|
|
%.o : $(SLOF_DIR)/lib/libc/stdio/%.c
|
|
|
|
$(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")
|
|
|
|
|
|
|
|
sbrk.o: $(SLOF_DIR)/slof/sbrk.c
|
|
|
|
$(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")
|
|
|
|
|
|
|
|
LIBCOBJS := $(STRING_OBJS) $(CTYPE_OBJS) $(STDLIB_OBJS) $(STDIO_OBJS) sbrk.o
|
|
|
|
|
|
|
|
libc.a: $(LIBCOBJS)
|
|
|
|
$(call quiet-command,$(AR) -rc $@ $^,"AR","$(TARGET_DIR)$@")
|
2017-07-12 15:49:53 +03:00
|
|
|
|
|
|
|
# libnet files:
|
|
|
|
|
|
|
|
LIBNETOBJS := args.o dhcp.o dns.o icmpv6.o ipv6.o tcp.o udp.o bootp.o \
|
2018-05-22 12:37:29 +03:00
|
|
|
dhcpv6.o ethernet.o ipv4.o ndp.o tftp.o pxelinux.o
|
2020-06-30 17:17:30 +03:00
|
|
|
LIBNETCFLAGS = $(QEMU_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \
|
|
|
|
-DDHCPARCH=0x1F -MMD -MP -MT $@ -MF $(@:%.o=%.d)
|
2017-07-12 15:49:53 +03:00
|
|
|
|
|
|
|
%.o : $(SLOF_DIR)/lib/libnet/%.c
|
|
|
|
$(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")
|
|
|
|
|
|
|
|
libnet.a: $(LIBNETOBJS)
|
|
|
|
$(call quiet-command,$(AR) -rc $@ $^,"AR","$(TARGET_DIR)$@")
|