]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - stand/libsa/Makefile
Move sys/boot to stand. Fix all references to new location
[FreeBSD/FreeBSD.git] / stand / libsa / Makefile
1 # $FreeBSD$
2 # Originally from       $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
3 #
4 # Notes:
5 # - We don't use the libc strerror/sys_errlist because the string table is
6 #   quite large.
7 #
8
9 MK_PROFILE=     no
10 MK_SSP=         no
11
12 .include <bsd.init.mk>
13
14 INTERNALLIB=
15 LIBSA_CPUARCH?=${MACHINE_CPUARCH}
16 LIBC_SRC=       ${SRCTOP}/lib/libc
17
18 LIB?=           sa
19 NO_PIC=
20 WARNS?=         0
21
22 CFLAGS+= -I${SASRC}
23
24 # standalone components and stuff we have modified locally
25 SRCS+=  gzguts.h zutil.h __main.c assert.c bcd.c environment.c getopt.c gets.c \
26         globals.c pager.c panic.c printf.c strdup.c strerror.c strtol.c strtoul.c \
27         random.c sbrk.c twiddle.c zalloc.c zalloc_malloc.c
28
29 # private (pruned) versions of libc string functions
30 SRCS+=  strcasecmp.c
31
32 .PATH: ${LIBC_SRC}/net
33
34 SRCS+= ntoh.c
35
36 # string functions from libc
37 .PATH: ${LIBC_SRC}/string
38 SRCS+=  bcmp.c bcopy.c bzero.c ffs.c fls.c \
39         memccpy.c memchr.c memcmp.c memcpy.c memmove.c memset.c \
40         qdivrem.c strcat.c strchr.c strcmp.c strcpy.c stpcpy.c stpncpy.c \
41         strcspn.c strlcat.c strlcpy.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 .if ${MACHINE_CPUARCH} == "arm"
44 .PATH: ${LIBC_SRC}/arm/gen
45
46 # Do not generate movt/movw, because the relocation fixup for them does not
47 # translate to the -Bsymbolic -pie format required by self_reloc() in loader(8).
48 # Also, the fpu is not available in a standalone environment.
49 .if ${COMPILER_VERSION} < 30800
50 CFLAGS.clang+=  -mllvm -arm-use-movt=0
51 .else
52 CFLAGS.clang+=  -mno-movt
53 .endif
54 CFLAGS.clang+=  -mfpu=none
55
56 # Compiler support functions
57 .PATH: ${SRCTOP}/contrib/compiler-rt/lib/builtins/
58 # __clzsi2 and ctzsi2 for various builtin functions
59 SRCS+=  clzsi2.c ctzsi2.c
60 # Divide and modulus functions called by the compiler
61 SRCS+=   divmoddi4.c  divmodsi4.c  divdi3.c  divsi3.c  moddi3.c  modsi3.c
62 SRCS+=  udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c
63
64 .PATH: ${SRCTOP}/contrib/compiler-rt/lib/builtins/arm/
65 SRCS+=  aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S
66 SRCS+=  aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S
67 .endif
68
69 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv"
70 .PATH: ${LIBC_SRC}/${MACHINE_CPUARCH}/gen
71 .endif
72
73 .if ${MACHINE_CPUARCH} == "powerpc"
74 .PATH: ${LIBC_SRC}/quad
75 SRCS+=  ashldi3.c ashrdi3.c
76 SRCS+=  syncicache.c
77 .endif
78
79 # uuid functions from libc
80 .PATH: ${LIBC_SRC}/uuid
81 SRCS+= uuid_create_nil.c uuid_equal.c uuid_from_string.c uuid_is_nil.c uuid_to_string.c
82
83 # _setjmp/_longjmp
84 .PATH: ${SASRC}/${LIBSA_CPUARCH}
85 SRCS+=  _setjmp.S
86
87 # decompression functionality from libbz2
88 # NOTE: to actually test this functionality after libbz2 upgrade compile
89 # loader(8) with LOADER_BZIP2_SUPPORT defined
90 .PATH: ${SRCTOP}/contrib/bzip2
91 CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS
92 SRCS+=  libsa_bzlib_private.h
93
94 .for file in bzlib.c crctable.c decompress.c huffman.c randtable.c
95 SRCS+=  _${file}
96 CLEANFILES+=    _${file}
97
98 _${file}: ${file}
99         sed "s|bzlib_private\.h|libsa_bzlib_private.h|" \
100             ${.ALLSRC} > ${.TARGET}
101 .endfor
102
103 CLEANFILES+= libsa_bzlib_private.h
104 libsa_bzlib_private.h: bzlib_private.h
105         sed -e 's|<stdlib.h>|"stand.h"|' \
106                 ${.ALLSRC} > ${.TARGET}
107
108 # decompression functionality from zlib
109 .PATH: ${SRCTOP}/contrib/zlib
110 CFLAGS+=-DHAVE_MEMCPY -I${SRCTOP}/contrib/zlib
111 SRCS+=  adler32.c crc32.c libsa_zutil.h libsa_gzguts.h
112
113 .for file in infback.c inffast.c inflate.c inftrees.c zutil.c
114 SRCS+=  _${file}
115 CLEANFILES+=    _${file}
116
117 _${file}: ${file}
118         sed -e "s|zutil\.h|libsa_zutil.h|" \
119             -e "s|gzguts\.h|libsa_gzguts.h|" \
120             ${.ALLSRC} > ${.TARGET}
121 .endfor
122
123 # depend on stand.h being able to be included multiple times
124 .for file in zutil.h gzguts.h
125 CLEANFILES+= libsa_${file}
126 libsa_${file}: ${file}
127         sed -e 's|<fcntl.h>|"stand.h"|' \
128             -e 's|<stddef.h>|"stand.h"|' \
129             -e 's|<string.h>|"stand.h"|' \
130             -e 's|<stdio.h>|"stand.h"|' \
131             -e 's|<stdlib.h>|"stand.h"|' \
132             ${.ALLSRC} > ${.TARGET}
133 .endfor
134
135 # io routines
136 SRCS+=  closeall.c dev.c ioctl.c nullfs.c stat.c \
137         fstat.c close.c lseek.c open.c read.c write.c readdir.c
138
139 # network routines
140 SRCS+=  arp.c ether.c ip.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
141
142 # network info services:
143 SRCS+=  bootp.c rarp.c bootparam.c
144
145 # boot filesystems
146 SRCS+=  ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c
147 SRCS+=  dosfs.c ext2fs.c
148 SRCS+=  splitfs.c
149 SRCS+=  pkgfs.c
150 .if ${MK_NAND} != "no"
151 SRCS+=  nandfs.c
152 .endif
153
154 # explicit_bzero
155 .PATH: ${SYSDIR}/libkern
156 SRCS+=  explicit_bzero.c
157
158 .include <bsd.stand.mk>
159 .include <bsd.lib.mk>