Home | History | Annotate | Line # | Download | only in libhack
Makefile.inc revision 1.27.6.2
      1 # $NetBSD: Makefile.inc,v 1.27.6.2 2020/04/13 07:45:36 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 
     29 .if (${USE_YP} != "no")
     30 HACKOBJS+=	yplib.o
     31 .endif
     32 
     33 .if ${HACK_CURSES:Uno} == "yes"
     34 CURSES_SRC!=	cd ${HACKSRC}/../../../lib/libcurses && \
     35 		${MAKE} DISABLE_WCHAR=yes -v SRCS
     36 
     37 .for s in ${CURSES_SRC}
     38 CPPFLAGS.${s}+=	-DDISABLE_WCHAR -DSMALL \
     39 		-I${HACKSRC}/../../../lib/libcurses \
     40 		-I${HACKSRC}/../../../lib/libterminfo
     41 HACKOBJS+=	${s:S/.c/.o/}
     42 ${s:S/.c/.o/}:	${HACKSRC}/../../../lib/libcurses/${s}
     43 .endfor
     44 
     45 TERMINFO_SRC!=	cd ${HACKSRC}/../../../lib/libterminfo && \
     46 		${MAKE} SMALLPROG=1 -v SRCS
     47 TERMINFO_PATH!=	cd ${HACKSRC}/../../../lib/libterminfo && \
     48 		${MAKE} -v .OBJDIR
     49 
     50 .for s in ${TERMINFO_SRC}
     51 CPPFLAGS.${s}+=	-DDISABLE_WCHAR -DSMALL \
     52 		-I${HACKSRC}/../../../lib/libterminfo \
     53 		-I${TERMINFO_PATH}
     54 HACKOBJS+=	${s:S/.c/.o/}
     55 .if ${s:Mhash*} != ""
     56 ${s:S/.c/.o/}:	${TERMINFO_PATH}/${s}
     57 .else
     58 ${s:S/.c/.o/}:	${HACKSRC}/../../../lib/libterminfo/${s}
     59 .endif
     60 .endfor
     61 .endif
     62 
     63 CPPFLAGS.runetable.c+= -I${HACKSRC}/../../../lib/libc/citrus \
     64 			-DALL_80_TO_FF_SW1
     65 
     66 CPPFLAGS.syslog.c+= -I${HACKSRC}/../../../lib/libc/include
     67 CPPFLAGS.jemalloc.c+= -I${HACKSRC}/../../../lib/libc/include
     68 CPPFLAGS.gethost.c+= -I${HACKSRC}/../../../lib/libc/net
     69 
     70 .if !defined(LIB)
     71 libhack.o: ${HACKOBJS}
     72 	${LD} -r -o $@ ${.ALLSRC}
     73 .endif
     74 
     75 .if 1
     76 .PATH.c: \
     77 	${HACKSRC} \
     78 	${HACKSRC}/../../../lib/libc/gen \
     79 	${HACKSRC}/../../../lib/libc/locale \
     80 	${HACKSRC}/../../../lib/libc/stdlib
     81 .else
     82 # XXX .PATH won't work here, because of crunchgen used by various builds
     83 getcap.o:	${HACKSRC}/../../../lib/libc/gen/getcap.c
     84 getgrent.o:	${HACKSRC}/getgrent.c
     85 gethost.o:	${HACKSRC}/gethost.c
     86 getnet.o:	${HACKSRC}/getnet.c
     87 getnetgr.o:	${HACKSRC}/getnetgr.c
     88 getpwent.o:	${HACKSRC}/getpwent.c
     89 localeconv.o:	${HACKSRC}/localeconv.c
     90 multibyte.o:	${HACKSRC}/multibyte.c
     91 perror.o:	${HACKSRC}/perror.c
     92 jemalloc.o:	${HACKSRC}/../../../lib/libc/stdlib/jemalloc.c
     93 runetable.o:	${HACKSRC}/../../../lib/libc/locale/runetable.c
     94 setlocale.o:	${HACKSRC}/setlocale.c
     95 strerror.o:	${HACKSRC}/strerror.c
     96 strsignal.o:	${HACKSRC}/strsignal.c
     97 syslog.o:	${HACKSRC}/syslog.c
     98 utmp.o:		${HACKSRC}/utmp.c
     99 .if (${USE_YP} != "no")
    100 yplib.o:	${HACKSRC}/yplib.c
    101 .endif
    102 .endif
    103