Makefile.inc revision 1.27.6.3 1 # $NetBSD: Makefile.inc,v 1.27.6.3 2020/04/21 18:41:54 martin Exp $
2 #
3 # Include this fragment to build libhack.o
4 # It is .o and not .a to make sure these are the
5 # objects you get (and not the ones in libc.a)
6 #
7
8 #
9 # Required variables:
10 # HACKSRC This directory
11 #
12 # Optional variables:
13 # HACKOBJS Extra objects to build.
14 # The following extra objects are available:
15 # gethost.o cut-down gethostby{name,addr}()
16 # that only supports /etc/hosts
17 #
18
19 .include <bsd.own.mk>
20
21 CPPFLAGS+= -DSMALL
22 CPPFLAGS+= -DLIBHACK
23
24 HACKOBJS+= getcap.o getgrent.o getnet.o getnetgr.o getpwent.o jemalloc.o \
25 localeconv.o multibyte.o perror.o runetable.o setlocale.o \
26 nl_langinfo.o strcasecmp.o \
27 strerror.o strsignal.o syslog.o utmp.o fmtcheck.o \
28 aligned_alloc.o
29
30 .if (${USE_YP} != "no")
31 HACKOBJS+= yplib.o
32 .endif
33
34 .if ${HACK_CURSES:Uno} == "yes"
35 CURSES_SRC!= cd ${HACKSRC}/../../../lib/libcurses && \
36 ${MAKE} DISABLE_WCHAR=yes -v SRCS
37
38 .for s in ${CURSES_SRC}
39 CPPFLAGS.${s}+= -DDISABLE_WCHAR -DSMALL \
40 -I${HACKSRC}/../../../lib/libcurses \
41 -I${HACKSRC}/../../../lib/libterminfo
42 HACKOBJS+= ${s:S/.c/.o/}
43 ${s:S/.c/.o/}: ${HACKSRC}/../../../lib/libcurses/${s}
44 .endfor
45
46 TERMINFO_SRC!= cd ${HACKSRC}/../../../lib/libterminfo && \
47 ${MAKE} SMALLPROG=1 -v SRCS
48 TERMINFO_PATH!= cd ${HACKSRC}/../../../lib/libterminfo && \
49 ${MAKE} -v .OBJDIR
50
51 .for s in ${TERMINFO_SRC}
52 CPPFLAGS.${s}+= -DDISABLE_WCHAR -DSMALL \
53 -I${HACKSRC}/../../../lib/libterminfo \
54 -I${TERMINFO_PATH}
55 HACKOBJS+= ${s:S/.c/.o/}
56 .if ${s:Mhash*} != ""
57 ${s:S/.c/.o/}: ${TERMINFO_PATH}/${s}
58 .else
59 ${s:S/.c/.o/}: ${HACKSRC}/../../../lib/libterminfo/${s}
60 .endif
61 .endfor
62 .endif
63
64 CPPFLAGS.runetable.c+= -I${HACKSRC}/../../../lib/libc/citrus \
65 -DALL_80_TO_FF_SW1
66
67 CPPFLAGS.syslog.c+= -I${HACKSRC}/../../../lib/libc/include
68 CPPFLAGS.jemalloc.c+= -I${HACKSRC}/../../../lib/libc/include
69 CPPFLAGS.gethost.c+= -I${HACKSRC}/../../../lib/libc/net
70
71 .if !defined(LIB)
72 libhack.o: ${HACKOBJS}
73 ${LD} -r -o $@ ${.ALLSRC}
74 .endif
75
76 .if 1
77 .PATH.c: \
78 ${HACKSRC} \
79 ${HACKSRC}/../../../lib/libc/gen \
80 ${HACKSRC}/../../../lib/libc/locale \
81 ${HACKSRC}/../../../lib/libc/stdlib
82 .else
83 # XXX .PATH won't work here, because of crunchgen used by various builds
84 getcap.o: ${HACKSRC}/../../../lib/libc/gen/getcap.c
85 getgrent.o: ${HACKSRC}/getgrent.c
86 gethost.o: ${HACKSRC}/gethost.c
87 getnet.o: ${HACKSRC}/getnet.c
88 getnetgr.o: ${HACKSRC}/getnetgr.c
89 getpwent.o: ${HACKSRC}/getpwent.c
90 localeconv.o: ${HACKSRC}/localeconv.c
91 multibyte.o: ${HACKSRC}/multibyte.c
92 perror.o: ${HACKSRC}/perror.c
93 jemalloc.o: ${HACKSRC}/../../../lib/libc/stdlib/jemalloc.c
94 aligned_alloc.o: ${HACKSRC}/../../../lib/libc/stdlib/aligned_alloc.c
95 runetable.o: ${HACKSRC}/../../../lib/libc/locale/runetable.c
96 setlocale.o: ${HACKSRC}/setlocale.c
97 strerror.o: ${HACKSRC}/strerror.c
98 strsignal.o: ${HACKSRC}/strsignal.c
99 syslog.o: ${HACKSRC}/syslog.c
100 utmp.o: ${HACKSRC}/utmp.c
101 .if (${USE_YP} != "no")
102 yplib.o: ${HACKSRC}/yplib.c
103 .endif
104 .endif
105