]> git.proxmox.com Git - mirror_ovs.git/blame - Makefile.am
nx-match: Don't append "ct_nw_proto" nx_match if mask not set.
[mirror_ovs.git] / Makefile.am
CommitLineData
939f4522 1# Copyright (C) 2007-2017 Nicira, Inc.
a14bc59f
BP
2#
3# Copying and distribution of this file, with or without modification,
4# are permitted in any medium without royalty provided the copyright
5# notice and this notice are preserved. This file is offered as-is,
6# without warranty of any kind.
7
064af421
BP
8AUTOMAKE_OPTIONS = foreign subdir-objects
9ACLOCAL_AMFLAGS = -I m4
10SUBDIRS = datapath
11
064af421 12AM_CPPFLAGS = $(SSL_CFLAGS)
cf06c2e9 13AM_LDFLAGS = $(SSL_LDFLAGS)
95626395 14AM_LDFLAGS += $(OVS_LDFLAGS)
e42dfc72
AS
15
16if WIN32
17AM_CPPFLAGS += -I $(top_srcdir)/include/windows
c803536e 18AM_CPPFLAGS += -I $(top_srcdir)/datapath-windows/include
94887cf4 19AM_CPPFLAGS += $(PTHREAD_INCLUDES)
b0e1bce5 20AM_CPPFLAGS += $(MSVC_CFLAGS)
94887cf4 21AM_LDFLAGS += $(PTHREAD_LDFLAGS)
1cb3649c 22AM_LDFLAGS += $(MSVC64_LDFLAGS)
e42dfc72
AS
23endif
24
064af421 25AM_CPPFLAGS += -I $(top_srcdir)/include
837eefc7 26AM_CPPFLAGS += -I $(top_builddir)/include
064af421 27AM_CPPFLAGS += -I $(top_srcdir)/lib
611d30ce 28AM_CPPFLAGS += -I $(top_builddir)/lib
064af421 29
8605a29b
PK
30AM_CPPFLAGS += $(SSL_INCLUDES)
31
064af421 32AM_CFLAGS = -Wstrict-prototypes
d161c099 33AM_CFLAGS += $(WARNING_FLAGS)
95626395 34AM_CFLAGS += $(OVS_CFLAGS)
064af421 35
58397e6c
KT
36if DPDK_NETDEV
37AM_CFLAGS += -D_FILE_OFFSET_BITS=64
38endif
39
064af421
BP
40if NDEBUG
41AM_CPPFLAGS += -DNDEBUG
42AM_CFLAGS += -fomit-frame-pointer
064af421
BP
43endif
44
b02e1154
GS
45if WIN32
46psep=";"
47else
48psep=":"
49endif
853d1083
BP
50# PYTHONDONTWRITEBYTECODE=yes keeps Python from creating .pyc and .pyo
51# files. Creating .py[co] works OK for any given version of Open
52# vSwitch, but it causes trouble if you switch from a version with
53# foo/__init__.py into an (older) version with plain foo.py, since
54# foo/__init__.pyc will cause Python to ignore foo.py.
e23812fc
BP
55run_python = \
56 PYTHONPATH=$(top_srcdir)/python$(psep)$$PYTHONPATH \
57 PYTHONDONTWRITEBYTECODE=yes $(PYTHON)
853d1083 58
22c79496 59ALL_LOCAL =
d879a707 60BUILT_SOURCES =
064af421 61CLEANFILES =
15b619e2 62CLEAN_LOCAL =
064af421 63DISTCLEANFILES =
79982e90 64PYCOV_CLEAN_FILES = build-aux/check-structs,cover
4441a01c 65
c431227e 66EXTRA_DIST = \
8a97dc6e 67 AUTHORS.rst \
255efa72 68 CONTRIBUTING.rst \
2eb98b60 69 MAINTAINERS.rst \
c431227e 70 README.rst \
4441a01c 71 NOTICE \
826bc7b6 72 .travis.yml \
40a75bbf
LR
73 .travis/linux-build.sh \
74 .travis/linux-prepare.sh \
75 .travis/osx-build.sh \
76 .travis/osx-prepare.sh \
12c96b8a 77 appveyor.yml \
0027492d 78 boot.sh \
c9b94429 79 build-aux/cccl \
abc67c1e 80 build-aux/cksum-schema-check \
39916858 81 build-aux/calculate-schema-cksum \
4441a01c 82 build-aux/dist-docs \
6ca37677 83 build-aux/sodepends.pl \
94512c4a 84 build-aux/soexpand.pl \
a4e3c495 85 build-aux/xml2nroff \
6ca37677 86 $(MAN_FRAGMENTS) \
1ce96d2a 87 $(MAN_ROOTS) \
ef9c432c 88 Vagrantfile \
673b80ea
RB
89 Vagrantfile-FreeBSD \
90 .mailmap
064af421
BP
91bin_PROGRAMS =
92sbin_PROGRAMS =
93bin_SCRIPTS =
87103e1f 94DIST_HOOKS =
064af421 95dist_man_MANS =
3b12adda 96dist_pkgdata_DATA =
064af421
BP
97dist_pkgdata_SCRIPTS =
98dist_sbin_SCRIPTS =
b2df0225 99dist_scripts_SCRIPTS =
429ebf21 100dist_scripts_DATA =
b2df0225 101INSTALL_DATA_LOCAL =
44852fdf 102UNINSTALL_LOCAL =
064af421 103man_MANS =
0027492d 104MAN_FRAGMENTS =
6ca37677 105MAN_ROOTS =
c3bb4bd7 106noinst_DATA =
064af421 107noinst_HEADERS =
38b7a52b 108lib_LTLIBRARIES =
045b2e5c 109noinst_man_MANS =
064af421
BP
110noinst_PROGRAMS =
111noinst_SCRIPTS =
00732bf5 112OVSIDL_BUILT =
9c16ed64 113pkgdata_DATA =
b2df0225 114sbin_SCRIPTS =
43bb5f82 115scripts_SCRIPTS =
2c9907cd 116completion_SCRIPTS =
429ebf21 117scripts_DATA =
c3bb4bd7 118SUFFIXES =
15b619e2 119check_DATA =
08d42548 120check_SCRIPTS =
81696de0 121pkgconfig_DATA =
115d8719 122FLAKE8_PYFILES =
064af421 123
43bb5f82 124scriptsdir = $(pkgdatadir)/scripts
2c9907cd 125completiondir = $(sysconfdir)/bash_completion.d
81696de0 126pkgconfigdir = $(libdir)/pkgconfig
43bb5f82 127
9741af79
BP
128# This ensures that files added to EXTRA_DIST are always distributed,
129# even if they are inside an Automake if...endif conditional block that is
130# disabled by some particular "configure" run. For more information, see:
131# http://article.gmane.org/gmane.comp.sysutils.automake.general/10891
132noinst_HEADERS += $(EXTRA_DIST)
133
064af421 134ro_c = echo '/* -*- mode: c; buffer-read-only: t -*- */'
cbaa4ffe 135ro_shell = printf '\043 Generated automatically -- do not modify! -*- buffer-read-only: t -*-\n'
064af421 136
c3bb4bd7 137SUFFIXES += .in
064af421 138.in:
ef44aa50 139 $(AM_V_GEN)$(PERL) $(srcdir)/build-aux/soexpand.pl -I$(srcdir) < $< | \
aca1bb54
SF
140 sed \
141 -e 's,[@]PKIDIR[@],$(PKIDIR),g' \
142 -e 's,[@]LOGDIR[@],$(LOGDIR),g' \
143 -e 's,[@]DBDIR[@],$(DBDIR),g' \
144 -e 's,[@]PERL[@],$(PERL),g' \
145 -e 's,[@]PYTHON[@],$(PYTHON),g' \
146 -e 's,[@]RUNDIR[@],$(RUNDIR),g' \
147 -e 's,[@]VERSION[@],$(VERSION),g' \
148 -e 's,[@]localstatedir[@],$(localstatedir),g' \
149 -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \
150 -e 's,[@]sysconfdir[@],$(sysconfdir),g' \
151 -e 's,[@]bindir[@],$(bindir),g' \
152 -e 's,[@]sbindir[@],$(sbindir),g' \
153 -e 's,[@]abs_builddir[@],$(abs_builddir),g' \
154 -e 's,[@]abs_top_srcdir[@],$(abs_top_srcdir),g' \
155 > $@.tmp
00961f7c 156 @if head -n 1 $@.tmp | grep '#!' > /dev/null; then \
aca1bb54 157 chmod +x $@.tmp; \
3b135da3 158 fi
ef44aa50 159 $(AM_V_at) mv $@.tmp $@
064af421 160
99635791
BP
161SUFFIXES += .xml
162%: %.xml
163 $(AM_V_GEN)$(run_python) $(srcdir)/build-aux/xml2nroff $< > $@.tmp \
aca1bb54
SF
164 -I $(srcdir) \
165 --version=$(VERSION) \
166 PKIDIR='$(PKIDIR)' \
167 LOGDIR='$(LOGDIR)' \
168 DBDIR='$(DBDIR)' \
169 PERL='$(PERL)' \
170 PYTHON='$(PYTHON)' \
171 RUNDIR='$(RUNDIR)' \
172 VERSION='$(VERSION)' \
173 localstatedir='$(localstatedir)' \
174 pkgdatadir='$(pkgdatadir)' \
175 sysconfdir='$(sysconfdir)' \
176 bindir='$(bindir)' \
177 sbindir='$(sbindir)'
99635791
BP
178 $(AM_v_at)mv $@.tmp $@
179
79982e90
EJ
180clean-pycov:
181 cd $(srcdir) && rm -f $(PYCOV_CLEAN_FILES)
182CLEAN_LOCAL += clean-pycov
099cf485 183.PHONY: clean-pycov
79982e90 184
87103e1f
BP
185# If we're checked out from a Git repository, make sure that every
186# file that is in Git is distributed.
39376d06
BP
187ALL_LOCAL += dist-hook-git
188dist-hook-git: distfiles
189 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \
aca1bb54
SF
190 (cd datapath && $(MAKE) distfiles); \
191 (cat distfiles; sed 's|^|datapath/|' datapath/distfiles) | \
192 LC_ALL=C sort -u > all-distfiles; \
193 (cd $(srcdir) && git ls-files) | grep -v '\.gitignore$$' | \
194 LC_ALL=C sort -u > all-gitfiles; \
a6da6967 195 LC_ALL=C comm -1 -3 all-distfiles all-gitfiles > missing-distfiles; \
aca1bb54 196 if test -s missing-distfiles; then \
4207d631 197 echo "The following files are in git but not the distribution:"; \
aca1bb54
SF
198 cat missing-distfiles; \
199 exit 1; \
200 fi; \
939f4522
BP
201 if LC_ALL=C grep '\.gitignore$$' all-distfiles; then \
202 echo "See above for list of files that are distributed but"; \
203 echo "should not be."; \
204 exit 1; \
205 fi \
87103e1f 206 fi
39376d06
BP
207CLEANFILES += all-distfiles all-gitfiles missing-distfiles
208# The following is based on commands for the Automake "distdir" target.
209distfiles: Makefile
210 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
211 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
212 list='$(DISTFILES)'; \
213 for file in $$list; do echo $$file; done | \
214 sed -e "s|^$$srcdirstrip/||;t" \
a6da6967 215 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | \
aca1bb54 216 LC_ALL=C sort -u > $@
39376d06 217CLEANFILES += distfiles
b4e1bf8b 218.PHONY: dist-hook-git
87103e1f 219
9e4ba008
BP
220# Check that every .c file includes <config.h>.
221ALL_LOCAL += config-h-check
222config-h-check:
223 @cd $(srcdir); \
224 if test -e .git && (git --version) >/dev/null 2>&1 && \
aca1bb54
SF
225 git --no-pager grep -L '#include <config\.h>' `git ls-files | grep '\.c$$' | \
226 grep -vE '^datapath|^lib/sflow|^third-party|^datapath-windows|^python'`; \
9e4ba008 227 then \
aca1bb54
SF
228 echo "See above for list of violations of the rule that"; \
229 echo "every C source file must #include <config.h>."; \
230 exit 1; \
f7e6e24c
TR
231 fi; \
232 if grep '#include' include/openvswitch/*.h | \
c458e4a3
YHW
233 grep -vE '(<.*>)|("openvswitch)|("openflow)'; \
234 then \
235 echo "See above for list of violations of the rule that"; \
236 echo "public openvswitch header file should not include internal library."; \
237 exit 1; \
238 fi
9e4ba008
BP
239.PHONY: config-h-check
240
34582733
AS
241# Check for printf() type modifiers that MSVC doesn't support.
242ALL_LOCAL += printf-check
243printf-check:
8faeab72
DDP
244 @cd $(srcdir); \
245 if test -e .git && (git --version) >/dev/null 2>&1 && \
aca1bb54
SF
246 git --no-pager grep -n -E -e '%[-+ #0-9.*]*([ztj]|hh)' --and --not -e 'ovs_scan' `git ls-files | grep '\.[ch]$$' | \
247 grep -vE '^datapath|^lib/sflow|^third-party'`; \
34582733 248 then \
aca1bb54
SF
249 echo "See above for list of violations of the rule that"; \
250 echo "'z', 't', 'j', 'hh' printf() type modifiers are"; \
692ac452 251 echo "forbidden. See coding-style.rst for replacements."; \
aca1bb54 252 exit 1; \
34582733
AS
253 fi
254.PHONY: printf-check
255
1514b275
BP
256# Check that certain data structures are always declared "static".
257ALL_LOCAL += static-check
258static-check:
db5ce514 259 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
aca1bb54
SF
260 git --no-pager grep -n -E '^[ ]+(struct vlog_rate_limit|pthread_once_t|struct ovsthread_once).*=' $(srcdir); \
261 then \
262 echo "See above for list of violations of the rule that "; \
263 echo "certain data structures must always be 'static'"; \
264 exit 1; \
265 fi
1514b275 266.PHONY: static-check
db5ce514 267
4958e3ee
BP
268# Check that assert.h is not used outside a whitelist of files.
269ALL_LOCAL += check-assert-h-usage
270check-assert-h-usage:
271 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
aca1bb54
SF
272 (cd $(srcdir) && git --no-pager grep -l -E '[<]assert.h[>]') | \
273 $(EGREP) -v '^lib/(sflow_receiver|vlog).c$$|^tests/'; \
274 then \
275 echo "Files listed above unexpectedly #include <""assert.h"">."; \
276 echo "Please use ovs_assert (from util.h) instead of assert."; \
277 exit 1; \
278 fi
4958e3ee
BP
279.PHONY: check-assert-h-usage
280
64746850
BP
281# Check that LITTLE_ENDIAN and BIG_ENDIAN are not used unless BYTE_ORDER is
282# also mentioned. (<endian.h> always defines the former two constants. They
283# must be compared to BYTE_ORDER to get the machine's correct endianness. But
284# it is better to use WORDS_BIGENDIAN.)
285ALL_LOCAL += check-endian
286check-endian:
287 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
aca1bb54
SF
288 (cd $(srcdir) && git --no-pager grep -l -E \
289 -e 'BIG_ENDIAN|LITTLE_ENDIAN' --and --not -e 'BYTE_ORDER' | \
290 $(EGREP) -v '^datapath/'); \
291 then \
292 echo "See above for list of files that misuse LITTLE""_ENDIAN"; \
293 echo "or BIG""_ENDIAN. Please use WORDS_BIGENDIAN instead."; \
294 exit 1; \
295 fi
64746850
BP
296.PHONY: check-endian
297
6a3e30f3
BP
298ALL_LOCAL += thread-safety-check
299thread-safety-check:
8faeab72
DDP
300 @cd $(srcdir); \
301 if test -e .git && (git --version) >/dev/null 2>&1 && \
aca1bb54
SF
302 grep -n -f build-aux/thread-safety-blacklist \
303 `git ls-files | grep '\.[ch]$$' \
304 | $(EGREP) -v '^datapath|^lib/sflow|^third-party'` /dev/null \
305 | $(EGREP) -v ':[ ]*/?\*'; \
6a3e30f3 306 then \
aca1bb54
SF
307 echo "See above for list of calls to functions that are"; \
308 echo "blacklisted due to thread safety issues"; \
309 exit 1; \
6a3e30f3
BP
310 fi
311EXTRA_DIST += build-aux/thread-safety-blacklist
c9172561 312.PHONY: thread-safety-check
6a3e30f3 313
0b2c7e69
BP
314# Check that "ip" is used in preference to "ifconfig", because
315# "ifconfig" is not installed ubiquitously anymore.
316ALL_LOCAL += check-ifconfig
317check-ifconfig:
318 @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
319 (cd $(srcdir) && git --no-pager grep -l -E -e 'ifconfig' | \
320 $(EGREP) -v 'Makefile.am|ovs-vsctl-bashcomp|openvswitch-custom\.te'); \
321 then \
322 echo "See above for list of files that use or reference"; \
323 echo "'ifconfig'. Please use 'ip' instead."; \
324 exit 1; \
325 fi
326.PHONY: check-ifconfig
327
0027492d
BP
328if HAVE_GROFF
329ALL_LOCAL += manpage-check
1261619f
BP
330manpage-check: $(man_MANS) $(dist_man_MANS) $(noinst_man_MANS)
331 @error=false; \
332 for manpage in $?; do \
aca1bb54
SF
333 LANG=en_US.UTF-8 groff -w mac -w delim -w escape -w input -w missing -w tab -T utf8 -man -p -z $$manpage >$@.tmp 2>&1; \
334 if grep warning: $@.tmp; then error=:; fi; \
335 rm -f $@.tmp; \
0027492d 336 done; \
be09aa10
EJ
337 if $$error; then exit 1; else touch $@; fi
338 $(AM_V_GEN) touch -c $@
0027492d
BP
339CLEANFILES += manpage-check
340endif
341
115d8719
RB
342if HAVE_FLAKE8
343ALL_LOCAL += flake8-check
007ec24d 344# http://flake8.readthedocs.org/en/latest/warnings.html
f3068bff
RB
345# All warnings explicitly selected or ignored should be listed below.
346#
347# E***, W*** -- warnings from pep8
348# E121 continuation line under-indented for hanging indent (only from flake8 v2.0)
349# E123 closing bracket does not match indentation of opening bracket's line
350# E125 continuation line with same indent as next logical line (only from flake8 v2.0)
351# E126 continuation line over-indented for hanging indent
352# E127 continuation line over-indented for visual indent
353# E128 continuation line under-indented for visual indent
354# E129 visually indented line with same indent as next logical line
355# E131 continuation line unaligned for hanging indent
356# W503 line break before binary operator
357# F*** -- warnings native to flake8
358# F811 redefinition of unused <name> from line <N> (only from flake8 v2.0)
007ec24d
NS
359# D*** -- warnings from flake8-docstrings plugin
360# H*** -- warnings from flake8 hacking plugin (custom style checks beyond PEP8)
f3068bff 361# H231 Python 3.x incompatible 'except x,y:' construct
56ec0611 362# H232 Python 3.x incompatible octal 077 should be written as 0o77
8ea171ab 363# H233 Python 3.x incompatible use of print operator
03756304 364# H238 old style class declaration, use new style (inherit from `object`)
aca1bb54 365FLAKE8_SELECT = H231,H232,H233,H238
92d8490f 366FLAKE8_IGNORE = E121,E123,E125,E126,E127,E128,E129,E131,W503,F811,D,H,I
115d8719 367flake8-check: $(FLAKE8_PYFILES)
308bf988 368 $(FLAKE8_WERROR)$(AM_V_GEN) \
aca1bb54
SF
369 src='$^' && \
370 flake8 $$src --select=$(FLAKE8_SELECT) $(FLAKE8_FLAGS) && \
371 flake8 $$src --ignore=$(FLAKE8_IGNORE) $(FLAKE8_FLAGS) && \
372 touch $@
115d8719 373endif
968eec59 374CLEANFILES += flake8-check
115d8719 375
6ca37677
BP
376include $(srcdir)/manpages.mk
377$(srcdir)/manpages.mk: $(MAN_ROOTS) build-aux/sodepends.pl
378 @$(PERL) $(srcdir)/build-aux/sodepends.pl -I. -I$(srcdir) $(MAN_ROOTS) >$(@F).tmp
379 @if cmp -s $(@F).tmp $@; then \
aca1bb54
SF
380 touch $@; \
381 rm -f $(@F).tmp; \
6ca37677 382 else \
aca1bb54 383 mv $(@F).tmp $@; \
6ca37677
BP
384 fi
385CLEANFILES += manpage-dep-check
386
bd9d7025 387if VSTUDIO_DDK
e02b8fb0
AS
388ALL_LOCAL += ovsext
389ovsext: datapath-windows/ovsext.sln $(srcdir)/datapath-windows/include/OvsDpInterface.h
e90a8753
AS
390 MSBuild.exe //maxcpucount datapath-windows/ovsext.sln /target:Build /property:Configuration="Win8$(VSTUDIO_CONFIG)" /property:Version="$(PACKAGE_VERSION)"
391 MSBuild.exe //maxcpucount datapath-windows/ovsext.sln /target:Build /property:Configuration="Win8.1$(VSTUDIO_CONFIG)" /property:Version="$(PACKAGE_VERSION)"
bd9d7025
AS
392
393CLEAN_LOCAL += ovsext_clean
394ovsext_clean: datapath-windows/ovsext.sln
e90a8753
AS
395 MSBuild.exe //maxcpucount datapath-windows/ovsext.sln /target:Clean /property:Configuration="Win8$(VSTUDIO_CONFIG)" /property:Version="$(PACKAGE_VERSION)"
396 MSBuild.exe //maxcpucount datapath-windows/ovsext.sln /target:Clean /property:Configuration="Win8.1$(VSTUDIO_CONFIG)" /property:Version="$(PACKAGE_VERSION)"
bd9d7025 397endif
e02b8fb0 398.PHONY: ovsext
bd9d7025 399
30b79363
BB
400clang-analyze: clean
401 @which clang scan-build >/dev/null 2>&1 || \
aca1bb54 402 (echo "Unable to find clang/scan-build, Install clang,clang-analyzer packages"; exit 1)
30b79363
BB
403 @$(MKDIR_P) "$(srcdir)/tests/clang-analyzer-results"
404 @scan-build -o $(srcdir)/tests/clang-analyzer-results --use-cc=$(CC) $(MAKE)
405.PHONY: clang-analyze
406
87103e1f 407dist-hook: $(DIST_HOOKS)
22c79496 408all-local: $(ALL_LOCAL)
15b619e2 409clean-local: $(CLEAN_LOCAL)
b2df0225 410install-data-local: $(INSTALL_DATA_LOCAL)
44852fdf
BP
411uninstall-local: $(UNINSTALL_LOCAL)
412.PHONY: $(DIST_HOOKS) $(CLEAN_LOCAL) $(INSTALL_DATA_LOCAL) $(UNINSTALL_LOCAL)
87103e1f 413
3a14d239
BP
414modules_install:
415if LINUX_ENABLED
416 cd datapath/linux && $(MAKE) modules_install
417endif
418
4441a01c 419dist-docs:
6b304335 420 VERSION=$(VERSION) MAKE='$(MAKE)' $(srcdir)/build-aux/dist-docs $(srcdir) $(docs)
4441a01c
BP
421.PHONY: dist-docs
422
8c254406 423include Documentation/automake.mk
ed1be787 424include m4/automake.mk
064af421 425include lib/automake.mk
8cd4882f 426include ofproto/automake.mk
064af421
BP
427include utilities/automake.mk
428include tests/automake.mk
429include include/automake.mk
430include third-party/automake.mk
431include debian/automake.mk
432include vswitchd/automake.mk
f85f8ebb 433include ovsdb/automake.mk
c434706a 434include rhel/automake.mk
064af421 435include xenserver/automake.mk
0be6140a 436include python/automake.mk
eeecce05 437include tutorial/automake.mk
add17b69 438include vtep/automake.mk
c803536e 439include datapath-windows/automake.mk
c640e3ce 440include datapath-windows/include/automake.mk
d183efc2 441include windows/automake.mk
fe36184b 442include ovn/automake.mk
9b897c91 443include selinux/automake.mk
e522804f 444include build-aux/automake.mk