1 # $Id: Makefile,v 1.92 2017/05/10 22:29:04 sjg Exp $
3 # Base version on src date
4 _MAKE_VERSION
= 20170510
61 LINKS
= ${BINDIR}/make
${BINDIR}/bmake
63 # this file gets generated by configure
64 .
-include "Makefile.config"
67 SRCS
+= ${LIBOBJS
:T
:.o
=.c
}
74 DEFAULT_SYS_PATH?
= ${prefix}/share
/mk
78 CFLAGS
+= -D_PATH_DEFSYSPATH
=\"${DEFAULT_SYS_PATH}\"
79 CFLAGS
+= -I.
-I
${srcdir} ${XDEFS} -DMAKE_NATIVE
80 CFLAGS
+= ${COPTS.
${.ALLSRC
:M
*.c
:T
:u
}}
81 COPTS.main.c
+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\""
83 # meta mode can be useful even without filemon
84 FILEMON_H ?
= /usr
/include/dev
/filemon
/filemon.h
85 .if exists
(${FILEMON_H}) && ${FILEMON_H
:T
} == "filemon.h"
86 COPTS.meta.c
+= -DHAVE_FILEMON_H
-I
${FILEMON_H
:H
}
90 .PATH
: ${srcdir}/lst.lib
92 .if make
(obj
) || make
(clean)
99 .if
(${PROG} != "make")
100 CLEANFILES
+= my.history
101 .if make
(${MAN}) ||
!exists
(${srcdir}/${MAN})
102 my.history
: ${MAKEFILE}
104 echo
"is derived from NetBSD"; \
105 echo
".Xr make 1 ."; \
106 echo
"It uses autoconf to facilitate portability to other platforms."; \
110 ${MAN}: make
.1 my.history
113 -e
'/^.Dt/s/MAKE/${PROG:tu}/' \
114 -e
's/^.Nx/NetBSD/' \
115 -e
'/^.Nm/s/make/${PROG}/' \
116 -e
'/^.Sh HISTORY/rmy.history' \
117 -e
'/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make
.1 > $@
119 all beforeinstall
: ${MAN}
125 MANDEST?
= ${MANDIR}/${MANTARGET}1
127 .if
${MANTARGET} == "cat"
133 CPPFLAGS
+= -DMAKE_NATIVE
-DHAVE_CONFIG_H
134 COPTS.var.c
+= -Wno-cast-qual
135 COPTS.job.c
+= -Wno-format-nonliteral
136 COPTS.parse.c
+= -Wno-format-nonliteral
137 COPTS.var.c
+= -Wno-format-nonliteral
140 SHAREDIR
= ${SHAREDIR.bmake
:U
${prefix}/share
}
141 BINDIR
= ${BINDIR.bmake
:U
${prefix}/bin
}
142 MANDIR
= ${MANDIR.bmake
:U
${SHAREDIR}/man
}
148 # make sure that MAKE_VERSION gets updated.
149 main.o
: ${SRCS} ${MAKEFILE}
151 # A simple unit-test driver to help catch regressions
153 cd
${.CURDIR
}/unit-tests
&& MAKEFLAGS
= ${.MAKE
} -r
-m
/ TEST_MAKE
=${TEST_MAKE
:U
${.OBJDIR
}/${PROG
:T
}} ${.TARGET
}