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
16 CFLAGS
+= -ffreestanding
-Wformat
19 .if
${MACHINE_ARCH} == "i386" ||
${MACHINE_ARCH} == "amd64"
20 CFLAGS
+= -mpreferred-stack-boundary
=2
21 CFLAGS
+= -mno-mmx
-mno-3dnow
-mno-sse
-mno-sse2
23 .if
${MACHINE_ARCH} == "i386"
26 .if
${MACHINE} == "pc98"
29 .if
${MACHINE_ARCH} == "powerpc"
30 CFLAGS
+= -msoft-float
-D_STANDALONE
32 .if
${MACHINE_ARCH} == "amd64"
36 # standalone components and stuff we have modified locally
37 SRCS
+= zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
38 globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
39 sbrk.c twiddle.c zalloc.c zalloc_malloc.c
41 # private (pruned) versions of libc string functions
44 .PATH
: ${.CURDIR
}/..
/libc
/net
48 # string functions from libc
49 .PATH
: ${.CURDIR
}/..
/libc
/string
50 .if
${MACHINE_ARCH} == "i386" ||
${MACHINE_ARCH} == "powerpc" || \
51 ${MACHINE_ARCH} == "sparc64" ||
${MACHINE_ARCH} == "amd64"
52 SRCS
+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
53 memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
54 strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
55 strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
57 .if
${MACHINE_ARCH} == "ia64"
58 .PATH
: ${.CURDIR
}/..
/libc
/ia64
/string
59 SRCS
+= bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
60 memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
61 strcmp.c strcpy.c strcspn.c strlen.c \
62 strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
63 strspn.c strstr.c strtok.c swab.c
65 .PATH
: ${.CURDIR
}/..
/libc
/ia64
/gen
66 SRCS
+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S
67 SRCS
+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S
69 .if
${MACHINE_ARCH} == "powerpc"
70 .PATH
: ${.CURDIR
}/..
/libc
/quad
71 SRCS
+= ashldi3.c ashrdi3.c
72 .PATH
: ${.CURDIR
}/..
/libc
/powerpc
/gen
76 # uuid functions from libc
77 .PATH
: ${.CURDIR
}/..
/libc
/uuid
78 SRCS
+= uuid_equal.c uuid_is_nil.c
81 .if
${MACHINE_ARCH} == "amd64"
82 .PATH
: ${.CURDIR
}/i386
84 .PATH
: ${.CURDIR
}/${MACHINE_ARCH}
88 # decompression functionality from libbz2
89 # NOTE: to actually test this functionality after libbz2 upgrade compile
90 # loader(8) with LOADER_BZIP2_SUPPORT defined
91 .PATH
: ${.CURDIR
}/..
/..
/contrib
/bzip2
92 CFLAGS
+= -DBZ_NO_STDIO
-DBZ_NO_COMPRESS
93 SRCS
+= libstand_bzlib_private.h
95 .for file in bzlib.c crctable.c decompress.c huffman.c randtable.c
100 sed
"s|bzlib_private\.h|libstand_bzlib_private.h|" ${.ALLSRC
} > ${.TARGET
}
103 CLEANFILES
+= libstand_bzlib_private.h
104 libstand_bzlib_private.h
: bzlib_private.h
105 sed
-e
's|<stdlib.h>|"stand.h"|' \
106 ${.ALLSRC
} > ${.TARGET
}
108 # decompression functionality from libz
109 .PATH
: ${.CURDIR
}/..
/libz
110 CFLAGS
+=-DHAVE_MEMCPY
-I
${.CURDIR
}/..
/libz
111 SRCS
+= adler32.c crc32.c libstand_zutil.h
113 .for file in infback.c inffast.c inflate.c inftrees.c zutil.c
115 CLEANFILES
+= _
${file}
118 sed
"s|zutil\.h|libstand_zutil.h|" ${.ALLSRC
} > ${.TARGET
}
121 # depend on stand.h being able to be included multiple times
122 CLEANFILES
+= libstand_zutil.h
123 libstand_zutil.h
: zutil.h
124 sed
-e
's|<stddef.h>|"stand.h"|' \
125 -e
's|<string.h>|"stand.h"|' \
126 -e
's|<stdlib.h>|"stand.h"|' \
127 ${.ALLSRC
} > ${.TARGET
}
130 SRCS
+= closeall.c dev.c ioctl.c nullfs.c stat.c \
131 fstat.c close.c lseek.c open.c read.c write.c readdir.c
134 SRCS
+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
136 # network info services:
137 SRCS
+= bootp.c rarp.c bootparam.c
140 SRCS
+= ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c
141 SRCS
+= dosfs.c ext2fs.c
144 .
include <bsd.lib.mk
>
146 .if
${MACHINE_ARCH} == "amd64"
147 beforedepend
${OBJS}: machine
148 cleandepend
: cleanmachine
153 ln
-s
${.CURDIR
}/..
/..
/sys
/i386
/include machine