]> git.proxmox.com Git - mirror_qemu.git/blame - contrib/plugins/Makefile
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
[mirror_qemu.git] / contrib / plugins / Makefile
CommitLineData
c17a386b
AB
1# -*- Mode: makefile -*-
2#
3# This Makefile example is fairly independent from the main makefile
4# so users can take and adapt it for their build. We only really
5# include config-host.mak so we don't have to repeat probing for
fc9a809e 6# programs that the main configure has already done for us.
c17a386b
AB
7#
8
9BUILD_DIR := $(CURDIR)/../..
10
11include $(BUILD_DIR)/config-host.mak
12
13VPATH += $(SRC_PATH)/contrib/plugins
14
15NAMES :=
3d7caf14 16NAMES += execlog
c17a386b
AB
17NAMES += hotblocks
18NAMES += hotpages
19NAMES += howvec
20NAMES += lockstep
a622d64e 21NAMES += hwprofile
e2c5557c 22NAMES += cache
227b45dc 23NAMES += drcov
c17a386b
AB
24
25SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES)))
26
27# The main QEMU uses Glib extensively so it's perfectly fine to use it
28# in plugins (which many example do).
fc9a809e 29CFLAGS := $(shell $(PKG_CONFIG) --cflags glib-2.0)
95caf1fb 30CFLAGS += -fPIC -Wall
a4cc0b7d 31CFLAGS += $(if $(CONFIG_DEBUG_TCG), -ggdb -O0)
c17a386b
AB
32CFLAGS += -I$(SRC_PATH)/include/qemu
33
34all: $(SONAMES)
35
36%.o: %.c
37 $(CC) $(CFLAGS) -c -o $@ $<
38
39lib%.so: %.o
40 $(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDLIBS)
41
42clean:
43 rm -f *.o *.so *.d
44 rm -Rf .libs
45
46.PHONY: all clean