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