]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - lib/libstand/Makefile
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.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 LIB=            stand
10 NO_PROFILE=
11 NO_PIC=
12 INCS=           stand.h
13 MAN=            libstand.3
14
15 CFLAGS+= -ffreestanding -Wformat
16 CFLAGS+= -I${.CURDIR}
17
18 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
19 CFLAGS+=        -mpreferred-stack-boundary=2
20 CFLAGS+=        -mno-mmx -mno-3dnow -mno-sse -mno-sse2
21 .endif
22 .if ${MACHINE_ARCH} == "i386"
23 CFLAGS+=        -mno-sse3
24 .endif
25 .if ${MACHINE} == "pc98"
26 CFLAGS+=        -Os
27 .endif
28 .if ${MACHINE_ARCH} == "powerpc"
29 CFLAGS+=        -msoft-float -D_STANDALONE
30 .endif
31 .if ${MACHINE_ARCH} == "amd64"
32 CFLAGS+=        -m32 -I.
33 .endif
34
35 # standalone components and stuff we have modified locally
36 SRCS+=  zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
37         globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
38         sbrk.c twiddle.c zalloc.c zalloc_malloc.c
39
40 # private (pruned) versions of libc string functions
41 SRCS+=  strcasecmp.c
42
43 .PATH: ${.CURDIR}/../libc/net
44
45 SRCS+= ntoh.c
46
47 # string functions from libc
48 .PATH: ${.CURDIR}/../libc/string
49 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
50         ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "amd64"
51 SRCS+=  bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
52         memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
53         strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
54         strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
55 .endif
56 .if ${MACHINE_ARCH} == "ia64"
57 .PATH: ${.CURDIR}/../libc/ia64/string
58 SRCS+=  bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
59         memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
60         strcmp.c strcpy.c strcspn.c strlen.c \
61         strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
62         strspn.c strstr.c strtok.c swab.c
63
64 .PATH: ${.CURDIR}/../libc/ia64/gen
65 SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S
66 SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S
67 .endif
68 .if ${MACHINE_ARCH} == "powerpc"
69 .PATH: ${.CURDIR}/../libc/quad
70 SRCS+=  ashldi3.c ashrdi3.c
71 .PATH: ${.CURDIR}/../libc/powerpc/gen
72 SRCS+=  syncicache.c
73 .endif
74
75 # uuid functions from libc
76 .PATH: ${.CURDIR}/../libc/uuid
77 SRCS+= uuid_equal.c uuid_is_nil.c
78
79 # _setjmp/_longjmp
80 .if ${MACHINE_ARCH} == "amd64"
81 .PATH: ${.CURDIR}/i386
82 .else
83 .PATH: ${.CURDIR}/${MACHINE_ARCH}
84 .endif
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: ${.CURDIR}/../../contrib/bzip2
91 CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS
92 SRCS+=  libstand_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|libstand_bzlib_private.h|" ${.ALLSRC} > ${.TARGET}
100 .endfor
101
102 CLEANFILES+= libstand_bzlib_private.h
103 libstand_bzlib_private.h: bzlib_private.h
104         sed -e 's|<stdlib.h>|"stand.h"|' \
105                 ${.ALLSRC} > ${.TARGET}
106
107 # decompression functionality from libz
108 .PATH: ${.CURDIR}/../libz
109 CFLAGS+=-DHAVE_MEMCPY -I${.CURDIR}/../libz
110 SRCS+=  adler32.c crc32.c libstand_zutil.h
111
112 .for file in infback.c inffast.c inflate.c inftrees.c zutil.c
113 SRCS+=  _${file}
114 CLEANFILES+=    _${file}
115
116 _${file}: ${file}
117         sed "s|zutil\.h|libstand_zutil.h|" ${.ALLSRC} > ${.TARGET}
118 .endfor
119
120 # depend on stand.h being able to be included multiple times
121 CLEANFILES+= libstand_zutil.h
122 libstand_zutil.h: zutil.h
123         sed -e 's|<stddef.h>|"stand.h"|' \
124             -e 's|<string.h>|"stand.h"|' \
125             -e 's|<stdlib.h>|"stand.h"|' \
126             ${.ALLSRC} > ${.TARGET}
127
128 # io routines
129 SRCS+=  closeall.c dev.c ioctl.c nullfs.c stat.c \
130         fstat.c close.c lseek.c open.c read.c write.c readdir.c
131
132 # network routines
133 SRCS+=  arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
134
135 # network info services:
136 SRCS+=  bootp.c rarp.c bootparam.c
137
138 # boot filesystems
139 SRCS+=  ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c
140 SRCS+=  dosfs.c ext2fs.c
141 SRCS+=  splitfs.c
142
143 .include <bsd.lib.mk>
144
145 .if ${MACHINE_ARCH} == "amd64"
146 beforedepend ${OBJS}: machine
147 cleandepend: cleanmachine
148 cleanmachine:
149         rm -f machine
150
151 machine:
152         ln -s ${.CURDIR}/../../sys/i386/include machine
153 .endif