1 # $Id: Makefile,v 1.67 2016/06/07 00:46:12 sjg Exp $
3 # Base version on src date
4 _MAKE_VERSION
= 20160606
61 # this file gets generated by configure
62 .
-include "Makefile.config"
65 SRCS
+= ${LIBOBJS
:T
:.o
=.c
}
72 DEFAULT_SYS_PATH?
= ${prefix}/share
/mk
75 CFLAGS
+= -D_PATH_DEFSYSPATH
=\"${DEFAULT_SYS_PATH}\"
76 CFLAGS
+= ${COPTS.
${.ALLSRC
:M
*.c
:T
:u
}}
77 COPTS.main.c
+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\""
79 # meta mode can be useful even without filemon
80 FILEMON_H ?
= /usr
/include/dev
/filemon
/filemon.h
81 .if exists
(${FILEMON_H}) && ${FILEMON_H
:T
} == "filemon.h"
82 COPTS.meta.c
+= -DHAVE_FILEMON_H
-I
${FILEMON_H
:H
}
86 .PATH
: ${srcdir}/lst.lib
88 .if make
(obj
) || make
(clean)
95 .if
(${PROG} != "make")
96 CLEANFILES
+= my.history
97 .if make
(${MAN}) ||
!exists
(${srcdir}/${MAN})
98 my.history
: ${MAKEFILE}
100 echo
"is derived from NetBSD"; \
101 echo
".Xr make 1 ."; \
102 echo
"It uses autoconf to facilitate portability to other platforms."; \
106 ${MAN}: make
.1 my.history
108 @sed
-e
's/^.Nx/NetBSD/' -e
'/^.Nm/s/make/${PROG}/' \
109 -e
'/^.Sh HISTORY/rmy.history' \
110 -e
'/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make
.1 > $@
112 all beforeinstall
: ${MAN}
118 MANDEST?
= ${MANDIR}/${MANTARGET}1
120 .if
${MANTARGET} == "cat"
126 CPPFLAGS
+= -DMAKE_NATIVE
-DHAVE_CONFIG_H
127 COPTS.var.c
+= -Wno-cast-qual
128 COPTS.job.c
+= -Wno-format-nonliteral
129 COPTS.parse.c
+= -Wno-format-nonliteral
130 COPTS.var.c
+= -Wno-format-nonliteral
133 SHAREDIR
= ${SHAREDIR.bmake
:U
${prefix}/share
}
134 BINDIR
= ${BINDIR.bmake
:U
${prefix}/bin
}
135 MANDIR
= ${MANDIR.bmake
:U
${SHAREDIR}/man
}
141 # make sure that MAKE_VERSION gets updated.
142 main.o
: ${SRCS} ${MAKEFILE}
144 SHARE_MK?
=${SHAREDIR}/mk
148 .if exists
(${MKSRC}/install-mk
)
149 test -d
${DESTDIR}${SHARE_MK} ||
${INSTALL} -m
${DIRMODE} -d
${DESTDIR}${SHARE_MK}
150 sh
${MKSRC}/install-mk
-v
-m
${NONBINMODE} ${DESTDIR}${SHARE_MK}
152 @echo need to unpack mk.
tar.gz under
${srcdir} or set MKSRC
; false
155 # A simple unit-test driver to help catch regressions
157 cd
${.CURDIR
}/unit-tests
&& MAKEFLAGS
= ${.MAKE
} -r
-m
/ TEST_MAKE
=${TEST_MAKE
:U
${.OBJDIR
}/${PROG
:T
}} ${.TARGET
}