Makefile.inc revision 1.40 1 # $NetBSD: Makefile.inc,v 1.40 2025/09/27 20:59:39 christos 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 sysctl.o \
27 strerror.o strsignal.o syslog.o utmp.o fmtcheck.o \
28 aligned_alloc.o regcomp.o regexec.o wrap.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.sysctl.c+= -I${HACKSRC}/../../../lib/libc/include
69 CPPFLAGS.jemalloc.c+= -I${HACKSRC}/../../../lib/libc/include
70 CPPFLAGS.gethost.c+= -I${HACKSRC}/../../../lib/libc/net
71
72 .if !defined(LIB)
73 libhack.o: ${HACKOBJS}
74 ${LD} -r ${HACK_LD_FLAGS} -o $@ ${.ALLSRC}
75 .endif
76
77 .if 1
78 .PATH.c: \
79 ${HACKSRC} \
80 ${HACKSRC}/../../../lib/libc/gen \
81 ${HACKSRC}/../../../lib/libc/locale \
82 ${HACKSRC}/../../../lib/libc/regex \
83 ${HACKSRC}/../../../lib/libc/stdlib
84 .else
85 # XXX .PATH won't work here, because of crunchgen used by various builds
86 regcomp.o: ${HACKSRC}/../../../lib/libc/regex/regcomp.c
87 regexec.o: ${HACKSRC}/../../../lib/libc/regex/regexec.c
88 getcap.o: ${HACKSRC}/../../../lib/libc/gen/getcap.c
89 getgrent.o: ${HACKSRC}/getgrent.c
90 gethost.o: ${HACKSRC}/gethost.c
91 getnet.o: ${HACKSRC}/getnet.c
92 getnetgr.o: ${HACKSRC}/getnetgr.c
93 getpwent.o: ${HACKSRC}/getpwent.c
94 localeconv.o: ${HACKSRC}/localeconv.c
95 multibyte.o: ${HACKSRC}/multibyte.c
96 perror.o: ${HACKSRC}/perror.c
97 jemalloc.o: ${HACKSRC}/../../../lib/libc/stdlib/jemalloc.c
98 aligned_alloc.o: ${HACKSRC}/../../../lib/libc/stdlib/aligned_alloc.c
99 runetable.o: ${HACKSRC}/../../../lib/libc/locale/runetable.c
100 setlocale.o: ${HACKSRC}/setlocale.c
101 strerror.o: ${HACKSRC}/strerror.c
102 strsignal.o: ${HACKSRC}/strsignal.c
103 syslog.o: ${HACKSRC}/syslog.c
104 sysctl.o: ${HACKSRC}/sysctl.c
105 utmp.o: ${HACKSRC}/utmp.c
106 .if (${USE_YP} != "no")
107 yplib.o: ${HACKSRC}/yplib.c
108 .endif
109 .endif
110