Prevent build errors by reordering header files.
[dragonfly.git] / lib / libstand / Makefile
CommitLineData
984263bc 1# $FreeBSD: src/lib/libstand/Makefile,v 1.14.2.10 2002/07/22 14:21:50 ru Exp $
f7d9d915 2# $DragonFly: src/lib/libstand/Makefile,v 1.12 2008/10/28 16:54:09 swildner Exp $
984263bc
MD
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
11LIB= stand
12NOPROFILE= YES
13NOPIC= YES
14INCS= stand.h
15MAN= libstand.3
16
17# Mostly OK, some of the libc imports are a bit noisy
f7d9d915 18CFLAGS+= -ffreestanding -std=c99
984263bc 19
17030342
MD
20.if ${MACHINE_ARCH} == "amd64"
21CFLAGS+= -m32 -mpreferred-stack-boundary=2
984263bc
MD
22.endif
23.if ${MACHINE_ARCH} == "i386"
24CFLAGS+= -mpreferred-stack-boundary=2
25.endif
26
27
28# standalone components and stuff we have modified locally
29SRCS+= __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
34SRCS+= strcasecmp.c
35
36# string functions from libc
37.PATH: ${.CURDIR}/../libc/string
c11dfca6 38.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
984263bc
MD
39SRCS+= 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
6af3b87d
MD
44.PATH: ${.CURDIR}/../libc/quad
45.if ${MACHINE_ARCH} == "i386"
46SRCS+= ucmpdi2.c
47.endif
984263bc
MD
48
49# _setjmp/_longjmp
c11dfca6
SS
50.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
51.PATH: ${.CURDIR}/i386
52.else
53.endif
984263bc
MD
54# really only required for i386
55CFLAGS+=-I${.CURDIR}/../libc/${MACHINE_ARCH}
c11dfca6 56SRCS+= _setjmp.S
984263bc
MD
57
58# decompression functionality from libbz2
8b980e40
SS
59BZ2DIR= ${.CURDIR}/../../contrib/bzip2-1.0
60.PATH: ${BZ2DIR}
61CFLAGS+=-I${BZ2DIR} -DBZ_NO_STDIO -DBZ_NO_COMPRESS
62SRCS+= bzlib.c crctable.c decompress.c huffman.c randtable.c bzlib.h \
63 bzlib_private.h
984263bc
MD
64
65# check your belt - ugly bzip2 stuff ahead
8b980e40
SS
66.for file in bzlib.c
67CLEANFILES+= ${file}
984263bc 68
8b980e40
SS
69${file}: ${BZ2DIR}/${file} ${file}.diff
70 patch -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
984263bc
MD
71.endfor
72
dfbf249b 73.include "../libz/Makefile.stand"
984263bc
MD
74
75# io routines
76SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \
77 fstat.c close.c lseek.c open.c read.c write.c readdir.c
78
79# network routines
80SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
81
82# network info services:
83SRCS+= bootp.c rarp.c bootparam.c
84
85# boot filesystems
6af3b87d 86SRCS+= ufs.c nfs.c cd9660.c tftp.c zipfs.c bzipfs.c gzipfs.c
984263bc
MD
87SRCS+= netif.c nfs.c
88SRCS+= dosfs.c ext2fs.c
89SRCS+= splitfs.c
bc767f46 90SRCS+= hammerread.c
984263bc
MD
91
92.include <bsd.lib.mk>