xref: /original-bsd/lib/libc/string/Makefile.inc (revision 3b6250d9)
1#	@(#)Makefile.inc	5.10 (Berkeley) 06/04/92
2
3# string sources
4.PATH: ${.CURDIR}/${MACHINE}/string ${.CURDIR}/string
5
6SRCS+=	memccpy.c strcasecmp.c strcoll.c strdup.c strerror.c \
7	strftime.c strmode.c strtok.c strxfrm.c swab.c
8
9.if   (${MACHINE} == "hp300" || ${MACHINE} == "luna68k")
10SRCS+=	bcmp.s bcopy.s bzero.s ffs.s index.s memchr.c memcmp.c memset.c \
11	rindex.s strcat.c strcmp.s strcpy.s strcspn.c strlen.s \
12	strncat.c strncmp.s strncpy.s strpbrk.c strsep.c \
13	strspn.c strstr.c
14.elif (${MACHINE} == "i386")
15SRCS+=	bcmp.c bcopy.c bzero.s ffs.c index.c memchr.c memcmp.c memset.c \
16	rindex.c strcat.c strcmp.c strcpy.c strcspn.c strlen.c \
17	strncat.c strncmp.c strncpy.c strpbrk.c strsep.c \
18	strspn.c strstr.c
19.elif (${MACHINE} == "mips")
20SRCS+=	bcmp.s bcopy.s bzero.s ffs.s index.s memchr.c memcmp.c memset.c \
21	rindex.s strcat.c strcmp.s strcpy.c strcspn.c strlen.s \
22	strncat.c strncmp.c strncpy.c strpbrk.c strsep.c \
23	strspn.c strstr.c
24.elif (${MACHINE} == "tahoe")
25SRCS+=	bcmp.s bcopy.s bzero.s ffs.s index.c memchr.c memcmp.s memset.c \
26	rindex.c strcat.s strcmp.s strcpy.s strcspn.c strlen.s \
27	strncat.s strncmp.s strncpy.s strpbrk.c strsep.c \
28	strspn.c strstr.c
29SRCS+=	memmove.s
30.elif (${MACHINE} == "vax")
31SRCS+=	bcmp.s bcopy.s bzero.s ffs.s index.c memchr.s memcmp.s memset.s \
32	rindex.s strcat.s strcmp.s strcpy.s strcspn.s strlen.s \
33	strncat.s strncmp.s strncpy.s strpbrk.s strsep.s \
34	strspn.s strstr.s
35SRCS+=	memmove.s strchr.s strrchr.s
36.endif
37
38# if no machine specific memmove(3), build one out of bcopy(3).
39.if empty(SRCS:Mmemmove.s)
40OBJS+=	memmove.o
41memmove.o: bcopy.c
42	${CC} -DMEMMOVE ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
43	@${LD} -x -r ${.TARGET}
44	@mv a.out ${.TARGET}
45
46memmove.po: bcopy.c
47	${CC} -DMEMMOVE ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
48	@${LD} -X -r ${.TARGET}
49	@mv a.out ${.TARGET}
50.endif
51
52# if no machine specific memcpy(3), build one out of bcopy(3).
53.if empty(SRCS:Mmemcpy.s)
54OBJS+=	memcpy.o
55memcpy.o: bcopy.c
56	${CC} -DMEMCOPY ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
57	@${LD} -x -r ${.TARGET}
58	@mv a.out ${.TARGET}
59
60memcpy.po: bcopy.c
61	${CC} -DMEMCOPY ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
62	@${LD} -X -r ${.TARGET}
63	@mv a.out ${.TARGET}
64.endif
65
66# if no machine specific strchr(3), build one out of index(3).
67.if empty(SRCS:Mstrchr.s)
68OBJS+=	strchr.o
69strchr.o: index.c
70	${CC} -DSTRCHR ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
71	@${LD} -x -r ${.TARGET}
72	@mv a.out ${.TARGET}
73
74strchr.po: index.c
75	${CC} -DSTRCHR ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
76	@${LD} -X -r ${.TARGET}
77	@mv a.out ${.TARGET}
78.endif
79
80# if no machine specific strrchr(3), build one out of rindex(3).
81.if empty(SRCS:Mstrrchr.s)
82OBJS+=	strrchr.o
83strrchr.o: rindex.c
84	${CC} -DSTRRCHR ${CFLAGS} -c ${.ALLSRC} -o ${.TARGET}
85	@${LD} -x -r ${.TARGET}
86	@mv a.out ${.TARGET}
87
88strrchr.po: rindex.c
89	${CC} -DSTRRCHR ${CFLAGS} -c -p ${.ALLSRC} -o ${.TARGET}
90	@${LD} -X -r ${.TARGET}
91	@mv a.out ${.TARGET}
92.endif
93
94MAN3+=	bcmp.0 bcopy.0 bstring.0 bzero.0 ffs.0 index.0 memccpy.0 memchr.0 \
95	memcmp.0 memcpy.0 memmove.0 memset.0 rindex.0 strcasecmp.0 strcat.0 \
96	strchr.0 strcmp.0 strcoll.0 strcpy.0 strcspn.0 strftime.0 string.0 \
97	strlen.0 strmode.0 strdup.0 strerror.0 strpbrk.0 strrchr.0 strsep.0 \
98	strspn.0 strstr.0 strtok.0 strxfrm.0 swab.0
99
100MLINKS+=strcasecmp.3 strncasecmp.3
101MLINKS+=strcat.3 strncat.3
102MLINKS+=strcmp.3 strncmp.3
103MLINKS+=strcpy.3 strncpy.3
104MLINKS+=strerror.3 perror.3
105