2 # Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
5 # - We don't use the libc strerror/sys_errlist because the string table is
20 CFLAGS+= -ffreestanding -Wformat
23 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
24 CFLAGS+= -mpreferred-stack-boundary=2
25 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
27 .if ${MACHINE} == "pc98"
30 .if ${MACHINE_CPUARCH} == "powerpc"
31 CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG
33 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
36 .if ${MACHINE_CPUARCH} == "arm"
37 CFLAGS+= -msoft-float -D_STANDALONE
40 # standalone components and stuff we have modified locally
41 SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
42 globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
43 sbrk.c twiddle.c zalloc.c zalloc_malloc.c
45 # private (pruned) versions of libc string functions
48 .PATH: ${.CURDIR}/../libc/net
52 # string functions from libc
53 .PATH: ${.CURDIR}/../libc/string
54 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" || \
55 ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "amd64" || \
56 ${MACHINE_CPUARCH} == "arm"
57 SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \
58 memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \
59 strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \
60 strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
62 .if ${MACHINE_CPUARCH} == "arm"
63 .PATH: ${.CURDIR}/../libc/arm/gen
66 .if ${MACHINE_CPUARCH} == "ia64"
67 .PATH: ${.CURDIR}/../libc/ia64/string
68 SRCS+= bcmp.c bcopy.S bzero.S ffs.S memccpy.c memchr.c memcmp.c memcpy.S \
69 memmove.S memset.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c \
70 strlen.c strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
71 strspn.c strstr.c strtok.c swab.c
73 .PATH: ${.CURDIR}/../libc/ia64/gen
74 SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S
75 SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S
77 .if ${MACHINE_CPUARCH} == "powerpc"
78 .PATH: ${.CURDIR}/../libc/quad
79 SRCS+= ashldi3.c ashrdi3.c
80 .PATH: ${.CURDIR}/../libc/powerpc/gen
84 # uuid functions from libc
85 .PATH: ${.CURDIR}/../libc/uuid
86 SRCS+= uuid_equal.c uuid_is_nil.c
89 .if ${MACHINE_CPUARCH} == "amd64"
90 .PATH: ${.CURDIR}/i386
91 .elif ${MACHINE_ARCH} == "powerpc64"
92 .PATH: ${.CURDIR}/powerpc
94 .PATH: ${.CURDIR}/${MACHINE_CPUARCH}
98 # decompression functionality from libbz2
99 # NOTE: to actually test this functionality after libbz2 upgrade compile
100 # loader(8) with LOADER_BZIP2_SUPPORT defined
101 .PATH: ${.CURDIR}/../../contrib/bzip2
102 CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS
103 SRCS+= libstand_bzlib_private.h
105 .for file in bzlib.c crctable.c decompress.c huffman.c randtable.c
107 CLEANFILES+= _${file}
110 sed "s|bzlib_private\.h|libstand_bzlib_private.h|" ${.ALLSRC} > ${.TARGET}
113 CLEANFILES+= libstand_bzlib_private.h
114 libstand_bzlib_private.h: bzlib_private.h
115 sed -e 's|<stdlib.h>|"stand.h"|' \
116 ${.ALLSRC} > ${.TARGET}
118 # decompression functionality from libz
119 .PATH: ${.CURDIR}/../libz
120 CFLAGS+=-DHAVE_MEMCPY -I${.CURDIR}/../libz
121 SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h
123 .for file in infback.c inffast.c inflate.c inftrees.c zutil.c
125 CLEANFILES+= _${file}
128 sed -e "s|zutil\.h|libstand_zutil.h|" \
129 -e "s|gzguts\.h|libstand_gzguts.h|" \
130 ${.ALLSRC} > ${.TARGET}
133 # depend on stand.h being able to be included multiple times
134 .for file in zutil.h gzguts.h
135 CLEANFILES+= libstand_${file}
136 libstand_${file}: ${file}
137 sed -e 's|<fcntl.h>|"stand.h"|' \
138 -e 's|<stddef.h>|"stand.h"|' \
139 -e 's|<string.h>|"stand.h"|' \
140 -e 's|<stdio.h>|"stand.h"|' \
141 -e 's|<stdlib.h>|"stand.h"|' \
142 ${.ALLSRC} > ${.TARGET}
146 SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \
147 fstat.c close.c lseek.c open.c read.c write.c readdir.c
150 SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
152 # network info services:
153 SRCS+= bootp.c rarp.c bootparam.c
156 SRCS+= ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c
157 SRCS+= dosfs.c ext2fs.c
159 .if ${MK_NAND} != "no"
163 .include <bsd.lib.mk>
165 .if ${MACHINE_CPUARCH} == "amd64"
166 beforedepend ${OBJS}: machine
167 cleandepend: cleanmachine
172 ln -s ${.CURDIR}/../../sys/i386/include machine