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