libstand: Add strtoul().
[dragonfly.git] / lib / libstand / Makefile
CommitLineData
984263bc
MD
1# $FreeBSD: src/lib/libstand/Makefile,v 1.14.2.10 2002/07/22 14:21:50 ru Exp $
2#
3# Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
4#
5# Notes:
6# - We don't use the libc strerror/sys_errlist because the string table is
7# quite large.
8#
9
196ed6cb 10LIB?= stand
984263bc
MD
11NOPROFILE= YES
12NOPIC= YES
196ed6cb
IV
13INCS?= stand.h
14MAN?= libstand.3
2983445f 15CSTD?= c99
a9f4a7f2 16WARNS?= 2
0de090e1 17NO_STRICT_ALIASING=
984263bc 18
602ba88f 19LIBSTAND_SRC?= ${.CURDIR}
602ba88f 20LIBSTAND_ARCH?= ${MACHINE_ARCH}
602ba88f 21
984263bc 22# Mostly OK, some of the libc imports are a bit noisy
2983445f 23CFLAGS+= -ffreestanding
984263bc 24
798dce15 25.if (${CFLAGS:M-flto} && ${CCVER:Mgcc*})
26CFLAGS+= -fno-builtin # LTO exposes too much stuff
27.endif
28
196ed6cb
IV
29.if ${LIBSTAND_ARCH} == "x86_64"
30CFLAGS+= -mno-red-zone -fPIC
31.endif
32
602ba88f 33.if ${LIBSTAND_ARCH} == "i386"
81e6e8a9 34.if ${CCVER:Mgcc*}
984263bc 35CFLAGS+= -mpreferred-stack-boundary=2
81e6e8a9 36.endif
eb45cc97 37FORCE_CPUTYPE= i386
602ba88f 38CFLAGS+= -m32
984263bc
MD
39.endif
40
602ba88f
IV
41.if ${LIBSTAND_ARCH} == "i386" || ${LIBSTAND_ARCH} == "x86_64"
42CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
7087ece4 43.endif
984263bc
MD
44
45# standalone components and stuff we have modified locally
46SRCS+= __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
20125565
SW
47 globals.c pager.c printf.c random.c \
48 strdup.c strerror.c strtol.c strtoul.c sbrk.c \
49 twiddle.c zalloc.c zalloc_malloc.c
984263bc
MD
50
51# private (pruned) versions of libc string functions
52SRCS+= strcasecmp.c
53
54# string functions from libc
602ba88f
IV
55.PATH: ${LIBSTAND_SRC}/../libc/string
56.if ${LIBSTAND_ARCH} == "x86_64" || ${LIBSTAND_ARCH} == "i386"
984263bc
MD
57SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
58 memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
59 strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
60 strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
798dce15 61
62# math stuff, thus no -flto!
63qdivrem.o: qdivrem.c
64 ${CC} ${CFLAGS:N-flto} -c -o ${.TARGET} ${.IMPSRC}
984263bc 65.endif
602ba88f 66.PATH: ${LIBSTAND_SRC}/../../sys/libkern
cdfd0a3e
MD
67SRCS+= icrc32.c
68
984263bc 69# _setjmp/_longjmp
602ba88f
IV
70.PATH: ${LIBSTAND_SRC}/${LIBSTAND_ARCH}
71.if ${LIBSTAND_ARCH} == "x86_64" || ${LIBSTAND_ARCH} == "i386"
984263bc 72# really only required for i386
602ba88f
IV
73CFLAGS+=-I${LIBSTAND_SRC}/../libc/${MACHINE_ARCH}
74.endif
c11dfca6 75SRCS+= _setjmp.S
984263bc
MD
76
77# decompression functionality from libbz2
602ba88f 78BZ2DIR= ${LIBSTAND_SRC}/../../contrib/bzip2
8b980e40
SS
79.PATH: ${BZ2DIR}
80CFLAGS+=-I${BZ2DIR} -DBZ_NO_STDIO -DBZ_NO_COMPRESS
81SRCS+= bzlib.c crctable.c decompress.c huffman.c randtable.c bzlib.h \
82 bzlib_private.h
984263bc
MD
83
84# check your belt - ugly bzip2 stuff ahead
8b980e40
SS
85.for file in bzlib.c
86CLEANFILES+= ${file}
984263bc 87
8b980e40
SS
88${file}: ${BZ2DIR}/${file} ${file}.diff
89 patch -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
984263bc
MD
90.endfor
91
dfbf249b 92.include "../libz/Makefile.stand"
984263bc
MD
93
94# io routines
95SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \
96 fstat.c close.c lseek.c open.c read.c write.c readdir.c
97
98# network routines
99SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
100
101# network info services:
102SRCS+= bootp.c rarp.c bootparam.c
103
104# boot filesystems
6af3b87d 105SRCS+= ufs.c nfs.c cd9660.c tftp.c zipfs.c bzipfs.c gzipfs.c
984263bc
MD
106SRCS+= netif.c nfs.c
107SRCS+= dosfs.c ext2fs.c
108SRCS+= splitfs.c
cdfd0a3e
MD
109SRCS+= hammer1.c
110SRCS+= hammer2.c
984263bc
MD
111
112.include <bsd.lib.mk>