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