Makefile revision 246931
1# $FreeBSD: head/lib/libstand/Makefile 246931 2013-02-18 01:55:53Z kientzle $ 2# Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $ 3# 4# Notes: 5# - We don't use the libc strerror/sys_errlist because the string table is 6# quite large. 7# 8 9.include <bsd.own.mk> 10MK_SSP= no 11 12LIB= stand 13NO_PROFILE= 14NO_PIC= 15INCS= stand.h 16MAN= libstand.3 17 18WARNS?= 0 19 20CFLAGS+= -ffreestanding -Wformat 21CFLAGS+= -I${.CURDIR} 22 23.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" 24CFLAGS+= -mpreferred-stack-boundary=2 25CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float 26.endif 27.if ${MACHINE} == "pc98" 28CFLAGS+= -Os 29.endif 30.if ${MACHINE_CPUARCH} == "powerpc" 31CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG 32.endif 33.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" 34CFLAGS+= -m32 -I. 35.endif 36.if ${MACHINE_CPUARCH} == "arm" 37CFLAGS+= -msoft-float -D_STANDALONE 38.endif 39 40# standalone components and stuff we have modified locally 41SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \ 42 globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \ 43 sbrk.c twiddle.c zalloc.c zalloc_malloc.c 44 45# private (pruned) versions of libc string functions 46SRCS+= strcasecmp.c 47 48.PATH: ${.CURDIR}/../libc/net 49 50SRCS+= ntoh.c 51 52# string functions from libc 53.PATH: ${.CURDIR}/../libc/string 54.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" || \ 55 ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "amd64" || \ 56 ${MACHINE_CPUARCH} == "arm" 57SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ 58 memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ 59 strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \ 60 strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c 61.endif 62.if ${MACHINE_CPUARCH} == "arm" 63.PATH: ${.CURDIR}/../libc/arm/gen 64 65.if ${MK_ARM_EABI} == "no" 66SRCS+= divsi3.S 67.else 68# Compiler support functions 69.PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/ 70SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c moddi3.c modsi3.c 71SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c 72 73.PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/arm/ 74SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S 75SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S 76.endif 77 78.endif 79.if ${MACHINE_CPUARCH} == "ia64" 80.PATH: ${.CURDIR}/../libc/ia64/string 81SRCS+= bcmp.c bcopy.S bzero.S ffs.S memccpy.c memchr.c memcmp.c memcpy.S \ 82 memmove.S memset.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c \ 83 strlen.c strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \ 84 strspn.c strstr.c strtok.c swab.c 85 86.PATH: ${.CURDIR}/../libc/ia64/gen 87SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S 88SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S 89.endif 90.if ${MACHINE_CPUARCH} == "powerpc" 91.PATH: ${.CURDIR}/../libc/quad 92SRCS+= ashldi3.c ashrdi3.c 93.PATH: ${.CURDIR}/../libc/powerpc/gen 94SRCS+= syncicache.c 95.endif 96 97# uuid functions from libc 98.PATH: ${.CURDIR}/../libc/uuid 99SRCS+= uuid_equal.c uuid_is_nil.c 100 101# _setjmp/_longjmp 102.if ${MACHINE_CPUARCH} == "amd64" 103.PATH: ${.CURDIR}/i386 104.elif ${MACHINE_ARCH} == "powerpc64" 105.PATH: ${.CURDIR}/powerpc 106.else 107.PATH: ${.CURDIR}/${MACHINE_CPUARCH} 108.endif 109SRCS+= _setjmp.S 110 111# decompression functionality from libbz2 112# NOTE: to actually test this functionality after libbz2 upgrade compile 113# loader(8) with LOADER_BZIP2_SUPPORT defined 114.PATH: ${.CURDIR}/../../contrib/bzip2 115CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS 116SRCS+= libstand_bzlib_private.h 117 118.for file in bzlib.c crctable.c decompress.c huffman.c randtable.c 119SRCS+= _${file} 120CLEANFILES+= _${file} 121 122_${file}: ${file} 123 sed "s|bzlib_private\.h|libstand_bzlib_private.h|" ${.ALLSRC} > ${.TARGET} 124.endfor 125 126CLEANFILES+= libstand_bzlib_private.h 127libstand_bzlib_private.h: bzlib_private.h 128 sed -e 's|<stdlib.h>|"stand.h"|' \ 129 ${.ALLSRC} > ${.TARGET} 130 131# decompression functionality from libz 132.PATH: ${.CURDIR}/../libz 133CFLAGS+=-DHAVE_MEMCPY -I${.CURDIR}/../libz 134SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h 135 136.for file in infback.c inffast.c inflate.c inftrees.c zutil.c 137SRCS+= _${file} 138CLEANFILES+= _${file} 139 140_${file}: ${file} 141 sed -e "s|zutil\.h|libstand_zutil.h|" \ 142 -e "s|gzguts\.h|libstand_gzguts.h|" \ 143 ${.ALLSRC} > ${.TARGET} 144.endfor 145 146# depend on stand.h being able to be included multiple times 147.for file in zutil.h gzguts.h 148CLEANFILES+= libstand_${file} 149libstand_${file}: ${file} 150 sed -e 's|<fcntl.h>|"stand.h"|' \ 151 -e 's|<stddef.h>|"stand.h"|' \ 152 -e 's|<string.h>|"stand.h"|' \ 153 -e 's|<stdio.h>|"stand.h"|' \ 154 -e 's|<stdlib.h>|"stand.h"|' \ 155 ${.ALLSRC} > ${.TARGET} 156.endfor 157 158# io routines 159SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \ 160 fstat.c close.c lseek.c open.c read.c write.c readdir.c 161 162# network routines 163SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c 164 165# network info services: 166SRCS+= bootp.c rarp.c bootparam.c 167 168# boot filesystems 169SRCS+= ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c 170SRCS+= dosfs.c ext2fs.c 171SRCS+= splitfs.c 172.if ${MK_NAND} != "no" 173SRCS+= nandfs.c 174.endif 175 176.include <bsd.lib.mk> 177 178.if ${MACHINE_CPUARCH} == "amd64" 179beforedepend ${OBJS}: machine 180cleandepend: cleanmachine 181cleanmachine: 182 rm -f machine 183 184machine: 185 ln -s ${.CURDIR}/../../sys/i386/include machine 186.endif 187