2017-07-12 14:49:51 +02:00
|
|
|
|
2022-05-27 17:35:54 +02:00
|
|
|
SLOF_DIR := $(SRC_PATH)/../../roms/SLOF
|
2017-07-12 14:49:51 +02:00
|
|
|
|
2020-06-30 16:17:30 +02:00
|
|
|
NETOBJS := start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain.o
|
2017-07-12 14:49:51 +02:00
|
|
|
|
|
|
|
LIBC_INC := -nostdinc -I$(SLOF_DIR)/lib/libc/include
|
|
|
|
LIBNET_INC := -I$(SLOF_DIR)/lib/libnet
|
|
|
|
|
2021-04-23 17:20:46 +02:00
|
|
|
NETLDFLAGS := $(LDFLAGS) -Wl,-Ttext=0x7800000
|
2017-07-12 14:49:51 +02:00
|
|
|
|
2022-06-15 11:42:01 +02:00
|
|
|
$(NETOBJS): EXTRA_CFLAGS += $(LIBC_INC) $(LIBNET_INC)
|
2017-07-12 14:49:51 +02:00
|
|
|
|
2020-06-30 16:17:30 +02:00
|
|
|
s390-netboot.elf: $(NETOBJS) libnet.a libc.a
|
2022-09-29 13:42:10 +02:00
|
|
|
$(call quiet-command,$(CC) $(NETLDFLAGS) -o $@ $^,Linking)
|
2017-07-12 14:49:51 +02:00
|
|
|
|
|
|
|
s390-netboot.img: s390-netboot.elf
|
2022-09-29 13:42:10 +02:00
|
|
|
$(call quiet-command,$(STRIP) --strip-unneeded $< -o $@,Stripping $< into)
|
2017-07-12 14:49:51 +02:00
|
|
|
|
|
|
|
# libc files:
|
|
|
|
|
2022-09-29 13:41:54 +02:00
|
|
|
LIBC_CFLAGS = $(EXTRA_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \
|
2020-06-30 16:17:30 +02:00
|
|
|
-MMD -MP -MT $@ -MF $(@:%.o=%.d)
|
2017-07-12 14:49:51 +02:00
|
|
|
|
|
|
|
CTYPE_OBJS = isdigit.o isxdigit.o toupper.o
|
|
|
|
%.o : $(SLOF_DIR)/lib/libc/ctype/%.c
|
2022-09-29 13:42:10 +02:00
|
|
|
$(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling)
|
2017-07-12 14:49:51 +02:00
|
|
|
|
2018-05-22 11:37:29 +02: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 14:49:51 +02:00
|
|
|
%.o : $(SLOF_DIR)/lib/libc/string/%.c
|
2022-09-29 13:42:10 +02:00
|
|
|
$(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling)
|
2017-07-12 14:49:51 +02:00
|
|
|
|
|
|
|
STDLIB_OBJS = atoi.o atol.o strtoul.o strtol.o rand.o malloc.o free.o
|
|
|
|
%.o : $(SLOF_DIR)/lib/libc/stdlib/%.c
|
2022-09-29 13:42:10 +02:00
|
|
|
$(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling)
|
2017-07-12 14:49:51 +02:00
|
|
|
|
2018-05-18 11:31:27 +02:00
|
|
|
STDIO_OBJS = sprintf.o snprintf.o vfprintf.o vsnprintf.o vsprintf.o fprintf.o \
|
2017-07-12 14:49:51 +02:00
|
|
|
printf.o putc.o puts.o putchar.o stdchnls.o fileno.o
|
|
|
|
%.o : $(SLOF_DIR)/lib/libc/stdio/%.c
|
2022-09-29 13:42:10 +02:00
|
|
|
$(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling)
|
2017-07-12 14:49:51 +02:00
|
|
|
|
|
|
|
sbrk.o: $(SLOF_DIR)/slof/sbrk.c
|
2022-09-29 13:42:10 +02:00
|
|
|
$(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,Compiling)
|
2017-07-12 14:49:51 +02:00
|
|
|
|
|
|
|
LIBCOBJS := $(STRING_OBJS) $(CTYPE_OBJS) $(STDLIB_OBJS) $(STDIO_OBJS) sbrk.o
|
|
|
|
|
|
|
|
libc.a: $(LIBCOBJS)
|
2022-09-29 13:42:10 +02:00
|
|
|
$(call quiet-command,$(AR) -rc $@ $^,Creating static library)
|
2017-07-12 14:49:53 +02:00
|
|
|
|
|
|
|
# libnet files:
|
|
|
|
|
|
|
|
LIBNETOBJS := args.o dhcp.o dns.o icmpv6.o ipv6.o tcp.o udp.o bootp.o \
|
2018-05-22 11:37:29 +02:00
|
|
|
dhcpv6.o ethernet.o ipv4.o ndp.o tftp.o pxelinux.o
|
2022-09-29 13:41:54 +02:00
|
|
|
LIBNETCFLAGS = $(EXTRA_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \
|
2020-06-30 16:17:30 +02:00
|
|
|
-DDHCPARCH=0x1F -MMD -MP -MT $@ -MF $(@:%.o=%.d)
|
2017-07-12 14:49:53 +02:00
|
|
|
|
|
|
|
%.o : $(SLOF_DIR)/lib/libnet/%.c
|
2022-09-29 13:42:10 +02:00
|
|
|
$(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@ $<,Compiling)
|
2017-07-12 14:49:53 +02:00
|
|
|
|
|
|
|
libnet.a: $(LIBNETOBJS)
|
2022-09-29 13:42:10 +02:00
|
|
|
$(call quiet-command,$(AR) -rc $@ $^,Creating static library)
|