| 1 | # $FreeBSD: src/lib/libstand/Makefile,v 1.14.2.10 2002/07/22 14:21:50 ru Exp $ |
| 2 | # $DragonFly: src/lib/libstand/Makefile,v 1.5 2004/02/02 05:43:15 dillon Exp $ |
| 3 | # |
| 4 | # Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $ |
| 5 | # |
| 6 | # Notes: |
| 7 | # - We don't use the libc strerror/sys_errlist because the string table is |
| 8 | # quite large. |
| 9 | # |
| 10 | |
| 11 | LIB= stand |
| 12 | NOPROFILE= YES |
| 13 | NOPIC= YES |
| 14 | INCS= stand.h |
| 15 | MAN= libstand.3 |
| 16 | |
| 17 | # Mostly OK, some of the libc imports are a bit noisy |
| 18 | CFLAGS+= -Wall -ffreestanding |
| 19 | |
| 20 | .if ${MACHINE_ARCH} == "amd64" |
| 21 | CFLAGS+= -m32 -mpreferred-stack-boundary=2 |
| 22 | .endif |
| 23 | .if ${MACHINE_ARCH} == "i386" |
| 24 | CFLAGS+= -mpreferred-stack-boundary=2 |
| 25 | .endif |
| 26 | |
| 27 | |
| 28 | # standalone components and stuff we have modified locally |
| 29 | SRCS+= __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \ |
| 30 | globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \ |
| 31 | sbrk.c twiddle.c zalloc.c zalloc_malloc.c |
| 32 | |
| 33 | # private (pruned) versions of libc string functions |
| 34 | SRCS+= strcasecmp.c |
| 35 | |
| 36 | # string functions from libc |
| 37 | .PATH: ${.CURDIR}/../libc/string |
| 38 | .if ${MACHINE_ARCH} == "i386" |
| 39 | SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \ |
| 40 | memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \ |
| 41 | strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \ |
| 42 | strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c |
| 43 | .endif |
| 44 | .PATH: ${.CURDIR}/../libc/quad |
| 45 | .if ${MACHINE_ARCH} == "i386" |
| 46 | SRCS+= ucmpdi2.c |
| 47 | .endif |
| 48 | |
| 49 | .if ${MACHINE_ARCH} == "i386" |
| 50 | # _setjmp/_longjmp |
| 51 | .PATH: ${.CURDIR}/${MACHINE_ARCH} |
| 52 | SRCS+= _setjmp.S |
| 53 | # really only required for i386 |
| 54 | CFLAGS+=-I${.CURDIR}/../libc/${MACHINE_ARCH} |
| 55 | .endif |
| 56 | |
| 57 | # decompression functionality from libbz2 |
| 58 | .PATH: ${.CURDIR}/../../contrib/bzip2 |
| 59 | CFLAGS+=-I. -DBZ_NO_STDIO -DBZ_NO_COMPRESS |
| 60 | SRCS+= _bzlib.c _crctable.c _decompress.c _huffman.c _randtable.c _bzlib.h \ |
| 61 | _bzlib_private.h |
| 62 | |
| 63 | # check your belt - ugly bzip2 stuff ahead |
| 64 | .for file in bzlib.c bzlib.h bzlib_private.h |
| 65 | CLEANFILES+= _${file} _${file}.orig |
| 66 | |
| 67 | _${file}: ${file} ${file}.diff |
| 68 | patch -s -b .orig -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]} |
| 69 | .endfor |
| 70 | |
| 71 | .for file in crctable.c decompress.c huffman.c randtable.c |
| 72 | CLEANFILES+= _${file} |
| 73 | |
| 74 | _${file}: ${file} |
| 75 | sed "s|bzlib_private\.h|_bzlib_private.h|" ${.ALLSRC} > ${.TARGET} |
| 76 | .endfor |
| 77 | |
| 78 | # decompression functionality from libz |
| 79 | .PATH: ${.CURDIR}/../libz |
| 80 | CFLAGS+=-DHAVE_MEMCPY |
| 81 | SRCS+= adler32.c crc32.c infblock.c infcodes.c inffast.c inflate.c \ |
| 82 | inftrees.c infutil.c zutil.c |
| 83 | |
| 84 | # io routines |
| 85 | SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \ |
| 86 | fstat.c close.c lseek.c open.c read.c write.c readdir.c |
| 87 | |
| 88 | # network routines |
| 89 | SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c |
| 90 | |
| 91 | # network info services: |
| 92 | SRCS+= bootp.c rarp.c bootparam.c |
| 93 | |
| 94 | # boot filesystems |
| 95 | SRCS+= ufs.c nfs.c cd9660.c tftp.c zipfs.c bzipfs.c gzipfs.c |
| 96 | SRCS+= netif.c nfs.c |
| 97 | SRCS+= dosfs.c ext2fs.c |
| 98 | SRCS+= splitfs.c |
| 99 | |
| 100 | .include <bsd.lib.mk> |