]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libstand/Makefile
Merge ^/head r286858 through r287489.
[FreeBSD/FreeBSD.git] / lib / libstand / 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 <src.opts.mk>
13
14 LIBSTAND_SRC=   ${.CURDIR}
15 LIBC_SRC=       ${LIBSTAND_SRC}/../libc
16
17 LIB=            stand
18 NO_PIC=
19 INCS=           stand.h
20 MAN=            libstand.3
21
22 WARNS?=         0
23
24 CFLAGS+= -I${LIBSTAND_SRC}
25
26 # standalone components and stuff we have modified locally
27 SRCS+=  gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
28         globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \
29         sbrk.c twiddle.c zalloc.c zalloc_malloc.c
30
31 # private (pruned) versions of libc string functions
32 SRCS+=  strcasecmp.c
33
34 .PATH: ${LIBC_SRC}/net
35
36 SRCS+= ntoh.c
37
38 # string functions from libc
39 .PATH: ${LIBC_SRC}/string
40 SRCS+=  bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \
41         memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \
42         strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \
43         strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
44 .if ${MACHINE_CPUARCH} == "arm"
45 .PATH: ${LIBC_SRC}/arm/gen
46
47 # Compiler support functions
48 .PATH: ${LIBSTAND_SRC}/../../contrib/compiler-rt/lib/builtins/
49 # __clzsi2 and ctzsi2 for various builtin functions
50 SRCS+=  clzsi2.c ctzsi2.c
51 # Divide and modulus functions called by the compiler
52 SRCS+=   divmoddi4.c  divmodsi4.c  divdi3.c  divsi3.c  moddi3.c  modsi3.c
53 SRCS+=  udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c
54
55 .PATH: ${LIBSTAND_SRC}/../../contrib/compiler-rt/lib/builtins/arm/
56 SRCS+=  aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S
57 SRCS+=  aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S
58 .endif
59
60 .if ${MACHINE_CPUARCH} == "aarch64"
61 .PATH: ${LIBC_SRC}/aarch64/gen
62 .endif
63
64 .if ${MACHINE_CPUARCH} == "powerpc"
65 .PATH: ${LIBC_SRC}/quad
66 SRCS+=  ashldi3.c ashrdi3.c
67 SRCS+=  syncicache.c
68 .endif
69
70 # uuid functions from libc
71 .PATH: ${LIBC_SRC}/uuid
72 SRCS+= uuid_equal.c uuid_is_nil.c
73
74 # _setjmp/_longjmp
75 .PATH: ${LIBSTAND_SRC}/${MACHINE_CPUARCH}
76 SRCS+=  _setjmp.S
77
78 # decompression functionality from libbz2
79 # NOTE: to actually test this functionality after libbz2 upgrade compile
80 # loader(8) with LOADER_BZIP2_SUPPORT defined
81 .PATH: ${LIBSTAND_SRC}/../../contrib/bzip2
82 CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS
83 SRCS+=  libstand_bzlib_private.h
84
85 .for file in bzlib.c crctable.c decompress.c huffman.c randtable.c
86 SRCS+=  _${file}
87 CLEANFILES+=    _${file}
88
89 _${file}: ${file}
90         sed "s|bzlib_private\.h|libstand_bzlib_private.h|" \
91             ${.ALLSRC} > ${.TARGET}
92 .endfor
93
94 CLEANFILES+= libstand_bzlib_private.h
95 libstand_bzlib_private.h: bzlib_private.h
96         sed -e 's|<stdlib.h>|"stand.h"|' \
97                 ${.ALLSRC} > ${.TARGET}
98
99 # decompression functionality from libz
100 .PATH: ${LIBSTAND_SRC}/../libz
101 CFLAGS+=-DHAVE_MEMCPY -I${LIBSTAND_SRC}/../libz
102 SRCS+=  adler32.c crc32.c libstand_zutil.h libstand_gzguts.h
103
104 .for file in infback.c inffast.c inflate.c inftrees.c zutil.c
105 SRCS+=  _${file}
106 CLEANFILES+=    _${file}
107
108 _${file}: ${file}
109         sed -e "s|zutil\.h|libstand_zutil.h|" \
110             -e "s|gzguts\.h|libstand_gzguts.h|" \
111             ${.ALLSRC} > ${.TARGET}
112 .endfor
113
114 # depend on stand.h being able to be included multiple times
115 .for file in zutil.h gzguts.h
116 CLEANFILES+= libstand_${file}
117 libstand_${file}: ${file}
118         sed -e 's|<fcntl.h>|"stand.h"|' \
119             -e 's|<stddef.h>|"stand.h"|' \
120             -e 's|<string.h>|"stand.h"|' \
121             -e 's|<stdio.h>|"stand.h"|' \
122             -e 's|<stdlib.h>|"stand.h"|' \
123             ${.ALLSRC} > ${.TARGET}
124 .endfor
125
126 # io routines
127 SRCS+=  closeall.c dev.c ioctl.c nullfs.c stat.c \
128         fstat.c close.c lseek.c open.c read.c write.c readdir.c
129
130 # network routines
131 SRCS+=  arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
132
133 # network info services:
134 SRCS+=  bootp.c rarp.c bootparam.c
135
136 # boot filesystems
137 SRCS+=  ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c
138 SRCS+=  dosfs.c ext2fs.c
139 SRCS+=  splitfs.c
140 SRCS+=  pkgfs.c
141 .if ${MK_NAND} != "no"
142 SRCS+=  nandfs.c
143 .endif
144
145 .include <bsd.stand.mk>
146 .include <bsd.lib.mk>