Makefile (1044B)
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 6# cflags that the main configure has already done for us. 7# 8 9BUILD_DIR := $(CURDIR)/../.. 10 11include $(BUILD_DIR)/config-host.mak 12 13VPATH += $(SRC_PATH)/contrib/plugins 14 15NAMES := 16NAMES += execlog 17NAMES += hotblocks 18NAMES += hotpages 19NAMES += howvec 20NAMES += lockstep 21NAMES += hwprofile 22NAMES += cache 23 24SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES))) 25 26# The main QEMU uses Glib extensively so it's perfectly fine to use it 27# in plugins (which many example do). 28CFLAGS = $(GLIB_CFLAGS) 29CFLAGS += -fPIC -Wall $(filter -W%, $(QEMU_CFLAGS)) 30CFLAGS += $(if $(findstring no-psabi,$(QEMU_CFLAGS)),-Wpsabi) 31CFLAGS += -I$(SRC_PATH)/include/qemu 32 33all: $(SONAMES) 34 35%.o: %.c 36 $(CC) $(CFLAGS) -c -o $@ $< 37 38lib%.so: %.o 39 $(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDLIBS) 40 41clean: 42 rm -f *.o *.so *.d 43 rm -Rf .libs 44 45.PHONY: all clean