hammer2 - Add hammer2 boot support
[dragonfly.git] / lib / libstand / Makefile
1 # $FreeBSD: src/lib/libstand/Makefile,v 1.14.2.10 2002/07/22 14:21:50 ru Exp $
2 #
3 # Originally from       $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
4 #
5 # Notes:
6 # - We don't use the libc strerror/sys_errlist because the string table is
7 #   quite large.
8 #
9
10 LIB=            stand
11 NOPROFILE=      YES
12 NOPIC=          YES
13 INCS=           stand.h
14 MAN=            libstand.3
15 CSTD?=          c99
16 WARNS?=         2
17
18 # Mostly OK, some of the libc imports are a bit noisy
19 CFLAGS+=        -ffreestanding
20
21 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
22 CFLAGS+=        -mpreferred-stack-boundary=2
23 FORCE_CPUTYPE=  i386
24 .endif
25
26 .if ${MACHINE_ARCH} == "x86_64"
27 CFLAGS+=        -m32
28 .endif
29
30 # standalone components and stuff we have modified locally
31 SRCS+=  __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
32         globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \
33         sbrk.c twiddle.c zalloc.c zalloc_malloc.c
34
35 # private (pruned) versions of libc string functions
36 SRCS+=  strcasecmp.c
37
38 # string functions from libc
39 .PATH:  ${.CURDIR}/../libc/string
40 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
41 SRCS+=  bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
42         memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
43         strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
44         strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
45 .endif
46 .PATH:  ${.CURDIR}/../libc/quad
47 .if ${MACHINE_ARCH} == "i386"
48 SRCS+=  ucmpdi2.c
49 .endif
50
51 .PATH:  ${.CURDIR}/../../sys/libkern
52 SRCS+=  icrc32.c
53
54 # _setjmp/_longjmp
55 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
56 .PATH:  ${.CURDIR}/i386
57 .else
58 .endif
59 # really only required for i386
60 CFLAGS+=-I${.CURDIR}/../libc/${MACHINE_ARCH}
61 SRCS+=  _setjmp.S
62
63 # decompression functionality from libbz2
64 BZ2DIR= ${.CURDIR}/../../contrib/bzip2
65 .PATH:  ${BZ2DIR}
66 CFLAGS+=-I${BZ2DIR} -DBZ_NO_STDIO -DBZ_NO_COMPRESS
67 SRCS+=  bzlib.c crctable.c decompress.c huffman.c randtable.c bzlib.h \
68         bzlib_private.h
69
70 # check your belt - ugly bzip2 stuff ahead
71 .for file in bzlib.c
72 CLEANFILES+=   ${file}
73
74 ${file}: ${BZ2DIR}/${file} ${file}.diff
75         patch -o ${.TARGET} < ${.ALLSRC:M*.diff} ${.ALLSRC:M*.[ch]}
76 .endfor
77
78 .include "../libz/Makefile.stand"
79
80 # io routines
81 SRCS+=  closeall.c dev.c ioctl.c nullfs.c stat.c \
82         fstat.c close.c lseek.c open.c read.c write.c readdir.c
83
84 # network routines
85 SRCS+=  arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
86
87 # network info services:
88 SRCS+=  bootp.c rarp.c bootparam.c
89
90 # boot filesystems
91 SRCS+=  ufs.c nfs.c cd9660.c tftp.c zipfs.c bzipfs.c gzipfs.c
92 SRCS+=  netif.c nfs.c
93 SRCS+=  dosfs.c ext2fs.c
94 SRCS+=  splitfs.c
95 SRCS+=  hammer1.c
96 SRCS+=  hammer2.c
97
98 .include <bsd.lib.mk>
99
100 .if ${MACHINE_ARCH} == "x86_64"
101 CFLAGS+= -I${.OBJDIR}
102
103 beforedepend ${OBJS}: machine cpu
104
105 machine::
106         mkdir -p machine
107         ${LN} -fs ${.CURDIR}/../../sys/cpu/i386/include/* machine
108         ${LN} -fs ${.CURDIR}/../../sys/platform/pc32/include/* machine
109
110 cpu::
111         ${LN} -hfs ${.CURDIR}/../../sys/cpu/i386/include cpu
112
113 CLEANDIRS+=     machine cpu
114 .endif