14a5d661aSToomas Soome# 24a5d661aSToomas Soome# This file and its contents are supplied under the terms of the 34a5d661aSToomas Soome# Common Development and Distribution License ("CDDL"), version 1.0. 44a5d661aSToomas Soome# You may only use this file in accordance with the terms of version 54a5d661aSToomas Soome# 1.0 of the CDDL. 64a5d661aSToomas Soome# 74a5d661aSToomas Soome# A full copy of the text of the CDDL should have accompanied this 84a5d661aSToomas Soome# source. A copy of the CDDL is also available via the Internet at 94a5d661aSToomas Soome# http://www.illumos.org/license/CDDL. 104a5d661aSToomas Soome# 114a5d661aSToomas Soome 124a5d661aSToomas Soome# 134a5d661aSToomas Soome# Copyright 2016 Toomas Soome <tsoome@me.com> 144a5d661aSToomas Soome# 154a5d661aSToomas Soome 164a5d661aSToomas Soome# 174a5d661aSToomas Soome# Notes: 184a5d661aSToomas Soome# - We don't use the libc strerror/sys_errlist because the string table is 194a5d661aSToomas Soome# quite large. 204a5d661aSToomas Soome# 214a5d661aSToomas Soome 224a5d661aSToomas Soome# standalone components and stuff we have modified locally 234a5d661aSToomas SoomeSRCS= $(LIB_BASE)/libz/gzguts.h $(LIB_BASE)/libz/zutil.h 244a5d661aSToomas SoomeSRCS += $(LIBSTAND_SRC)/__main.c $(LIBSTAND_SRC)/assert.c 2531da4aefSToomas SoomeSRCS += $(LIBSTAND_SRC)/bcd.c $(LIBSTAND_SRC)/environment.c 2631da4aefSToomas SoomeSRCS += $(LIBSTAND_SRC)/getopt.c $(LIBSTAND_SRC)/strtol.c 2731da4aefSToomas SoomeSRCS += $(LIBSTAND_SRC)/strtoul.c $(LIBSTAND_SRC)/random.c 2831da4aefSToomas SoomeSRCS += $(LIBSTAND_SRC)/sbrk.c $(LIBSTAND_SRC)/twiddle.c 2931da4aefSToomas SoomeSRCS += $(LIBSTAND_SRC)/zalloc.c $(LIBSTAND_SRC)/zalloc_malloc.c 304a5d661aSToomas Soome 3131da4aefSToomas SoomeOBJS= __main.o assert.o bcd.o environment.o \ 324a5d661aSToomas Soome getopt.o gets.o globals.o pager.o printf.o \ 334a5d661aSToomas Soome strdup.o strerror.o strtol.o strtoul.o random.o \ 344a5d661aSToomas Soome sbrk.o twiddle.o zalloc.o zalloc_malloc.o 354a5d661aSToomas Soome 364a5d661aSToomas Soome# private (pruned) versions of libc string functions 374a5d661aSToomas SoomeSRCS += $(LIBSTAND_SRC)/strcasecmp.c 384a5d661aSToomas SoomeOBJS += strcasecmp.o 394a5d661aSToomas Soome 404a5d661aSToomas Soome# from libc 414a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/net/ntoh.c 424a5d661aSToomas SoomeOBJS += ntoh.o 434a5d661aSToomas Soome 444a5d661aSToomas Soome# string functions from libc 454a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/string/bcmp.c $(LIB_BASE)/libc/string/bcopy.c 464a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/string/bzero.c $(LIB_BASE)/libc/string/ffs.c 474a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/string/fls.c $(LIB_BASE)/libc/string/memccpy.c 484a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/string/memchr.c $(LIB_BASE)/libc/string/memcmp.c 494a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/string/memcpy.c $(LIB_BASE)/libc/string/memmove.c 504a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/string/memset.c $(LIB_BASE)/libc/string/strcat.c 514a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/string/strchr.c $(LIB_BASE)/libc/string/strcmp.c 52cf7dd858SToomas SoomeSRCS += $(LIB_BASE)/libc/string/strcpy.c $(LIB_BASE)/libc/string/stpcpy.c 53cf7dd858SToomas SoomeSRCS += $(LIB_BASE)/libc/string/stpncpy.c $(LIB_BASE)/libc/string/strcspn.c 544a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/string/strlcat.c $(LIB_BASE)/libc/string/strlcpy.c 554a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/string/strlen.c $(LIB_BASE)/libc/string/strncat.c 564a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/string/strncmp.c $(LIB_BASE)/libc/string/strncpy.c 574a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/string/strpbrk.c $(LIB_BASE)/libc/string/strrchr.c 584a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/string/strsep.c $(LIB_BASE)/libc/string/strspn.c 594a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/string/strstr.c $(LIB_BASE)/libc/string/strtok.c 604a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/string/swab.c 614a5d661aSToomas Soome 624a5d661aSToomas SoomeSRCS += $(LIBSTAND_SRC)/qdivrem.c 634a5d661aSToomas Soome 644a5d661aSToomas SoomeOBJS += bcmp.o bcopy.o bzero.o ffs.o fls.o \ 654a5d661aSToomas Soome memccpy.o memchr.o memcmp.o memcpy.o memmove.o memset.o \ 66cf7dd858SToomas Soome qdivrem.o strcat.o strchr.o strcmp.o strcpy.o stpcpy.o stpncpy.o \ 674a5d661aSToomas Soome strcspn.o strlcat.o strlcpy.o strlen.o strncat.o strncmp.o strncpy.o \ 684a5d661aSToomas Soome strpbrk.o strrchr.o strsep.o strspn.o strstr.o strtok.o swab.o 694a5d661aSToomas Soome 704a5d661aSToomas Soome# uuid functions from libc 714a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/uuid/uuid_create_nil.c 724a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/uuid/uuid_equal.c 734a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libc/uuid/uuid_is_nil.c 744a5d661aSToomas Soome 754a5d661aSToomas SoomeSRCS += $(LIBSTAND_SRC)/uuid_from_string.c 764a5d661aSToomas SoomeSRCS += $(LIBSTAND_SRC)/uuid_to_string.c 774a5d661aSToomas Soome 784a5d661aSToomas SoomeOBJS += uuid_create_nil.o uuid_equal.o uuid_from_string.o uuid_is_nil.o \ 794a5d661aSToomas Soome uuid_to_string.o 804a5d661aSToomas Soome 814a5d661aSToomas Soome# decompression functionality from libbz2 824a5d661aSToomas Soome# NOTE: to actually test this functionality after libbz2 upgrade compile 834a5d661aSToomas Soome# loader(8) with LOADER_BZIP2_SUPPORT defined 846cac02c5SYuri PankovCFLAGS += -DBZ_LOADER -DBZ_NO_STDIO -DBZ_NO_COMPRESS 854a5d661aSToomas SoomeSRCS += libstand_bzlib_private.h 864a5d661aSToomas Soome 874a5d661aSToomas SoomeSRCS += _bzlib.c _crctable.c _decompress.c _huffman.c _randtable.c 884a5d661aSToomas SoomeOBJS += _bzlib.o _crctable.o _decompress.o _huffman.o _randtable.o 894a5d661aSToomas SoomeCLEANFILES += _bzlib.c _crctable.c _decompress.c _huffman.c _randtable.c 904a5d661aSToomas Soome 916cac02c5SYuri Pankov_bzlib.c: $(SRC)/common/bzip2/bzlib.c 924a5d661aSToomas Soome sed "s|bzlib_private\.h|libstand_bzlib_private.h|" $^ > $@ 934a5d661aSToomas Soome 946cac02c5SYuri Pankov_crctable.c: $(SRC)/common/bzip2/crctable.c 954a5d661aSToomas Soome sed "s|bzlib_private\.h|libstand_bzlib_private.h|" $^ > $@ 964a5d661aSToomas Soome 976cac02c5SYuri Pankov_decompress.c: $(SRC)/common/bzip2/decompress.c 984a5d661aSToomas Soome sed "s|bzlib_private\.h|libstand_bzlib_private.h|" $^ > $@ 994a5d661aSToomas Soome 1006cac02c5SYuri Pankov_huffman.c: $(SRC)/common/bzip2/huffman.c 1014a5d661aSToomas Soome sed "s|bzlib_private\.h|libstand_bzlib_private.h|" $^ > $@ 1024a5d661aSToomas Soome 1036cac02c5SYuri Pankov_randtable.c: $(SRC)/common/bzip2/randtable.c 1044a5d661aSToomas Soome sed "s|bzlib_private\.h|libstand_bzlib_private.h|" $^ > $@ 1054a5d661aSToomas Soome 1064a5d661aSToomas SoomeCLEANFILES += libstand_bzlib_private.h 1076cac02c5SYuri Pankovlibstand_bzlib_private.h: $(SRC)/common/bzip2/bzlib_private.h 1084a5d661aSToomas Soome sed -e 's|<stdlib.h>|"stand.h"|' $^ > $@ 1094a5d661aSToomas Soome 1104a5d661aSToomas Soome# decompression functionality from libz 1114a5d661aSToomas SoomeCFLAGS += -DHAVE_MEMCPY -I$(LIB_BASE)/libz 1124a5d661aSToomas SoomeSRCS += $(LIB_BASE)/libz/adler32.c $(LIB_BASE)/libz/crc32.c \ 1134a5d661aSToomas Soome libstand_zutil.h libstand_gzguts.h 1144a5d661aSToomas SoomeOBJS += adler32.o crc32.o 1154a5d661aSToomas Soome 1164a5d661aSToomas Soome_infback.c: $(LIB_BASE)/libz/infback.c 1174a5d661aSToomas Soome sed -e "s|zutil\.h|libstand_zutil.h|" \ 1184a5d661aSToomas Soome -e "s|gzguts\.h|libstand_gzguts.h|" \ 1194a5d661aSToomas Soome $^ > $@ 1204a5d661aSToomas Soome_inffast.c: $(LIB_BASE)/libz/inffast.c 1214a5d661aSToomas Soome sed -e "s|zutil\.h|libstand_zutil.h|" \ 1224a5d661aSToomas Soome -e "s|gzguts\.h|libstand_gzguts.h|" \ 1234a5d661aSToomas Soome $^ > $@ 1244a5d661aSToomas Soome_inflate.c: $(LIB_BASE)/libz/inflate.c 1254a5d661aSToomas Soome sed -e "s|zutil\.h|libstand_zutil.h|" \ 1264a5d661aSToomas Soome -e "s|gzguts\.h|libstand_gzguts.h|" \ 1274a5d661aSToomas Soome $^ > $@ 1284a5d661aSToomas Soome_inftrees.c: $(LIB_BASE)/libz/inftrees.c 1294a5d661aSToomas Soome sed -e "s|zutil\.h|libstand_zutil.h|" \ 1304a5d661aSToomas Soome -e "s|gzguts\.h|libstand_gzguts.h|" \ 1314a5d661aSToomas Soome $^ > $@ 1324a5d661aSToomas Soome_zutil.c: $(LIB_BASE)/libz/zutil.c 1334a5d661aSToomas Soome sed -e "s|zutil\.h|libstand_zutil.h|" \ 1344a5d661aSToomas Soome -e "s|gzguts\.h|libstand_gzguts.h|" \ 1354a5d661aSToomas Soome $^ > $@ 1364a5d661aSToomas Soome 1374a5d661aSToomas SoomeSRCS += _infback.c _inffast.c _inflate.c _inftrees.c _zutil.c 1384a5d661aSToomas SoomeOBJS += _infback.o _inffast.o _inflate.o _inftrees.o _zutil.o 1394a5d661aSToomas SoomeCLEANFILES += _infback.c _inffast.c _inflate.c _inftrees.c _zutil.c 1404a5d661aSToomas Soome 1414a5d661aSToomas Soome# depend on stand.h being able to be included multiple times 1424a5d661aSToomas Soomelibstand_zutil.h: $(LIB_BASE)/libz/zutil.h 1434a5d661aSToomas Soome sed -e 's|<fcntl.h>|"stand.h"|' \ 1444a5d661aSToomas Soome -e 's|<stddef.h>|"stand.h"|' \ 1454a5d661aSToomas Soome -e 's|<string.h>|"stand.h"|' \ 1464a5d661aSToomas Soome -e 's|<stdio.h>|"stand.h"|' \ 1474a5d661aSToomas Soome -e 's|<stdlib.h>|"stand.h"|' \ 1484a5d661aSToomas Soome $^ > $@ 1494a5d661aSToomas Soome 1504a5d661aSToomas Soomelibstand_gzguts.h: $(LIB_BASE)/libz/gzguts.h 1514a5d661aSToomas Soome sed -e 's|<fcntl.h>|"stand.h"|' \ 1524a5d661aSToomas Soome -e 's|<stddef.h>|"stand.h"|' \ 1534a5d661aSToomas Soome -e 's|<string.h>|"stand.h"|' \ 1544a5d661aSToomas Soome -e 's|<stdio.h>|"stand.h"|' \ 1554a5d661aSToomas Soome -e 's|<stdlib.h>|"stand.h"|' \ 1564a5d661aSToomas Soome $^ > $@ 1574a5d661aSToomas Soome 1584a5d661aSToomas SoomeCLEANFILES += libstand_zutil.h libstand_gzguts.h 1594a5d661aSToomas Soome 1604a5d661aSToomas Soome# io routines 1614a5d661aSToomas SoomeSRCS += $(LIBSTAND_SRC)/closeall.c $(LIBSTAND_SRC)/dev.c \ 1624a5d661aSToomas Soome $(LIBSTAND_SRC)/ioctl.c $(LIBSTAND_SRC)/nullfs.c \ 1634a5d661aSToomas Soome $(LIBSTAND_SRC)/stat.c $(LIBSTAND_SRC)/fstat.c $(LIBSTAND_SRC)/close.c \ 1644a5d661aSToomas Soome $(LIBSTAND_SRC)/lseek.c $(LIBSTAND_SRC)/open.c $(LIBSTAND_SRC)/read.c \ 1654a5d661aSToomas Soome $(LIBSTAND_SRC)/write.c $(LIBSTAND_SRC)/readdir.c 1664a5d661aSToomas Soome 1674a5d661aSToomas SoomeOBJS += closeall.o dev.o ioctl.o nullfs.o stat.o fstat.o close.o lseek.o \ 1684a5d661aSToomas Soome open.o read.o write.o readdir.o 1694a5d661aSToomas Soome 1704a5d661aSToomas Soome# network routines 171*a4a2722fSToomas SoomeSRCS += $(LIBSTAND_SRC)/arp.c $(LIBSTAND_SRC)/ether.c $(LIBSTAND_SRC)/ip.c \ 1724a5d661aSToomas Soome $(LIBSTAND_SRC)/inet_ntoa.c $(LIBSTAND_SRC)/in_cksum.c \ 1734a5d661aSToomas Soome $(LIBSTAND_SRC)/net.c $(LIBSTAND_SRC)/udp.c $(LIBSTAND_SRC)/netif.c \ 1744a5d661aSToomas Soome $(LIBSTAND_SRC)/rpc.c 175*a4a2722fSToomas SoomeOBJS += arp.o ether.o ip.o inet_ntoa.o in_cksum.o net.o udp.o netif.o rpc.o 1764a5d661aSToomas Soome 1774a5d661aSToomas Soome# network info services: 1784a5d661aSToomas SoomeSRCS += $(LIBSTAND_SRC)/bootp.c $(LIBSTAND_SRC)/rarp.c \ 1794a5d661aSToomas Soome $(LIBSTAND_SRC)/bootparam.c 1804a5d661aSToomas SoomeOBJS += bootp.o rarp.o bootparam.o 1814a5d661aSToomas Soome 1824a5d661aSToomas Soome# boot filesystems 1834a5d661aSToomas SoomeSRCS += $(LIBSTAND_SRC)/ufs.c 1844a5d661aSToomas SoomeSRCS += $(LIBSTAND_SRC)/nfs.c 1854a5d661aSToomas SoomeSRCS += $(LIBSTAND_SRC)/cd9660.c 1864a5d661aSToomas SoomeSRCS += $(LIBSTAND_SRC)/tftp.c 1874a5d661aSToomas SoomeSRCS += $(LIBSTAND_SRC)/gzipfs.c 1884a5d661aSToomas SoomeSRCS += $(LIBSTAND_SRC)/bzipfs.c 1894a5d661aSToomas SoomeSRCS += $(LIBSTAND_SRC)/dosfs.c 1904a5d661aSToomas SoomeOBJS += ufs.o 1914a5d661aSToomas SoomeOBJS += nfs.o 1924a5d661aSToomas SoomeOBJS += cd9660.o 1934a5d661aSToomas SoomeOBJS += tftp.o 1944a5d661aSToomas SoomeOBJS += gzipfs.o 1954a5d661aSToomas SoomeOBJS += bzipfs.o 1964a5d661aSToomas SoomeOBJS += dosfs.o 1974a5d661aSToomas Soome# 198