target/ppc: move Vsr* macros from internal.h to cpu.h
[qemu/kevin.git] / slirp / Makefile
blob6d48f626baee876770d9f2289d7eb215e2eba1dd
1 ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
2 BUILD_DIR ?= .
4 LIBSLIRP = $(BUILD_DIR)/libslirp.a
6 all: $(LIBSLIRP)
8 SRCS := $(wildcard src/*.c)
9 OBJS := $(SRCS:%.c=$(BUILD_DIR)/%.o)
10 DEPS := $(OBJS:%.o=%.d)
12 INC_DIRS := $(BUILD_DIR)/src
13 INC_FLAGS := $(addprefix -I,$(INC_DIRS))
15 override CFLAGS += \
16 -DG_LOG_DOMAIN='"Slirp"' \
17 $(shell $(PKG_CONFIG) --cflags glib-2.0) \
18 $(INC_FLAGS) \
19 -MMD -MP
20 override LDFLAGS += $(shell $(PKG_CONFIG) --libs glib-2.0)
22 $(LIBSLIRP): $(OBJS)
24 .PHONY: clean
26 clean:
27 rm -r $(OBJS) $(DEPS) $(LIBSLIRP)
29 $(BUILD_DIR)/src/%.o: $(ROOT_DIR)/src/%.c
30 @$(MKDIR_P) $(dir $@)
31 $(call quiet-command,$(CC) $(CFLAGS) -c -o $@ $<,"CC","$@")
33 %.a:
34 $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^,"AR","$@")
36 PKG_CONFIG ?= pkg-config
37 MKDIR_P ?= mkdir -p
38 quiet-command-run = $(if $(V),,$(if $2,printf " %-7s %s\n" $2 $3 && ))$1
39 quiet-@ = $(if $(V),,@)
40 quiet-command = $(quiet-@)$(call quiet-command-run,$1,$2,$3)
42 print-%:
43 @echo '$*=$($*)'
45 .SUFFIXES:
47 -include $(DEPS)