Revert "rename amd64 architecture to x86_64"
[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
a9f4a7f2 16WARNS?= 2
984263bc
MD
17
18# Mostly OK, some of the libc imports are a bit noisy
f7d9d915 19CFLAGS+= -ffreestanding -std=c99
984263bc 20
3f3709c3 21.if ${MACHINE_ARCH} == "amd64"
17030342 22CFLAGS+= -m32 -mpreferred-stack-boundary=2
984263bc
MD
23.endif
24.if ${MACHINE_ARCH} == "i386"
25CFLAGS+= -mpreferred-stack-boundary=2
26.endif
27
28
29# standalone components and stuff we have modified locally
30SRCS+= __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
31 globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
32 sbrk.c twiddle.c zalloc.c zalloc_malloc.c
33
34# private (pruned) versions of libc string functions
35SRCS+= strcasecmp.c
36
37# string functions from libc
38.PATH: ${.CURDIR}/../libc/string
3f3709c3 39.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
984263bc
MD
40SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
41 memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
42 strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
43 strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
44.endif
6af3b87d
MD
45.PATH: ${.CURDIR}/../libc/quad
46.if ${MACHINE_ARCH} == "i386"
47SRCS+= ucmpdi2.c
48.endif
984263bc
MD
49
50# _setjmp/_longjmp
3f3709c3 51.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
c11dfca6
SS
52.PATH: ${.CURDIR}/i386
53.else
54.endif
984263bc
MD
55# really only required for i386
56CFLAGS+=-I${.CURDIR}/../libc/${MACHINE_ARCH}
c11dfca6 57SRCS+= _setjmp.S
984263bc
MD
58
59# decompression functionality from libbz2
8b980e40
SS
60BZ2DIR= ${.CURDIR}/../../contrib/bzip2-1.0
61.PATH: ${BZ2DIR}
62CFLAGS+=-I${BZ2DIR} -DBZ_NO_STDIO -DBZ_NO_COMPRESS
63SRCS+= bzlib.c crctable.c decompress.c huffman.c randtable.c bzlib.h \
64 bzlib_private.h
984263bc
MD
65
66# check your belt - ugly bzip2 stuff ahead
8b980e40
SS
67.for file in bzlib.c
68CLEANFILES+= ${file}
984263bc 69
8b980e40
SS
70${file}: ${BZ2DIR}/${file} ${file}.diff
71 patch -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
984263bc
MD
72.endfor
73
dfbf249b 74.include "../libz/Makefile.stand"
984263bc
MD
75
76# io routines
77SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \
78 fstat.c close.c lseek.c open.c read.c write.c readdir.c
79
80# network routines
81SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
82
83# network info services:
84SRCS+= bootp.c rarp.c bootparam.c
85
86# boot filesystems
6af3b87d 87SRCS+= ufs.c nfs.c cd9660.c tftp.c zipfs.c bzipfs.c gzipfs.c
984263bc
MD
88SRCS+= netif.c nfs.c
89SRCS+= dosfs.c ext2fs.c
90SRCS+= splitfs.c
bc767f46 91SRCS+= hammerread.c
984263bc
MD
92
93.include <bsd.lib.mk>
479d5a0d 94
3f3709c3 95.if ${MACHINE_ARCH} == "amd64"
479d5a0d
SS
96CFLAGS+= -I${.OBJDIR}
97
98beforedepend ${OBJS}: machine cpu
99
100machine::
101 mkdir -p machine
102 ${LN} -fs ${.CURDIR}/../../sys/cpu/i386/include/* machine
103 ${LN} -fs ${.CURDIR}/../../sys/platform/pc32/include/* machine
104
105cpu::
f207c6e7 106 ${LN} -hfs ${.CURDIR}/../../sys/cpu/i386/include cpu
479d5a0d
SS
107
108CLEANDIRS+= machine cpu
109.endif