Home | History | Annotate | Line # | Download | only in libhack
Makefile.inc revision 1.33
      1  1.33       roy # $NetBSD: Makefile.inc,v 1.33 2020/03/01 22:47:26 roy Exp $
      2  1.15     lukem #
      3   1.1       gwr # Include this fragment to build libhack.o
      4   1.1       gwr # It is .o and not .a to make sure these are the
      5   1.1       gwr # objects you get (and not the ones in libc.a)
      6  1.15     lukem #
      7   1.1       gwr 
      8  1.15     lukem #
      9  1.15     lukem # Required variables:
     10  1.15     lukem #	HACKSRC		This directory
     11  1.15     lukem #
     12  1.15     lukem # Optional variables:
     13  1.15     lukem #	HACKOBJS	Extra objects to build.
     14  1.15     lukem #			The following extra objects are available:
     15  1.15     lukem #			gethost.o	cut-down gethostby{name,addr}()
     16  1.15     lukem #					that only supports /etc/hosts
     17  1.15     lukem #
     18  1.15     lukem 
     19  1.29       roy .include <bsd.own.mk>
     20  1.29       roy 
     21  1.17  christos CPPFLAGS+=	-DSMALL
     22  1.27      manu CPPFLAGS+=	-DLIBHACK
     23  1.33       roy 
     24  1.33       roy # Build as re-entrant.
     25  1.33       roy # A few tool using libhack, such as zpool on the ramdisk-zfsroot,
     26  1.33       roy # expect this and it's simpler just to set it globally rather than
     27  1.33       roy # debugging why stuff randomly crashes.
     28  1.33       roy CPPFLAGS+=	-D_REENTRANT
     29  1.33       roy 
     30  1.28  christos HACKOBJS+=	getcap.o getgrent.o getnet.o getnetgr.o getpwent.o jemalloc.o \
     31  1.22    martin 		localeconv.o multibyte.o perror.o runetable.o setlocale.o \
     32  1.31    martin 		nl_langinfo.o strcasecmp.o \
     33  1.30  christos 		strerror.o strsignal.o syslog.o utmp.o fmtcheck.o
     34  1.29       roy 
     35  1.29       roy .if (${USE_YP} != "no")
     36  1.29       roy HACKOBJS+=	yplib.o
     37  1.29       roy .endif
     38   1.1       gwr 
     39  1.32    martin .if ${HACK_CURSES:Uno} == "yes"
     40  1.32    martin CURSES_SRC!=	cd ${HACKSRC}/../../../lib/libcurses && \
     41  1.32    martin 		${MAKE} DISABLE_WCHAR=yes -v SRCS
     42  1.32    martin 
     43  1.32    martin .for s in ${CURSES_SRC}
     44  1.32    martin CPPFLAGS.${s}+=	-DDISABLE_WCHAR -DSMALL \
     45  1.32    martin 		-I${HACKSRC}/../../../lib/libcurses \
     46  1.32    martin 		-I${HACKSRC}/../../../lib/libterminfo
     47  1.32    martin HACKOBJS+=	${s:S/.c/.o/}
     48  1.32    martin ${s:S/.c/.o/}:	${HACKSRC}/../../../lib/libcurses/${s}
     49  1.32    martin .endfor
     50  1.32    martin .endif
     51  1.32    martin 
     52  1.23   tnozaki CPPFLAGS.runetable.c+= -I${HACKSRC}/../../../lib/libc/citrus \
     53  1.23   tnozaki 			-DALL_80_TO_FF_SW1
     54  1.22    martin 
     55  1.24  christos CPPFLAGS.syslog.c+= -I${HACKSRC}/../../../lib/libc/include
     56  1.28  christos CPPFLAGS.jemalloc.c+= -I${HACKSRC}/../../../lib/libc/include
     57  1.25  christos CPPFLAGS.gethost.c+= -I${HACKSRC}/../../../lib/libc/net
     58  1.24  christos 
     59  1.28  christos .if !defined(LIB)
     60  1.15     lukem libhack.o: ${HACKOBJS}
     61  1.26  christos 	${LD} -r -o $@ ${.ALLSRC}
     62  1.28  christos .endif
     63   1.2       gwr 
     64  1.26  christos .if 1
     65  1.28  christos .PATH.c: \
     66  1.28  christos 	${HACKSRC} \
     67  1.28  christos 	${HACKSRC}/../../../lib/libc/gen \
     68  1.28  christos 	${HACKSRC}/../../../lib/libc/locale \
     69  1.28  christos 	${HACKSRC}/../../../lib/libc/stdlib
     70  1.26  christos .else
     71  1.15     lukem # XXX .PATH won't work here, because of crunchgen used by various builds
     72  1.17  christos getcap.o:	${HACKSRC}/../../../lib/libc/gen/getcap.c
     73  1.15     lukem getgrent.o:	${HACKSRC}/getgrent.c
     74  1.15     lukem gethost.o:	${HACKSRC}/gethost.c
     75  1.15     lukem getnet.o:	${HACKSRC}/getnet.c
     76  1.15     lukem getnetgr.o:	${HACKSRC}/getnetgr.c
     77  1.15     lukem getpwent.o:	${HACKSRC}/getpwent.c
     78  1.15     lukem localeconv.o:	${HACKSRC}/localeconv.c
     79  1.21  christos multibyte.o:	${HACKSRC}/multibyte.c
     80  1.15     lukem perror.o:	${HACKSRC}/perror.c
     81  1.28  christos jemalloc.o:	${HACKSRC}/../../../lib/libc/stdlib/jemalloc.c
     82  1.22    martin runetable.o:	${HACKSRC}/../../../lib/libc/locale/runetable.c
     83  1.15     lukem setlocale.o:	${HACKSRC}/setlocale.c
     84  1.15     lukem strerror.o:	${HACKSRC}/strerror.c
     85  1.15     lukem strsignal.o:	${HACKSRC}/strsignal.c
     86  1.18  christos syslog.o:	${HACKSRC}/syslog.c
     87  1.15     lukem utmp.o:		${HACKSRC}/utmp.c
     88  1.29       roy .if (${USE_YP} != "no")
     89  1.15     lukem yplib.o:	${HACKSRC}/yplib.c
     90  1.26  christos .endif
     91  1.29       roy .endif
     92