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